Skip to content

Commit

Permalink
Fix conf.get_config() to ignore file type bits when comparing oscrc p…
Browse files Browse the repository at this point in the history
…erms
  • Loading branch information
dmach committed Apr 26, 2024
1 parent 253f6f6 commit 2bf7e71
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion osc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1869,7 +1869,8 @@ def get_config(override_conffile=None,

# make sure oscrc is not world readable, it may contain a password
conffile_stat = os.stat(conffile)
if conffile_stat.st_mode != 0o600:
# applying 0o7777 mask because we want to ignore the file type bits
if conffile_stat.st_mode & 0o7777 != 0o600:
try:
os.chmod(conffile, 0o600)
except OSError as e:
Expand Down

0 comments on commit 2bf7e71

Please sign in to comment.