Jump to content

springles

Member
  • Posts

    1
  • Joined

  • Last visited

Everything posted by springles

  1. Doesn't work for me, keeps saying my master password is incorrect :(. Might have something to do with my master password -- it contains spaces. Looking at the login python code, it seems to call bw --raw unlock {password}, and so I added quotes to my password like "password with spaces" but it still does not work. Calling the command directly in the cli does work, so I'm not sure how it's being processed by the script. EDIT: Tracing the code, it seems like calling split is causing the issue, will try to change the delimiter and test EDIT2: Fixed by changing the delimiter to something else, make sure you call rstrip() on cmd to remove the newline too. def login(login_mail, mfa_enabled=None, mfa_method=None): ........ if not mfa_enabled: # NOTE: DELIMITER CHANGED TO [[[, replace all spaces in cmd with [[[ cmd = "/usr/local/bin/bw[[[--raw[[[login[[[{login_mail}[[[{password}".format(login_mail=login_mail, password=password) elif mfa_enabled and not mfa_method: mfa_code, err, status, message = build_osascript(login_mail, 'Enter Bitwarden second factor code', True) cmd = "/usr/local/bin/bw[[[--raw[[[login[[[{login_mail}[[[{password}[[[--code[[[{mfa_code}".format(login_mail=login_mail, password=password, mfa_code=mfa_code) else: mfa_code, err, status, message = build_osascript(login_mail, 'Enter Bitwarden second factor code', True) cmd = "/usr/local/bin/bw[[[--raw[[[login[[[{login_mail}[[[{password}[[[--method[[[{mfa_method}[[[--code[[[{mfa_code}".format(login_mail=login_mail, password=password, mfa_method=mfa_method, mfa_code=mfa_code) # NOTE: Since delimiter is not default, need to strip new line cmd = cmd.rstrip() proc = Popen(cmd.split("[[["), env=my_env, stdout=PIPE, stderr=PIPE) out, err = proc.communicate() ........
×
×
  • Create New...