Blame SOURCES/sudo-1.8.21-ldap-pass2-filter.patch

ce887b
diff --git a/plugins/sudoers/ldap.c b/plugins/sudoers/ldap.c
ce887b
index f21a99ee..83202e28 100644
ce887b
--- a/plugins/sudoers/ldap.c
ce887b
+++ b/plugins/sudoers/ldap.c
ce887b
@@ -1847,12 +1847,10 @@ sudo_ldap_build_pass2(void)
ce887b
 	    ldap_conf.timed ? timebuffer : "",
ce887b
 	    (ldap_conf.timed || ldap_conf.search_filter) ? ")" : "");
ce887b
     } else {
ce887b
-	len = asprintf(&filt, "%s%s(sudoUser=*)(sudoUser=%s*)%s%s",
ce887b
-	    (ldap_conf.timed || ldap_conf.search_filter) ? "(&" : "",
ce887b
+	len = asprintf(&filt, "(&%s(sudoUser=*)(sudoUser=%s*)%s)",
ce887b
 	    ldap_conf.search_filter ? ldap_conf.search_filter : "",
ce887b
 	    query_netgroups ? "+" : "%:",
ce887b
-	    ldap_conf.timed ? timebuffer : "",
ce887b
-	    (ldap_conf.timed || ldap_conf.search_filter) ? ")" : "");
ce887b
+	    ldap_conf.timed ? timebuffer : "");
ce887b
     }
ce887b
     if (len == -1)
ce887b
 	sudo_warnx(U_("%s: %s"), __func__, U_("unable to allocate memory"));