X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=passman;h=daf0730ade1ab5a33fbf38e25d6980cacb4b8326;hb=3fe3a001c971765fdbcdde37c81f68ddb119d83e;hp=0196f54de23c3e19cec08f2c79f2f0a24d649bcb;hpb=8cd1af87e1d5965df70b2e73aa37b9ce42fe80b6;p=passman.git diff --git a/passman b/passman index 0196f54..daf0730 100755 --- a/passman +++ b/passman @@ -1,11 +1,10 @@ #!/bin/sh -e # passman -- simple password manager -# Copyright (C) 2013-2016 Sergey Matveev (stargrave@stargrave.org) +# Copyright (C) 2013-2020 Sergey Matveev (stargrave@stargrave.org) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. +# the Free Software Foundation; version 3 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -19,7 +18,7 @@ DB=~/.passmandb generator() { - dd if=/dev/urandom bs=16 count=1 2>/dev/null | base64 | tr '+/' '-_' | tr -d = + gpg --armor --gen-random 1 16 | tr '+/' '-_' | tr -d = } cliper() @@ -38,6 +37,7 @@ add) [ -n "$passwd" ] || passwd=$(generator) echo Adding password for $dst mkdir -p $DB/$dst + umask 077 echo "$passwd" > $DB/$dst/passwd ;; *) @@ -50,6 +50,7 @@ add) echo "$result" exit fi + [ -n "$result" ] || exit 1 echo $result if [ -e "$result"/data ]; then echo -n "Associated data: "