safe

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

commit 57acebdf13eb09a21d2fa90faefe844417d94122
parent e46e21993c9e3e93d5fc2ac7c977a5200afa332c
Author: Willy Goiffon <dev@z3bra.org>
Date:   Thu,  6 Jun 2019 18:33:56 +0200

Only load socket path from environment

Diffstat:
safe.c | 7+++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/safe.c b/safe.c @@ -357,6 +357,8 @@ main(int argc, char *argv[]) char *secret = NULL, *sockp = NULL, *safe = SAFE; struct safe s; + sockp = getenv("SAFE_SOCK"); + ARGBEGIN { case 'a': aflag = 1; @@ -364,9 +366,6 @@ main(int argc, char *argv[]) case 'd': dflag = 1; break; - case 'f': - sockp = EARGF(usage()); - break; case 's': safe = EARGF(usage()); break; @@ -391,7 +390,7 @@ main(int argc, char *argv[]) if (fd < 0 && errno != ENOENT) err(1, "%s", MASTER); - if (sockp || (sockp = getenv("SAFE_SOCK"))) { + if (sockp) { if (readkey(&s, sockp) < 0) err(1, "%s", sockp); } else {