1. Kang Zhang
  2. Python Keyring Lib


Jason R. Coombs  committed 049cd18 Merge

Merge pull request #16 (only 'password file is world readable' half, as the gdata fix may have issues, possibly changing ._client from a property to a method.

  • Participants
  • Parent commits 2a0d3fb, 2858b10
  • Branches default

Comments (0)

Files changed (3)

File CHANGES.txt

View file
 * Tweaked SecretService code to pass unicode to DBus, as unicode is the
   preferred format.
 * Issue #71 - Fixed logic in CryptedFileKeyring.
+* Unencrypted keyring file will be saved with user read/write (and not group
+  or world read/write).


View file
 * Sebastian Ramacher
 * Robert Leftwich
 * Kyle Stark
+* Daniel Holth

File keyring/backend.py

View file
 import getpass
 import os
+import stat
 import sys
 import base64
 import copy
         old_location = os.path.join(os.path.expanduser('~'), self.filename)
         new_location = self.file_path
         keyring.util.loc_compat.relocate_file(old_location, new_location)
+        # user read/write only
+        try:
+            os.chmod(new_location, stat.S_IWRITE | stat.S_IREAD)
+        except OSError: # XXX fails during unit test against tmpfile
+            pass 
         # disable this function - it only needs to be run once
         self._relocate_file = lambda: None