aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNelson Minar <[email protected]>2016-02-18 16:18:02 +0000
committerRapptz <[email protected]>2016-03-02 23:26:04 -0500
commitd4fa60e1cf02256e2e27d5f0b839f47c8ef23f83 (patch)
tree2ab1251a3de2701dd6a1e6f9f0a143e167249f38
parentClean up zombies (diff)
downloaddiscord.py-d4fa60e1cf02256e2e27d5f0b839f47c8ef23f83.tar.xz
discord.py-d4fa60e1cf02256e2e27d5f0b839f47c8ef23f83.zip
Ensure the auth cache file is not world readable.
-rw-r--r--discord/client.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/discord/client.py b/discord/client.py
index e99e46f6..9ec9adf0 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -198,7 +198,7 @@ class Client:
try:
cache_file = self._get_cache_filename(email)
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')
f.write(self.token)
except OSError: