mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-01-20 21:08:42 +01:00
Ensure tempfiles are chmod 600
This commit is contained in:
parent
6dfbc467c0
commit
191df92824
@ -41,7 +41,7 @@ def rewrite_etc_hosts(port):
|
||||
os.chmod(tmpname, st.st_mode)
|
||||
else:
|
||||
os.chown(tmpname, 0, 0)
|
||||
os.chmod(tmpname, 0o644)
|
||||
os.chmod(tmpname, 0o600)
|
||||
os.rename(tmpname, HOSTSFILE)
|
||||
|
||||
|
||||
|
@ -37,6 +37,7 @@ def write_host_cache():
|
||||
for name, ip in sorted(hostnames.items()):
|
||||
f.write('%s,%s\n' % (name, ip))
|
||||
f.close()
|
||||
os.chmod(tmpname, 0o600)
|
||||
os.rename(tmpname, CACHEFILE)
|
||||
finally:
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user