summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJohn L. Villalovos <john.l.villalovos@intel.com>2016-10-06 15:26:23 -0700
committerJeff Forcier <jeff@bitprophet.org>2016-12-05 20:43:18 -0800
commitfc640ec3a6f40a3c0df2596b32ddab39a573f176 (patch)
treee9b8754202b560fb9a4b013626080801db9cc717
parent1a03c7df54611500b2e91fa7eee7a8b74b62c737 (diff)
open() function does not support setting file permissions
The open() function does not support setting file permissions[1]. The code was setting the buffer to 0o600. Remove the attempted file permission value. [1] https://docs.python.org/2/library/functions.html#open Change-Id: I582e226f8bc76e877c7da686f36e2efa33f0d24f
-rw-r--r--paramiko/pkey.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/paramiko/pkey.py b/paramiko/pkey.py
index e95d60ba..7f32c8a5 100644
--- a/paramiko/pkey.py
+++ b/paramiko/pkey.py
@@ -318,8 +318,7 @@ class PKey (object):
:raises IOError: if there was an error writing the file.
"""
- with open(filename, 'w', o600) as f:
- # grrr... the mode doesn't always take hold
+ with open(filename, 'w') as f:
os.chmod(filename, o600)
self._write_private_key(tag, f, data, password)