mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-15 18:29:52 +00:00
Ensure the auth cache file is not world readable.
This commit is contained in:
parent
ef57873f80
commit
d4fa60e1cf
@ -198,7 +198,7 @@ class Client:
|
|||||||
try:
|
try:
|
||||||
cache_file = self._get_cache_filename(email)
|
cache_file = self._get_cache_filename(email)
|
||||||
os.makedirs(os.path.dirname(cache_file), exist_ok=True)
|
os.makedirs(os.path.dirname(cache_file), exist_ok=True)
|
||||||
with open(cache_file, 'w') as f:
|
with os.fdopen(os.open(cache_file, os.O_WRONLY | os.O_CREAT, 0o0600), 'w') as f:
|
||||||
log.info('updating login cache')
|
log.info('updating login cache')
|
||||||
f.write(self.token)
|
f.write(self.token)
|
||||||
except OSError:
|
except OSError:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user