From c9d4e1084cd0eb3a5334c8d87176472150e4107e Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 2 Mar 2015 11:37:43 -0700 Subject: [PATCH] Fix logic for verifypw/listpw all in sudoers LDAP and sssd. --- plugins/sudoers/ldap.c | 4 ++-- plugins/sudoers/sssd.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/sudoers/ldap.c b/plugins/sudoers/ldap.c index ee912c869..921449bf9 100644 --- a/plugins/sudoers/ldap.c +++ b/plugins/sudoers/ldap.c @@ -3008,8 +3008,8 @@ sudo_ldap_lookup(struct sudo_nss *nss, int ret, int pwflag) for (i = 0; i < lres->nentries; i++) { entry = lres->entries[i].entry; if ((pwcheck == any && doauth != false) || - (pwcheck == all && doauth == false)) { - doauth = sudo_ldap_check_bool(ld, entry, "authenticate"); + (pwcheck == all && doauth != true)) { + doauth = !!sudo_ldap_check_bool(ld, entry, "authenticate"); } /* Only check the command when listing another user. */ if (user_uid == 0 || list_pw == NULL || diff --git a/plugins/sudoers/sssd.c b/plugins/sudoers/sssd.c index 6f57504b1..a0ea804b2 100644 --- a/plugins/sudoers/sssd.c +++ b/plugins/sudoers/sssd.c @@ -1002,8 +1002,8 @@ sudo_sss_lookup(struct sudo_nss *nss, int ret, int pwflag) for (i = 0; i < sss_result->num_rules; i++) { rule = sss_result->rules + i; if ((pwcheck == any && doauth != false) || - (pwcheck == all && doauth == false)) { - doauth = sudo_sss_check_bool(handle, rule, "authenticate"); + (pwcheck == all && doauth != true)) { + doauth = !!sudo_sss_check_bool(handle, rule, "authenticate"); } /* Only check the command when listing another user. */ if (user_uid == 0 || list_pw == NULL || -- 2.40.0