Skip to content

Commit

Permalink
Restored Early File Leaf Processing
Browse files Browse the repository at this point in the history
  • Loading branch information
NoMoreFood committed Mar 7, 2022
1 parent 950f90b commit f63409f
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 5 deletions.
Binary file modified Build/Release/x64/repacls.exe
Binary file not shown.
Binary file modified Build/Release/x86/repacls.exe
Binary file not shown.
Binary file modified Build/Repacls.zip
Binary file not shown.
17 changes: 15 additions & 2 deletions ObjectFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "InputOutput.h"
#include "ObjectFile.h"
#include "DriverKitPartial.h"
#include "OperationDepth.h"

void ObjectFile::GetBaseObject(std::wstring_view sPath)
{
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 1 addition & 2 deletions Processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<Operation*> poOperationList, bool pbFetchDacl, bool pbFetchSacl, bool pbFetchOwner, bool pbFetchGroup);
virtual ~Processor() = default;
Expand Down
Binary file modified Resource.rc
Binary file not shown.

0 comments on commit f63409f

Please sign in to comment.