[launchd-changes] [22974] trunk/launchd/src/launchd_core_logic.c

source_changes at macosforge.org source_changes at macosforge.org
Thu Dec 7 11:43:17 PST 2006


Revision: 22974
          http://trac.macosforge.org/projects/launchd/changeset/22974
Author:   zarzycki at apple.com
Date:     2006-12-07 11:43:17 -0800 (Thu, 07 Dec 2006)

Log Message:
-----------
Better logging.

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-12-06 23:49:24 UTC (rev 22973)
+++ trunk/launchd/src/launchd_core_logic.c	2006-12-07 19:43:17 UTC (rev 22974)
@@ -1922,6 +1922,12 @@
 	desired_uid = pwe->pw_uid;
 	desired_gid = pwe->pw_gid;
 
+	if (j->username && strcmp(j->username, loginname) != 0) {
+		job_log(j, LOG_WARNING, "Suspicious setup: User \"%s\" maps to user: %s", j->username, loginname);
+	} else if (j->mach_uid && (j->mach_uid != desired_uid)) {
+		job_log(j, LOG_WARNING, "Suspicious setup: UID %u maps to UID %u", j->mach_uid, desired_uid);
+	}
+
 	if (j->groupname) {
 		struct group *gre;
 
@@ -3213,7 +3219,7 @@
 	if (ms->recv) {
 		if (ms->isActive) {
 			/* FIXME we should cancel the notification */
-			job_log(ms->job, LOG_ERR, "Mach service deleted while we didn't own the receive right: %s", ms->name);
+			job_log(ms->job, LOG_DEBUG, "Mach service deleted while we didn't own the receive right: %s", ms->name);
 		} else {
 			job_assumes(ms->job, launchd_mport_close_recv(ms->port) == KERN_SUCCESS);
 		}
@@ -3673,9 +3679,11 @@
 		}
 	} else
 #endif
-	if ((getuid() != 0) && server_uid) {
-		job_log(j, LOG_WARNING, "Server create: \"%s\": As UID %d, we will not be able to switch to UID %d",
-				server_cmd, getuid(), server_uid);
+	if (getuid()) {
+		if (server_uid != getuid()) {
+			job_log(j, LOG_WARNING, "Server create: \"%s\": As UID %d, we will not be able to switch to UID %d",
+					server_cmd, getuid(), server_uid);
+		}
 		server_uid = 0; /* zero means "do nothing" */
 	}
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20061207/ca7cbcd9/attachment.html


More information about the launchd-changes mailing list