From c54468c9aa201915bbf5f413d299d0ea5c257e70 Mon Sep 17 00:00:00 2001 From: Mark Schenk Date: Tue, 15 Oct 2024 17:13:33 +0200 Subject: [PATCH] store actual password when no pam negotiation has happened --- ibridges/session.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ibridges/session.py b/ibridges/session.py index b8c74712..5dc374da 100644 --- a/ibridges/session.py +++ b/ibridges/session.py @@ -273,9 +273,13 @@ def write_pam_password(self): connection = self.irods_session.pool.get_connection() pam_passwords = self.irods_session.pam_pw_negotiated if len(pam_passwords): + actual_password = pam_passwords[0] + else: + actual_password = self._password + if actual_password: irods_auth_file = self.irods_session.get_irods_password_file() with open(irods_auth_file, "w", encoding="utf-8") as authfd: - authfd.write(irods.password_obfuscation.encode(pam_passwords[0])) + authfd.write(irods.password_obfuscation.encode(actual_password)) else: warnings.warn("WARNING -- unable to cache obfuscated password locally") connection.release()