Skip to content

Commit

Permalink
py[2|3] Make octal constants compatible
Browse files Browse the repository at this point in the history
Signed-off-by: Tony Asleson <tasleson@redhat.com>
  • Loading branch information
tasleson committed Feb 13, 2017
1 parent 45ba27a commit 068c437
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions targetd/main.py
Expand Up @@ -172,14 +172,14 @@ def _verify_ssl_file(f):
ss = os.stat(f)
if stat.S_ISREG(ss.st_mode):
if ss.st_uid == 0:
if ss.st_mode & 0077 == 0 and \
if ss.st_mode & 0o077 == 0 and \
bool(ss.st_mode & stat.S_IRUSR):
rc = True
else:
log.error("SSL file: '%s' incorrect permissions (%s), "
"ensure file is _not_ readable or writeable "
"by anyone other than owner, and that owner "
"can read." % (f, oct(ss.st_mode & 0777)))
"can read." % (f, oct(ss.st_mode & 0o777)))
else:
log.error("SSL file: '%s' not owned by root." % f)
else:
Expand Down

0 comments on commit 068c437

Please sign in to comment.