]> git.saurik.com Git - apple/system_cmds.git/commitdiff
system_cmds-433.8.tar.gz mac-os-x-1057 mac-os-x-1058 v433.8
authorApple <opensource@apple.com>
Thu, 12 Feb 2009 01:18:35 +0000 (01:18 +0000)
committerApple <opensource@apple.com>
Thu, 12 Feb 2009 01:18:35 +0000 (01:18 +0000)
chpass.tproj/chpass.1
chpass.tproj/chpass.c
latency.tproj/latency.c
login.tproj/login.c
newgrp.tproj/newgrp.c
sc_usage.tproj/trace.codes

index aadaa972b23b9972d7bef9b27f62bccf1027c427..7ee45aebf066dca04cd0888c015a5e1c0844f776 100644 (file)
@@ -291,8 +291,8 @@ update the user database itself.
 Only the user, or the super-user, may edit the information associated
 with the user.
 .Sh FILES
-.Bl -tag -width /tmp/chpass.XXXXXX -compact
-.It Pa /tmp/chpass.XXXXXX
+.Bl -tag -width /etc/chpass.XXXXXX -compact
+.It Pa /etc/chpass.XXXXXX
 temporary copy of the data to edit
 .It Pa /etc/shells
 the list of approved shells
index 596d31a67317fbf63d0d31d906b5aaedd700e052..8eb9f20fee4bb462287364eb6a0687e7fa75c549 100644 (file)
@@ -331,7 +331,7 @@ main(int argc, char *argv[])
        if (op == EDITENTRY) {
 #ifdef OPEN_DIRECTORY
                setrestricted(attrs_orig);
-               snprintf(tfn, sizeof(tfn), "/tmp/%s.XXXXXX", progname);
+               snprintf(tfn, sizeof(tfn), "/etc/%s.XXXXXX", progname);
                if ((tfd = mkstemp(tfn)) == -1)
                        err(1, "%s", tfn);
                attrs = (CFMutableDictionaryRef)edit(tfn, attrs_orig);
index 992401ef96e407f94da51b2345427f4866f9c333..63e92d55192c531bf830a73ee274b51eec9deb86 100644 (file)
@@ -879,7 +879,7 @@ char *argv[];
             exit(EXIT_FAILURE);
        }
 
-       if ((last_decrementer_kd = (kd_buf **)malloc(hi.avail_cpus * sizeof(kd_buf *))) == (kd_buf **)0)
+       if ((last_decrementer_kd = (kd_buf **)malloc(hi.max_cpus * sizeof(kd_buf *))) == (kd_buf **)0)
                quit("can't allocate memory for decrementer tracing info\n");
 
        nanosecs_to_sleep = (double)(num_of_usecs_to_sleep * 1000);
@@ -1299,7 +1299,7 @@ void sample_sc(uint64_t start, uint64_t stop)
        end_of_sample = &((kd_buf *)my_buffer)[count];
 
        /* Always reinitialize the DECR_TRAP array */
-       for (i=0; i < hi.avail_cpus; i++)
+       for (i=0; i < hi.max_cpus; i++)
              last_decrementer_kd[i] = (kd_buf *)my_buffer;
 
        last_mach_sched = (kd_buf *)0;
index 76fbc6f32e77043722c9682c2300bd9ba2578b96..8f290a16aa5789f7e0e50b78a80b9b01f138556a 100644 (file)
@@ -181,6 +181,7 @@ main(argc, argv)
        extern char **environ;
        struct group *gr;
        struct stat st;
+       int prio;
 #ifndef USE_PAM
        struct utmp utmp;
 #endif /* USE_PAM */
@@ -206,6 +207,9 @@ main(argc, argv)
        (void)alarm(timeout);
        (void)signal(SIGQUIT, SIG_IGN);
        (void)signal(SIGINT, SIG_IGN);
+#ifdef __APPLE__
+       prio = getpriority(PRIO_PROCESS, 0);
+#endif
        (void)setpriority(PRIO_PROCESS, 0, 0);
 
        openlog("login", LOG_ODELAY, LOG_AUTH);
@@ -675,6 +679,11 @@ main(argc, argv)
        if (setlogin(pwd->pw_name) < 0)
                syslog(LOG_ERR, "setlogin() failure: %m");
 
+       /* <rdar://problem/6041650> restore process priority if not changing uids */
+       if (uid == (uid_t)pwd->pw_uid) {
+               (void)setpriority(PRIO_PROCESS, 0, prio);
+       }
+       
        /* Discard permissions last so can't get killed and drop core. */
        if (rootlogin)
                (void) setuid(0);
index 2fc9db1796bd0d2b1fc2948d3a368104870ce77c..75bc63a28c93daf079e66945e1d42a3c1147d4fb 100644 (file)
@@ -156,6 +156,7 @@ addgroup(const char *grpname)
        struct group *grp;
        char *ep, *pass;
        char **p;
+       char *grp_passwd;
 
        egid = getegid();
 
@@ -179,10 +180,13 @@ addgroup(const char *grpname)
                        dbmember = 1;
                        break;
                }
-       if (!dbmember && *grp->gr_passwd != '\0' && getuid() != 0) {
+       grp_passwd = grp->gr_passwd;
+       if ((grp_passwd == NULL) || (grp_passwd[0] == '\0'))
+               grp_passwd = "*";
+       if (!dbmember && getuid() != 0) {
                pass = getpass("Password:");
                if (pass == NULL ||
-                   strcmp(grp->gr_passwd, crypt(pass, grp->gr_passwd)) != 0) {
+                   strcmp(grp_passwd, crypt(pass, grp_passwd)) != 0) {
                        fprintf(stderr, "Sorry\n");
                        return;
                }
index 45833f940b392986c07de036101552694dfade82..383ff506573d87f1c49560003a35284ec5446e53 100644 (file)
@@ -1,4 +1,4 @@
-1271
+1346
 0x1f000000     DYLD_initialize
 0x1f010000     DYLD_CALL_image_init_routine
 0x1f010004     DYLD_CALL_dependent_init_routine
 0x51000bc      PM_ClientCancl
 0x51000c0      PM_ClientNotfy
 0x51000c4      PM_AppNotify
-0x5310004      CPUPM_PState
-0x5310008      CPUPM_Idle_CState
-0x531000c      CPUPM_Idle_Halt
-0x5310010      CPUPM_Idle_Loop
-0x5310014      CPUPM_HPET_Start
-0x5310018      CPUPM_HPET_End
+0x5310004      CPUPM_PSTATE
+0x5310008      CPUPM_IDLE_CSTATE
+0x531000c      CPUPM_IDLE_HALT
+0x5310010      CPUPM_IDLE_LOOP
+0x5310014      CPUPM_HPET_START
+0x5310018      CPUPM_HPET_END
+0x531001c      CPUPM_HPET_INTR
+0x5310020      CPUPM_PSTATE_HW
+0x5310024      CPUPM_PSTATE_LIMIT
+0x5310028      CPUPM_PSTATE_PARK
+0x531002c      CPUPM_PSTATE_START
+0x5310030      CPUPM_PSTATE_PAUSE
+0x5310034      CPUPM_PSTATE_RESUME
+0x5310038      CPUPM_PSTATE_DOWN
+0x531003c      CPUPM_PSTATE_UP
+0x5310040      CPUPM_PSTATE_NORM
+0x5310044      CPUPM_PSTATE_FORCE
+0x5310048      CPUPM_PSTATE_TIMEOUT
+0x531004c      CPUPM_PSTATE_SETTO
+0x5310050      CPUPM_SET_DEADLINE
+0x5310054      CPUPM_GET_DEADLINE
+0x5310058      CPUPM_DEADLINE
+0x531005c      CPUPM_IDLE_SNOOP
+0x5310060      CPUPM_IDLE_LATENCY
+0x5310064      CPUPM_IDLE_WAKEUP
+0x5310068      CPUPM_IDLE_SW_WAKEUP
+0x531006c      CPUPM_IDLE_SELECT
+0x5310070      CPUPM_IDLE_SELECTED
+0x5310074      CPUPM_IDLE_INTSKIP
+0x5310078      CPUPM_IDLE_LOCK
+0x531007c      CPUPM_IDLE_UNLOCK
+0x5310080      CPUPM_IDLE_NO_HPET
+0x5310084      CPUPM_FI_UP
+0x5310088      CPUPM_FI_UP_CPU
+0x531008c      CPUPM_FI_MP
+0x5310090      CPUPM_FI_MP_CPU
+0x5310094      CPUPM_FI_PAUSE
+0x5310098      CPUPM_FI_RUN
+0x531009c      CPUPM_PROC_HALT
+0x53100a0      CPUPM_TRACE_STOPPED
+0x53100a4      CPUPM_HPET_INT_LOCK
+0x53100a8      CPUPM_HPET_INT_UNLOCK
+0x53100ac      CPUPM_HPET_TRY_AGAIN
+0x53100b0      CPUPM_HPET_SETDEADLINE
+0x53100b4      CPUPM_LOCK_HELDBY
+0x53100b8      CPUPM_HPET_DELTA
+0x53100bc      CPUPM_HPET_TOO_LATE
+0x53100c0      CPUPM_HPET_NO_DEADLINE
+0x53100c4      CPUPM_IDLE
+0x53100c8      CPUPM_CORE_CHK_DEADLINE
+0x53100cc      CPUPM_SET_HPET_DEADLINE
+0x53100d0      CPUPM_HPET_READ
+0x53100d4      CPUPM_TIME_ADJUST
+0x53100d8      CPUPM_IDLE_MWAIT
+0x53100dc      CPUPM_FI_SLAVE_IDLE
+0x53100e0      CPUPM_FI_SLAVE_BLOCK
+0x53100e4      CPUPM_FI_MAST_SIGNAL
+0x53100e8      CPUPM_CORE_DEADLINE
+0x53100ec      CPUPM_IDLE_FAST
+0x53100f0      CPUPM_IDLE_PAUSE
+0x53100f4      CPUPM_IDLE_SHORT
+0x53100f8      CPUPM_IDLE_NORMAL
+0x53100fc      CPUPM_IDLE_SPURIOUS
+0x5310100      CPUPM_PSTATE_INFO
+0x5310104      CPUPM_PSTATE_INFO_HW
+0x5310108      CPUPM_PSTATE_FSM
+0x531010c      CPUPM_PSTATE_FSM_STEP
+0x5310110      CPUPM_PSTATE_FSM_EVAL
+0x5310114      CPUPM_PSTATE_FSM_MAP
+0x5310118      CPUPM_CPUSTEP_RUN
+0x531011c      CPUPM_CPUSTEP_RUN_UP
+0x5310120      CPUPM_CPUSTEP_RUN_DOWN
+0x5310124      CPUPM_CPUSTEP_AVAIL
+0x5310128      CPUPM_CPUSTEP_AVAIL_STEP
+0x531012c      CPUPM_CPUSTEP_AVAIL_CHNG
+0x5310130      CPUPM_CPUSTEP_LOAD
+0x5310134      CPUPM_CPUSTEP_START
+0x5310138      CPUPM_CPUSTEP_STOP
+0x531013c      CPUPM_CPUSTEP_COPY
+0x5310140      CPUPM_CPUSTEP_STEP
+0x5310144      CPUPM_CPUSTEP_RUNCOUNT
 0x7000004      TRACE_DATA_NEWTHREAD
 0x7010004      TRACE_STRING_NEWTHREAD
 0x7010008      TRACE_STRING_EXEC