Skip to content

Commit

Permalink
minor cleanup after merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
peacetara committed Oct 13, 2017
1 parent 0a60d41 commit 0239cac
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/python/slab/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def getPWPath():

def pwentry():
"""create a secure file for the master password keys.
TODO: update this to work with keychain.
"""
pwpath = getPWPath()
try:
Expand Down Expand Up @@ -90,9 +91,7 @@ def main(args=None):
password = subprocess.check_output(['/usr/bin/security','find-generic-password','-a','slab','-w'],universal_newlines=True).rstrip()

if not password:
pwpath = os.getenv("SLAB_PWPATH","~/.config/.slab_password")
pwpath = os.path.expanduser(pwpath)

pwpath = getPWPath()
if os.path.exists(pwpath):
mode = os.stat(pwpath).st_mode

Expand All @@ -101,9 +100,9 @@ def main(args=None):
password = open(pwpath).read()
if '\n' in password:
password = password.rstrip()

try:
k.unlock(password, filter='sudolikeaboss')
del password
except:
print("The password supplied does not unlock 1Password. Aborting.")
sys.exit()
Expand Down

0 comments on commit 0239cac

Please sign in to comment.