bandit/examples/os-chmod-py2.py
Ian Cordasco 22e48756a6 Clean up tests and examples for Python 3.4
This addresses some of the feedback in
I71c0bb61c9ee0bf1b751a719a4eb95bf7a0b4943

Change-Id: Ie916ebda1ddff6de528a495bf249d40e7b1e7fc5
2015-06-03 16:47:25 -05:00

19 lines
433 B
Python

import os
import stat
keyfile = 'foo'
os.chmod('/etc/passwd', 0777)
os.chmod('/etc/passwd', 0227)
os.chmod('/etc/passwd', 07)
os.chmod('/etc/passwd', 0664)
os.chmod('/etc/passwd', 0777)
os.chmod('/etc/passwd', 0o770)
os.chmod('/etc/passwd', 0o776)
os.chmod('/etc/passwd', 0o760)
os.chmod('~/.bashrc', 511)
os.chmod('/etc/hosts', 0o777)
os.chmod('/tmp/oh_hai', 0x1ff)
os.chmod('/etc/passwd', stat.S_IRWXU)
os.chmod(key_file, 0o777)