(char*)this->mainExecutablePath().c_str(), 0);
// scan through the resources on disk, checking each against the resourceDirectory
- if (mValidationFlags & kSecCSFullReport)
- mResourcesValidContext = new CollectingContext(*this); // collect all failures in here
- else
- mResourcesValidContext = new ValidationContext(*this); // simple bug-out on first error
+ mResourcesValidContext = new CollectingContext(*this); // collect all failures in here
// use V2 resource seal if available, otherwise fall back to V1
CFDictionaryRef rules;
if (cfString(seal.link()) != target)
ctx.reportProblem(errSecCSBadResource, kSecCFErrorResourceAltered, fullpath);
} else if (seal.hash()) { // genuine file
+ if (isSymlink)
+ return ctx.reportProblem(errSecCSBadResource, kSecCFErrorResourceAltered, fullpath); // changed type
AutoFileDesc fd(cfString(fullpath), O_RDONLY, FileDesc::modeMissingOk); // open optional file
if (fd) {
MakeHash<CodeDirectory> hasher(this->codeDirectory());
setValidationFlags(flags);
// initialize progress/cancellation state
+ if (flags & kSecCSReportProgress)
prepareProgress(estimateResourceWorkload() + 2); // +1 head, +1 tail
// core components: once per architecture (if any)
// perform strict validation if desired
if (flags & kSecCSStrictValidate)
- mRep->strictValidate(mTolerateErrors);
+ mRep->strictValidate(codeDirectory(), mTolerateErrors);
reportProgress();
// allow monitor intervention