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