X-Git-Url: https://git.saurik.com/apple/securityd.git/blobdiff_plain/0dc9b4da4941126a8cbfedac0eaad1887b4424be..4cd1cad0dea00daa03e1b54fdf2797a02373ad5b:/src/AuthorizationEngine.cpp?ds=inline diff --git a/src/AuthorizationEngine.cpp b/src/AuthorizationEngine.cpp index 14a154c..b989fc3 100644 --- a/src/AuthorizationEngine.cpp +++ b/src/AuthorizationEngine.cpp @@ -164,16 +164,15 @@ Engine::authorize(const AuthItemSet &inRights, const AuthItemSet &environment, string processName = "unknown"; string authCreatorName = "unknown"; - if (SecCodeRef code = Server::process().currentGuest()) { - CFRef path; - if (!SecCodeCopyPath(code, kSecCSDefaultFlags, &path.aref())) - processName = cfString(path); - } - if (SecStaticCodeRef code = auth.creatorCode()) { - CFRef path; - if (!SecCodeCopyPath(code, kSecCSDefaultFlags, &path.aref())) - authCreatorName = cfString(path); + { + StLock _(Server::process()); + if (SecCodeRef code = Server::process().currentGuest()) { + CFRef path; + if (!SecCodeCopyPath(code, kSecCSDefaultFlags, &path.aref())) + processName = cfString(path); + } } + authCreatorName = auth.creatorPath(); if (sandbox_check(Server::process().pid(), "authorization-right-obtain", SANDBOX_FILTER_RIGHT_NAME, (*it)->name())) { Syslog::error("Sandbox denied authorizing right '%s' by client '%s' [%d]", (*it)->name(), processName.c_str(), Server::process().pid());