Skip to content

Commit da769cd

Browse files
committed
For ldap_search_ext_s() the sizelimit param should be 0, not -1, to
indicate no limit. From Mark Janssen.
1 parent 2d4aebe commit da769cd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ldap.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,7 @@ sudo_ldap_display_defaults(nss, pw, lbuf)
11281128
return(-1);
11291129

11301130
rc = ldap_search_ext_s(ld, ldap_conf.base, LDAP_SCOPE_SUBTREE,
1131-
"cn=defaults", NULL, 0, NULL, NULL, NULL, -1, &result);
1131+
"cn=defaults", NULL, 0, NULL, NULL, NULL, 0, &result);
11321132
if (rc == LDAP_SUCCESS && (entry = ldap_first_entry(ld, result))) {
11331133
bv = ldap_get_values_len(ld, entry, "sudoOption");
11341134
if (bv != NULL) {
@@ -1358,7 +1358,7 @@ sudo_ldap_display_privs(nss, pw, lbuf)
13581358
filt = do_netgr ? estrdup("sudoUser=+*") : sudo_ldap_build_pass1(pw);
13591359
DPRINTF(("ldap search '%s'", filt), 1);
13601360
rc = ldap_search_ext_s(ld, ldap_conf.base, LDAP_SCOPE_SUBTREE, filt,
1361-
NULL, 0, NULL, NULL, NULL, -1, &result);
1361+
NULL, 0, NULL, NULL, NULL, 0, &result);
13621362
efree(filt);
13631363
if (rc != LDAP_SUCCESS)
13641364
continue; /* no entries for this pass */
@@ -1412,7 +1412,7 @@ sudo_ldap_display_cmnd(nss, pw)
14121412
filt = do_netgr ? estrdup("sudoUser=+*") : sudo_ldap_build_pass1(pw);
14131413
DPRINTF(("ldap search '%s'", filt), 1);
14141414
rc = ldap_search_ext_s(ld, ldap_conf.base, LDAP_SCOPE_SUBTREE, filt,
1415-
NULL, 0, NULL, NULL, NULL, -1, &result);
1415+
NULL, 0, NULL, NULL, NULL, 0, &result);
14161416
efree(filt);
14171417
if (rc != LDAP_SUCCESS)
14181418
continue; /* no entries for this pass */
@@ -1707,7 +1707,7 @@ sudo_ldap_setdefs(nss)
17071707
return(-1);
17081708

17091709
rc = ldap_search_ext_s(ld, ldap_conf.base, LDAP_SCOPE_SUBTREE,
1710-
"cn=defaults", NULL, 0, NULL, NULL, NULL, -1, &result);
1710+
"cn=defaults", NULL, 0, NULL, NULL, NULL, 0, &result);
17111711
if (rc == 0 && (entry = ldap_first_entry(ld, result))) {
17121712
DPRINTF(("found:%s", ldap_get_dn(ld, entry)), 1);
17131713
sudo_ldap_parse_options(ld, entry);
@@ -1748,7 +1748,7 @@ sudo_ldap_lookup(nss, ret, pwflag)
17481748
for (matched = 0, do_netgr = 0; !matched && do_netgr < 2; do_netgr++) {
17491749
filt = do_netgr ? estrdup("sudoUser=+*") : sudo_ldap_build_pass1(pw);
17501750
rc = ldap_search_ext_s(ld, ldap_conf.base, LDAP_SCOPE_SUBTREE, filt,
1751-
NULL, 0, NULL, NULL, NULL, -1, &result);
1751+
NULL, 0, NULL, NULL, NULL, 0, &result);
17521752
efree(filt);
17531753
if (rc != LDAP_SUCCESS)
17541754
continue;
@@ -1819,7 +1819,7 @@ sudo_ldap_lookup(nss, ret, pwflag)
18191819
filt = do_netgr ? estrdup("sudoUser=+*") : sudo_ldap_build_pass1(pw);
18201820
DPRINTF(("ldap search '%s'", filt), 1);
18211821
rc = ldap_search_ext_s(ld, ldap_conf.base, LDAP_SCOPE_SUBTREE, filt,
1822-
NULL, 0, NULL, NULL, NULL, -1, &result);
1822+
NULL, 0, NULL, NULL, NULL, 0, &result);
18231823
if (rc != LDAP_SUCCESS)
18241824
DPRINTF(("nothing found for '%s'", filt), 1);
18251825
efree(filt);

0 commit comments

Comments
 (0)