Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Deterministic file loading and vulnerability order #165

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

Merged
KevinHock merged 2 commits into python-security:master from bcaller:determinism
Aug 14, 2018

Conversation

Copy link
Collaborator

@bcaller bcaller commented Aug 14, 2018

os.walk is not deterministic (though often on the same computer it will
walk in the same order).

This means that the vulnerabilities can appear in different orders, making it hard to compare output.

Process files in alphabetical order.

I do need to look more deeply into how the import system works because I think there are some other non-determinism problems which can result in vulnerabilities not being found but I haven't figured it out yet.

KevinHock reacted with thumbs up emoji KevinHock reacted with hooray emoji KevinHock reacted with heart emoji
bcaller added 2 commits August 13, 2018 17:34
os.walk is not deterministic (though often on the same computer it will
walk in the same order).
This means that the vulnerabilities appear in different orders on
different machines, making it hard to compare output.
Process files in alphabetical order.
The project_modules only need loading once if -pr is set, not once for
every file.
@KevinHock KevinHock self-requested a review August 14, 2018 18:09
Copy link
Collaborator

@KevinHock KevinHock left a comment

Choose a reason for hiding this comment

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

Looks great to me!

directory = os.path.normpath(args.project_root)
project_modules = get_modules(directory, prepend_module_root=args.prepend_module_root)

for path in sorted(files):
Copy link
Collaborator

@KevinHock KevinHock Aug 14, 2018
edited
Loading

Choose a reason for hiding this comment

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

Such a great idea I don't think I would have ever thought of 😁

@KevinHock KevinHock merged commit c0e6ace into python-security:master Aug 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@KevinHock KevinHock KevinHock approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /