diff --git a/Build/Release/x64/repacls.exe b/Build/Release/x64/repacls.exe index fa7494b..7e34f6b 100644 Binary files a/Build/Release/x64/repacls.exe and b/Build/Release/x64/repacls.exe differ diff --git a/Build/Release/x86/repacls.exe b/Build/Release/x86/repacls.exe index 59d3010..1b8f8b5 100644 Binary files a/Build/Release/x86/repacls.exe and b/Build/Release/x86/repacls.exe differ diff --git a/Build/Repacls.zip b/Build/Repacls.zip index f972019..134bb74 100644 Binary files a/Build/Repacls.zip and b/Build/Repacls.zip differ diff --git a/ObjectFile.cpp b/ObjectFile.cpp index a002885..2e8cf6e 100644 --- a/ObjectFile.cpp +++ b/ObjectFile.cpp @@ -4,6 +4,7 @@ #include "InputOutput.h" #include "ObjectFile.h" #include "DriverKitPartial.h" +#include "OperationDepth.h" void ObjectFile::GetBaseObject(std::wstring_view sPath) { @@ -154,8 +155,20 @@ void ObjectFile::GetChildObjects(ObjectEntry& oEntry) oSubEntry.Name += oEntry.Name + ((oEntry.Depth == 0 && oEntry.Name.back() == '\\') ? L"" : L"\\") + std::wstring(oInfo->FileName, oInfo->FileNameLength / sizeof(WCHAR)); - // add item to queue - oProcessor.GetQueue().Push(oSubEntry); + // if a leaf object, just process immediately and don't worry about putting it on the queue + if (!IsDirectory(oSubEntry.Attributes) || IsReparsePoint(oSubEntry.Attributes)) + { + // for performance do security analysis immediately instead of addiing to queue + if (oEntry.Depth <= OperationDepth::MaxDepth()) + { + oProcessor.AnalyzeSecurity(oSubEntry); + oProcessor.CompleteEntry(oSubEntry); + } + } + else + { + oProcessor.GetQueue().Push(oSubEntry); + } // this loop is complete, exit if (oInfo->NextEntryOffset == 0) break; diff --git a/Processor.cpp b/Processor.cpp index b9ff2bb..c25085e 100644 --- a/Processor.cpp +++ b/Processor.cpp @@ -207,7 +207,7 @@ void Processor::AnalyzeSecurity(ObjectEntry & oEntry) if (bDescCleanupRequired) LocalFree(tDesc); } -void Processor::CompleteEntry(ObjectEntry& oEntry, bool bDecreaseCounter) +void Processor::CompleteEntry(ObjectEntry& oEntry) { // flush any pending data from the last operation InputOutput::WriteToScreen(); diff --git a/Processor.h b/Processor.h index a487d59..c4c7d91 100644 --- a/Processor.h +++ b/Processor.h @@ -36,8 +36,7 @@ class Processor void AnalyzeSecurity(ObjectEntry& oEntry); - void CompleteEntry(ObjectEntry& oEntry, bool bDecreaseCounter = true); - void ReportFailure(ObjectEntry& oEntry); + void CompleteEntry(ObjectEntry& oEntry); Processor(std::vector poOperationList, bool pbFetchDacl, bool pbFetchSacl, bool pbFetchOwner, bool pbFetchGroup); virtual ~Processor() = default; diff --git a/Resource.rc b/Resource.rc index 756e3dd..2491885 100644 Binary files a/Resource.rc and b/Resource.rc differ