Revision
23366
Author
zarzycki@apple.com
Date
2007-09-10 13:40:29 -0700 (Mon, 10 Sep 2007)

Log Message

<rdar://problem/5425348> GroupName key now ignored when UserName key is not set

Modified Paths

Diff

Modified: trunk/launchd/src/launchd_core_logic.c (23365 => 23366)


--- trunk/launchd/src/launchd_core_logic.c	2007-09-10 18:38:14 UTC (rev 23365)
+++ trunk/launchd/src/launchd_core_logic.c	2007-09-10 20:40:29 UTC (rev 23366)
@@ -2619,6 +2619,14 @@
 		return;
 	}
 
+	/*
+	 * I contend that having UID == 0 and GID != 0 is of dubious value.
+	 * Nevertheless, this used to work in Tiger. See: 5425348
+	 */
+	if (j->groupname && !j->username) {
+		j->username = "root";
+	}
+
 	if (j->username) {
 		if ((pwe = getpwnam(j->username)) == NULL) {
 			job_log(j, LOG_ERR, "getpwnam(\"%s\") failed", j->username);