X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/e3d460c9de4426da6c630c3ae3f46173a99f82d8..dd5fb164cf5b32c462296bc65e289e100f74b59a:/OSX/libsecurity_codesigning/lib/signerutils.cpp?ds=inline diff --git a/OSX/libsecurity_codesigning/lib/signerutils.cpp b/OSX/libsecurity_codesigning/lib/signerutils.cpp index 25a327ba..855d1949 100644 --- a/OSX/libsecurity_codesigning/lib/signerutils.cpp +++ b/OSX/libsecurity_codesigning/lib/signerutils.cpp @@ -33,6 +33,7 @@ #include "csutilities.h" #include "drmaker.h" #include +#include #include #include @@ -244,7 +245,7 @@ void MachOEditor::childAction() if (mHelperOverridden) ::csops(0, CS_OPS_MARKKILL, NULL, 0); // force code integrity - ::seteuid(0); // activate privilege if caller has it; ignore error if not + (void)::seteuid(0); // activate privilege if caller has it; ignore error if not execv(mHelperPath, (char * const *)&arguments[0]); } @@ -275,7 +276,7 @@ void MachOEditor::write(Arch &arch, EmbeddedSignatureBlob *blob) arch.source->writeAll(*blob); ::free(blob); // done with it } else { - secdebug("signer", "%p cannot find CODESIGNING section", this); + secinfo("signer", "%p cannot find CODESIGNING data in Mach-O", this); MacOSError::throwMe(errSecCSInternalError); } } @@ -301,7 +302,7 @@ void MachOEditor::commit() // perform copy under root or file-owner privileges if available UidGuard guard; if (!guard.seteuid(0)) - guard.seteuid(st.st_uid); + (void)guard.seteuid(st.st_uid); // copy metadata from original file... copy(sourcePath.c_str(), NULL, COPYFILE_SECURITY | COPYFILE_METADATA); @@ -315,6 +316,7 @@ void MachOEditor::commit() UnixError::check(::rename(tempPath.c_str(), sourcePath.c_str())); mTempMayExist = false; // we renamed it away } + this->writer->flush(); }