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

Bandit should gracefully handle file errors #13

Closed
ericwb opened this issue Apr 26, 2018 · 1 comment
Closed

Bandit should gracefully handle file errors #13

ericwb opened this issue Apr 26, 2018 · 1 comment

Comments

@ericwb
Copy link
Member

ericwb commented Apr 26, 2018

Bandit dumps tracebacks when it fails to access files. It would be preferrable if Bandit gracefully handled the exceptions and displayed a user appropriate error. Also, it should be checking for the existence of the output file prior to running the scan.

promd-1s-dhcp317:bandit browne$ bandit -r ../openstack/ -o /Library/
86 [0.. 50.. ]
Traceback (most recent call last):
File "/usr/local/bin/bandit", line 10, in
sys.exit(main())
File "/Library/Python/2.7/site-packages/bandit/bandit.py", line 88, in main
args.output_format)
File "/Library/Python/2.7/site-packages/bandit/core/manager.py", line 112, in output_results
output_format=output_format
File "/Library/Python/2.7/site-packages/bandit/core/result_store.py", line 393, in report
with open(output_filename, 'w') as fout:
IOError: [Errno 21] Is a directory: '/Library/'

promd-1s-dhcp317:bandit browne$ bandit -r ../openstack/ -o /Library/sfd
86 [0.. 50.. ]
Traceback (most recent call last):
File "/usr/local/bin/bandit", line 10, in
sys.exit(main())
File "/Library/Python/2.7/site-packages/bandit/bandit.py", line 88, in main
args.output_format)
File "/Library/Python/2.7/site-packages/bandit/core/manager.py", line 112, in output_results
output_format=output_format
File "/Library/Python/2.7/site-packages/bandit/core/result_store.py", line 393, in report
with open(output_filename, 'w') as fout:
IOError: [Errno 13] Permission denied: '/Library/sfd'

@ericwb
Copy link
Member Author

ericwb commented Apr 26, 2018

Bad import of bug from launchpad. Closing..

@ericwb ericwb closed this as completed Apr 26, 2018
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

No branches or pull requests

1 participant