Skip to content

Commit

Permalink
fix db update file permission issue
Browse files Browse the repository at this point in the history
  • Loading branch information
oschwengers committed Feb 7, 2022
1 parent dbc79ac commit de42d3f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bakta/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,10 @@ def main():
try:
db_old_path.chmod(stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR) # set write permissions on old directory
for db_old_file_path in db_old_path.iterdir():
db_old_file_path.chmod(stat.S_IRUSR | stat.S_IWUSR)
if(db_old_file_path.is_dir()):
db_old_file_path.chmod(stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
else:
db_old_file_path.chmod(stat.S_IRUSR | stat.S_IWUSR)
except:
sys.exit(f'ERROR: cannot set read|write|execute permissions on old database! path={db_old_path}, owner={db_old_path.owner()}, group={db_old_path.group()}, permissions={oct(db_old_path.stat().st_mode )[-3:]}')
try:
Expand Down

0 comments on commit de42d3f

Please sign in to comment.