Skip to content

Commit

Permalink
the --password-file legacy option is now a list, try all options unti…
Browse files Browse the repository at this point in the history
…l we find one that is valid

git-svn-id: https://xpra.org/svn/Xpra/trunk@21959 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Mar 4, 2019
1 parent b9f077f commit c00736b
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/xpra/server/auth/file_auth_base.py
Expand Up @@ -24,10 +24,18 @@ def init(opts):

class FileAuthenticatorBase(SysAuthenticator):
def __init__(self, username, **kwargs):
filename = kwargs.pop("filename", password_file)
if filename and not os.path.isabs(filename):
exec_cwd = kwargs.get("exec_cwd", os.getcwd())
filename = os.path.join(exec_cwd, filename)
password_files = [kwargs.pop("filename", None)]+list(password_file)
log("FileAuthenticatorBase password_files=%s", password_files)
filename = None
for filename in password_files:
if not filename:
continue
if not os.path.isabs(filename):
exec_cwd = kwargs.get("exec_cwd", os.getcwd())
filename = os.path.join(exec_cwd, filename)
if os.path.exists(filename):
break
log("FileAuthenticatorBase filename=%s", filename)
SysAuthenticator.__init__(self, username, **kwargs)
self.password_filename = filename
self.password_filedata = None
Expand Down

0 comments on commit c00736b

Please sign in to comment.