From 8ee8a0d87af6b415dd5d209751f72d4c060c9f2c Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 3 Mar 2011 09:38:15 -0500 Subject: [PATCH] Fix exit value of "sudo -l command" in sudoers module. --- plugins/sudoers/sudo_nss.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/sudoers/sudo_nss.c b/plugins/sudoers/sudo_nss.c index ac901e3ac..2f77d8947 100644 --- a/plugins/sudoers/sudo_nss.c +++ b/plugins/sudoers/sudo_nss.c @@ -309,6 +309,7 @@ display_privs(struct sudo_nss_list *snl, struct passwd *pw) /* * Check user_cmnd against sudoers and print the matching entry if the * command is allowed. + * Returns TRUE if the command is allowed, else FALSE. */ int display_cmnd(struct sudo_nss_list *snl, struct passwd *pw) @@ -320,7 +321,7 @@ display_cmnd(struct sudo_nss_list *snl, struct passwd *pw) tq_foreach_fwd(snl, nss) { if (nss->display_cmnd(nss, pw) == 0) - return 0; + return TRUE; } - return 1; + return FALSE; } -- 2.40.0