Revision
1007
Author
mww@apple.com
Date
2012-02-07 18:31:23 -0800 (Tue, 07 Feb 2012)

Log Message

Trigger xpchelper on sandbox profile installation. Fix logic. Fix update_xpc_services_cache.

Modified Paths

Diff

Modified: branches/PR-10821792/darwinup/Depot.cpp (1006 => 1007)


--- branches/PR-10821792/darwinup/Depot.cpp	2012-02-08 02:31:16 UTC (rev 1006)
+++ branches/PR-10821792/darwinup/Depot.cpp	2012-02-08 02:31:23 UTC (rev 1007)
@@ -545,16 +545,17 @@
 					this->m_modified_extensions = true;
 				}
 
-				if (!this->m_modified_xpc_services &&
-					(strstr(file->path(), ".xpc/") != NULL)) {
-
-					bool modified = (has_suffix(file->path(), "Info.plist") ||
-									 has_suffix(file->path(), "framework.sb"));
-
-					if (modified) {
+				if (!this->m_modified_xpc_services) {
+					if ((strstr(file->path(), ".xpc/") != NULL) && has_suffix(file->path(), "Info.plist")) {
 						IF_DEBUG("[analyze]    xpc service detected\n");
 						this->m_modified_xpc_services = true;
 					}
+
+					if ((strncmp(file->path(), "/System/Library/Sandbox/Profiles", 33) == 0) ||
+						(has_suffix(file->path(), "framework.sb"))) {
+						IF_DEBUG("[analyze]    profile modification detected\n");
+						this->m_modified_xpc_services = true;
+					}
 				}
 			}
 

Modified: branches/PR-10821792/darwinup/Utils.cpp (1006 => 1007)


--- branches/PR-10821792/darwinup/Utils.cpp	2012-02-08 02:31:16 UTC (rev 1006)
+++ branches/PR-10821792/darwinup/Utils.cpp	2012-02-08 02:31:23 UTC (rev 1007)
@@ -371,6 +371,14 @@
 	res = find_base_system_path(&base, path);
 	if (res) return res;
 
+	// xpchelper expects the --root value to *not* end in a slash.
+	if (has_suffix(base, "/")) {
+		char *ptr = strrchr(base, '/');
+		if (ptr) {
+			*ptr = '\0';
+		}
+	}
+
 	if (verbosity) {
 		fprintf(stdout, "Updating xpc services cache for %s ...", base);
 		fflush(stdout);