Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-cloud / recipes-devtools / python / files / python-keyring / no_keyring_password.patch
1 diff --git a/keyring/backends/file.py b/keyring/backends/file.py
2 index f899880..ef6db1d 100644
3 --- a/keyring/backends/file.py
4 +++ b/keyring/backends/file.py
5 @@ -116,7 +116,7 @@ class BaseKeyring(FileBacked, KeyringBackend):
6              # create the file without group/world permissions
7              with open(self.file_path, 'w'):
8                  pass
9 -            user_read_write = 0o600
10 +            user_read_write = 0o644
11              os.chmod(self.file_path, user_read_write)
12  
13      def delete_password(self, service, username):
14 @@ -172,12 +172,19 @@ class Encrypted(object):
15  
16      def _get_new_password(self):
17          while True:
18 -            password = getpass.getpass(
19 -                "Please set a password for your new keyring: ")
20 -            confirm = getpass.getpass('Please confirm the password: ')
21 -            if password != confirm:
22 -                sys.stderr.write("Error: Your passwords didn't match\n")
23 -                continue
24 +#****************************************************************
25 +# Forging the Keyring password to allow automation and still keep
26 +# the password encoded. TODO to be revisited when Barbican keyring
27 +# Will be used with the complete PKI solution
28 +#****************************************************************
29 +#            password = getpass.getpass(
30 +#                "Please set a password for your new keyring: ")
31 +#            confirm = getpass.getpass('Please confirm the password: ')
32 +#            if password != confirm:
33 +#                sys.stderr.write("Error: Your passwords didn't match\n")
34 +#                continue
35 +            password =  "Please set a password for your new keyring: "
36 +
37              if '' == password.strip():
38                  # forbid the blank password
39                  sys.stderr.write("Error: blank passwords aren't allowed.\n")
40 @@ -248,8 +255,15 @@ class EncryptedKeyring(Encrypted, BaseKeyring):
41          Unlock this keyring by getting the password for the keyring from the
42          user.
43          """
44 -        self.keyring_key = getpass.getpass(
45 -            'Please enter password for encrypted keyring: ')
46 +#****************************************************************
47 +# Forging the Keyring password to allow automation and still keep
48 +# the password encoded. TODO to be revisited when Barbican keyring
49 +# Will be used with the complete PKI solution
50 +#****************************************************************
51 +#        self.keyring_key = getpass.getpass(
52 +#            'Please enter password for encrypted keyring: ')
53 +        self.keyring_key = "Please set a password for your new keyring: "
54 +
55          try:
56              ref_pw = self.get_password('keyring-setting', 'password reference')
57              assert ref_pw == 'password reference value'
58 diff --git a/keyring/util/platform_.py b/keyring/util/platform_.py
59 index dcdffea..53b9eae 100644
60 --- a/keyring/util/platform_.py
61 +++ b/keyring/util/platform_.py
62 @@ -19,7 +19,7 @@ def _data_root_Linux():
63         Use freedesktop.org Base Dir Specfication to determine storage
64         location.
65         """
66 -       fallback = os.path.expanduser('~/.local/share')
67 +       fallback = os.path.expanduser('/opt/platform/.keyring/')
68         root = os.environ.get('XDG_DATA_HOME', None) or fallback
69         return os.path.join(root, 'python_keyring')
70