URI: 
       tRename master password file name - safe - password protected secret keeper
  HTML git clone git://git.z3bra.org/safe.git
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 04ee8744605e2ae4c120340960413eef3ff7294e
   DIR parent 5254f08121341ae91042257b11bd299788f3ebd5
  HTML Author: Willy Goiffon <dev@z3bra.org>
       Date:   Mon,  3 Jun 2019 16:06:12 +0200
       
       Rename master password file name
       
       Diffstat:
         M safe.c                              |      14 +++++++-------
       
       1 file changed, 7 insertions(+), 7 deletions(-)
       ---
   DIR diff --git a/safe.c b/safe.c
       t@@ -20,8 +20,8 @@
        
        #define SOCKDIR "/tmp/safe-XXXXXX"
        #define SOCKET  "agent"
       -#define SAFE ".secrets"
       -#define LOCK ".lock"
       +#define MASTER  "safelock"
       +#define SAFE    ".secrets"
        
        struct safe {
                crypto_secretstream_xchacha20poly1305_state st;
       t@@ -319,7 +319,7 @@ check_master(struct safe *s)
                if (fd < 0)
                        err(1, "/dev/null");
        
       -        r = show_secret(s, fd, LOCK);
       +        r = show_secret(s, fd, MASTER);
                close(fd);
        
                return r;
       t@@ -395,9 +395,9 @@ main(int argc, char *argv[])
                                err(1, "chdir: %s", safe);
                }
        
       -        if (secret_exists(LOCK)) {
       -                if ((fd = open(LOCK, O_RDONLY)) < 0)
       -                        err(1, "%s", LOCK);
       +        if (secret_exists(MASTER)) {
       +                if ((fd = open(MASTER, O_RDONLY)) < 0)
       +                        err(1, "%s", MASTER);
        
                        xread(fd, s.salt, sizeof(s.salt), NULL);
                        close(fd);
       t@@ -408,7 +408,7 @@ main(int argc, char *argv[])
                readpass("password:", &passphrase, &pplen);
                deriv((char *)passphrase, &s);
        
       -        if (check_master(&s) < 0) {
       +        if (secret_exists(MASTER) && check_master(&s) < 0) {
                        fprintf(stderr, "master password incorrect\n");
                        return -1;
                }