]> git.armaanb.net Git - opendoas.git/blobdiff - doas.c
timestamp: error out if fstat and lstat st_ino and st_dev are not the same
[opendoas.git] / doas.c
diff --git a/doas.c b/doas.c
index 0782f878598e3c67ec881499e77dd226dc173d8d..6223aff219168fa87f9a38909f9f072535114c21 100644 (file)
--- a/doas.c
+++ b/doas.c
@@ -234,6 +234,7 @@ authuser(char *myname, char *login_style, int persist)
                errx(1, "a tty is required");
        }
        if (!auth_userresponse(as, response, 0)) {
+               explicit_bzero(rbuf, sizeof(rbuf));
                syslog(LOG_AUTHPRIV | LOG_NOTICE,
                    "failed auth for %s", myname);
                errx(1, "Authorization failed");
@@ -414,10 +415,8 @@ main(int argc, char **argv)
        if (!pw)
                errx(1, "no passwd entry for target");
 
-       if (!pamauth(pw->pw_name, myname, !nflag, rule->options & NOPASS)) {
-               syslog(LOG_AUTHPRIV | LOG_NOTICE, "failed auth for %s", myname);
-               errx(1, "Authorization failed");
-       }
+       pamauth(pw->pw_name, myname, !nflag, rule->options & NOPASS,
+           rule->options & PERSIST);
 
 #else
        (void) nflag;