safe

Password protected secret keeper
git clone git://git.z3bra.org/safe.git
Log | Files | Refs | README | LICENSE

commit 5bca68cbe7e38dd4c00464515a9755196db4fc8b
parent fc05dcf4f8bcdcbb199a7a9d9a98e35852ad135e
Author: Willy Goiffon <dev@z3bra.org>
Date:   Mon,  3 Jun 2019 12:27:55 +0200

Refuse to store a secret that already exists

Diffstat:
safe.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/safe.c b/safe.c @@ -304,7 +304,7 @@ store_secret(struct safe *s, int fd, char *name) genkey(s); mkdir_p(dirname(name), 0700); - sfd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0600); + sfd = open(name, O_WRONLY | O_CREAT | O_EXCL, 0600); if (sfd < 0) err(1, "%s", name);