[launchd-changes] [22842] trunk/launchd/src/launchd_core_logic.c
source_changes at macosforge.org
source_changes at macosforge.org
Wed Sep 6 16:16:55 PDT 2006
Revision: 22842
Author: zarzycki at apple.com
Date: 2006-09-06 16:16:53 -0700 (Wed, 06 Sep 2006)
Log Message:
-----------
Fix a simple bug and refine when we log a warning.
Modified Paths:
--------------
trunk/launchd/src/launchd_core_logic.c
Modified: trunk/launchd/src/launchd_core_logic.c
===================================================================
--- trunk/launchd/src/launchd_core_logic.c 2006-09-06 18:12:47 UTC (rev 22841)
+++ trunk/launchd/src/launchd_core_logic.c 2006-09-06 23:16:53 UTC (rev 22842)
@@ -847,7 +847,7 @@
case 'i':
case 'I':
if (strcasecmp(key, LAUNCH_JOBKEY_INITGROUPS) == 0) {
- if (getuid() == 0) {
+ if (getuid() != 0) {
job_log(j, LOG_WARNING, "Ignored this key: %s", key);
return;
}
@@ -908,9 +908,11 @@
case 'u':
case 'U':
if (strcasecmp(key, LAUNCH_JOBKEY_USERNAME) == 0) {
- if (getuid() != 0 || strcmp(value, "root") == 0) {
+ if (getuid() != 0) {
job_log(j, LOG_WARNING, "Ignored this key: %s", key);
return;
+ } else if (strcmp(value, "root") == 0) {
+ return;
}
where2put = &j->username;
}
@@ -918,9 +920,11 @@
case 'g':
case 'G':
if (strcasecmp(key, LAUNCH_JOBKEY_GROUPNAME) == 0) {
- if (getuid() != 0 || strcmp(value, "wheel") == 0) {
+ if (getuid() != 0) {
job_log(j, LOG_WARNING, "Ignored this key: %s", key);
return;
+ } else if (strcmp(value, "wheel") == 0) {
+ return;
}
where2put = &j->groupname;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060906/8db0a801/attachment.html
More information about the launchd-changes
mailing list