Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added alternate data streams finder #4

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

mabott
Copy link

@mabott mabott commented Sep 16, 2022

$ ./qwalk.py -s mbott-qumulo.selab.hammer.space -u admin -p 'Admin123!@' -d /ADS -c ADSFinder
2022-09-15 17:01:35: Using the following Qumulo IPS: 10.200.10.195
2022-09-15 17:01:36: Walking -         2 dir|         5 inod
2022-09-15 17:01:36: Update  -         2 dir|         4 inod|         0 actn|   1 dir/s|     2 fil/s|       0 q
2022-09-15 17:01:46: Donestep-         2 dir|         4 inod|         0 actn|   0 dir/s|     0 fil/s
$ cat ads-finder-log.txt
/ADS/streamtest.txt: STREAM:$DATA 21 NEW_STREAM:$DATA 25
/ADS/streamdir/streamtest.txt: STREAM:$DATA 21 NEW_STREAM:$DATA 25
$

@mabott
Copy link
Author

mabott commented Sep 16, 2022

feel free to reject this if you prefer a different branch, I just realized I sent it to main from my fork

Copy link
Collaborator

@Gandalf- Gandalf- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR @mabott ! This looks great; I just have a few cleanup/refactoring comments. Going straight into the main branch from your fork totally works.

# print(_args)

@staticmethod
def get_named_streams(file_obj: FileInfo, work_obj: Worker) -> Optional[str]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you want -> Sequence[Tuple[str, str]] here?


@staticmethod
def work_start(_work_obj: Worker) -> None:
FILE_NAME = ADSFinder.get_logfile_name(_work_obj.start_path)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: FILE_NAME should be lower case since it's not a global variable

Comment on lines +38 to +40
res = self.get_named_streams(file_obj, work_obj)
if res:
for r in res:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could collapse this to

for stream in self.get_named_streams(file_obj, work_obj):
    ...

since iterating an empty list will be a no-op

def every_batch( # pylint: disable=no-self-use
self, file_list: Sequence[FileInfo], work_obj: Worker
) -> None:
action_count = 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

acount_count isn't getting incremented anywhere; this and line 48 could be removed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants