diff -up sudo-1.8.6p7/plugins/sudoers/ldap.c.authlogicfix sudo-1.8.6p7/plugins/sudoers/ldap.c --- sudo-1.8.6p7/plugins/sudoers/ldap.c.authlogicfix 2015-07-05 13:40:15.389145839 +0200 +++ sudo-1.8.6p7/plugins/sudoers/ldap.c 2015-07-05 13:40:15.413145478 +0200 @@ -2392,9 +2392,13 @@ sudo_ldap_lookup(struct sudo_nss *nss, i 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"); } + } + + for (i = 0; i < lres->nentries; i++) { + entry = lres->entries[i].entry; /* Only check the command when listing another user. */ if (user_uid == 0 || list_pw == NULL || user_uid == list_pw->pw_uid || diff -up sudo-1.8.6p7/plugins/sudoers/sssd.c.authlogicfix sudo-1.8.6p7/plugins/sudoers/sssd.c --- sudo-1.8.6p7/plugins/sudoers/sssd.c.authlogicfix 2015-07-05 13:40:15.412145494 +0200 +++ sudo-1.8.6p7/plugins/sudoers/sssd.c 2015-07-05 13:40:15.414145463 +0200 @@ -970,9 +970,13 @@ sudo_sss_lookup(struct sudo_nss *nss, in 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"); } + } + + for (i = 0; i < sss_result->num_rules; i++) { + rule = sss_result->rules + i; /* Only check the command when listing another user. */ if (user_uid == 0 || list_pw == NULL || user_uid == list_pw->pw_uid ||