diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2020-11-13 16:48:32 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2020-11-13 16:48:32 +0100 |
commit | f4f4fe0d36cbccf61f67af0834ac47db75a4f1a6 (patch) | |
tree | 1be86dd5f3db1d6ecd656a6f310512d84c45a9b2 | |
parent | 8cbc494c2e1430ff2bd8d65360ed66bc5f6e462f (diff) | |
download | dotfiles-f4f4fe0d36cbccf61f67af0834ac47db75a4f1a6.tar.gz dotfiles-f4f4fe0d36cbccf61f67af0834ac47db75a4f1a6.tar.xz dotfiles-f4f4fe0d36cbccf61f67af0834ac47db75a4f1a6.zip |
krb5: Improve setting file perms for state file
-rwxr-xr-x | krb5/bin/k | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -53,7 +53,7 @@ def get_credentials(url, auth_id): create_state_file = False if os.path.exists(state_file): - os.chmod(state_file, stat.S_IREAD|stat.S_IWRITE); + os.chmod(state_file, stat.S_IREAD|stat.S_IWRITE) with open(state_file, 'r') as f: data = f.read() cred = Identity.unserialize(auth_id, data) @@ -80,8 +80,8 @@ def get_credentials(url, auth_id): if create_state_file: with open(state_file, 'w') as f: + os.fchmod(f.fileno(), stat.S_IREAD|stat.S_IWRITE) f.write(cred.serialize()) - os.chmod(state_file, stat.S_IREAD|stat.S_IWRITE); try: entry = c.get_logins(cred, url=url) |