patch from upstream to fix special case in password checking code
[debian/sudo] / parse.c
diff --git a/parse.c b/parse.c
index 245219e469b738369c867c551845c2628b52c061..97aba79ccaa4e1f3815a9fe14e2d8239e73c6e30 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -429,7 +429,7 @@ sudo_file_display_privs(nss, pw, lbuf)
     int nfound = 0;
 
     if (nss->handle == NULL)
-       return(-1);
+       goto done;
 
     tq_foreach_fwd(&userspecs, us) {
        if (userlist_matches(pw, &us->users) != ALLOW)
@@ -440,6 +440,7 @@ sudo_file_display_privs(nss, pw, lbuf)
        else
            nfound += sudo_file_display_priv_short(pw, us, lbuf);
     }
+done:
     return(nfound);
 }
 
@@ -457,7 +458,7 @@ sudo_file_display_defaults(nss, pw, lbuf)
     int nfound = 0;
 
     if (nss->handle == NULL)
-       return(-1);
+       goto done;
 
     if (lbuf->len == 0 || isspace((unsigned char)lbuf->buf[lbuf->len - 1]))
        prefix = "    ";
@@ -493,7 +494,7 @@ sudo_file_display_defaults(nss, pw, lbuf)
        prefix = ", ";
        nfound++;
     }
-
+done:
     return(nfound);
 }
 
@@ -594,7 +595,7 @@ sudo_file_display_cmnd(nss, pw)
     int host_match, runas_match, cmnd_match;
 
     if (nss->handle == NULL)
-       return(rval);
+       goto done;
 
     match = NULL;
     tq_foreach_rev(&userspecs, us) {
@@ -625,6 +626,7 @@ sudo_file_display_cmnd(nss, pw)
            user_args ? user_args : "");
        rval = 0;
     }
+done:
     return(rval);
 }