#!/bin/sh -e
# passman -- simple password manager
-# Copyright (C) 2013-2016 Sergey Matveev (stargrave@stargrave.org)
+# Copyright (C) 2013-2018 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
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()
[ -n "$passwd" ] || passwd=$(generator)
echo Adding password for $dst
mkdir -p $DB/$dst
+ umask 077
echo "$passwd" > $DB/$dst/passwd
;;
*)