]> Sergey Matveev's repositories - passman.git/blobdiff - passman
Forbid any later GNU GPL versions autousage
[passman.git] / passman
diff --git a/passman b/passman
index 0196f54de23c3e19cec08f2c79f2f0a24d649bcb..be7cda6b6458d4cc00fa075725bf2267e929f8d9 100755 (executable)
--- 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-2019 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: "