mCreatorUid = mCreatorAuditToken.euid();
mCreatorGid = mCreatorAuditToken.egid();
- if (sandbox_check(mCreatorPid, "authorization-right-obtain", SANDBOX_FILTER_NONE) != 0)
+ if (sandbox_check(mCreatorPid, "authorization-right-obtain", SANDBOX_CHECK_NO_REPORT) != 0)
mCreatorSandboxed = true;
else
mCreatorSandboxed = false;
- if (SecCodeRef code = Server::process().currentGuest())
- MacOSError::check(SecCodeCopyStaticCode(code, kSecCSDefaultFlags, &mCreatorCode.aref()));
+ {
+ Process &thisProcess = Server::process();
+ StLock<Mutex> _(thisProcess);
+ if (SecCodeRef code = thisProcess.currentGuest())
+ MacOSError::check(SecCodeCopyStaticCode(code, kSecCSDefaultFlags, &mCreatorCode.aref()));
+ }
// link to session
referent(ssn);
}
+std::string AuthorizationToken::creatorPath() const
+{
+ if (mCreatorCode) {
+ StLock<Mutex> _(mLock);
+ CFRef<CFURLRef> path;
+ if (SecCodeCopyPath(mCreatorCode, kSecCSDefaultFlags, &path.aref()) == noErr)
+ return cfString(path);
+ }
+ return "unknown";
+}
+
+
//
// Locate an authorization given its blob.
//
AuthItemRef uidHint("uid", AuthValueOverlay(sizeof(uid), &uid));
dstInfoSet.insert(uidHint);
- AuthItemRef userHint("username", AuthValueOverlay(inCred->username()), 0);
+ AuthItemRef userHint("username", AuthValueOverlay(inCred->name()), 0);
dstInfoSet.insert(userHint);
setInfoSet(dstInfoSet, savePassword);