1 Index: keyring-5.3/keyring/backends/file.py
2 ===================================================================
3 --- keyring-5.3.orig/keyring/backends/file.py
4 +++ keyring-5.3/keyring/backends/file.py
5 @@ -6,6 +6,7 @@ import base64
11 from ..py27compat import configparser
13 @@ -95,14 +96,29 @@ class BaseKeyring(FileBacked, KeyringBac
14 config = configparser.RawConfigParser()
15 config.read(self.file_path)
17 + # obtain lock for the keyring file
21 + if not os.path.isfile('/tmp/.keyringlock'):
22 + lock = open('/tmp/.keyringlock', 'w')
28 # update the keyring with the password
29 if not config.has_section(service):
30 config.add_section(service)
31 config.set(service, username, password_base64)
33 - # save the keyring back to the file
34 - with open(self.file_path, 'w') as config_file:
35 - config.write(config_file)
37 + # save the keyring back to the file
38 + with open(self.file_path, 'w') as config_file:
39 + config.write(config_file)
41 + os.remove('/tmp/.keyringlock')
44 def _ensure_file_path(self):