update permissions on write
This commit is contained in:
parent
0d77aaff26
commit
d612792593
@ -4,6 +4,7 @@ from datetime import datetime, timezone
|
|||||||
import json
|
import json
|
||||||
import hashlib
|
import hashlib
|
||||||
import os
|
import os
|
||||||
|
import stat
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
@ -189,6 +190,8 @@ class UserList(object):
|
|||||||
jsonContent = json.dumps(users, indent=4)
|
jsonContent = json.dumps(users, indent=4)
|
||||||
with open(usersFile, "w") as f:
|
with open(usersFile, "w") as f:
|
||||||
f.write(jsonContent)
|
f.write(jsonContent)
|
||||||
|
# file should be readable by us only
|
||||||
|
os.chmod(usersFile, stat.S_IWUSR + stat.S_IRUSR)
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.exception("error while writing users file %s", usersFile)
|
logger.exception("error while writing users file %s", usersFile)
|
||||||
self.refresh()
|
self.refresh()
|
||||||
|
Loading…
Reference in New Issue
Block a user