From ad5e334d422fd8ac24573f90f5e0a9d975ac2657 Mon Sep 17 00:00:00 2001
From: Quanah Gibson-Mount <quanah@openldap.org>
Date: Mon, 10 Nov 2008 23:41:45 +0000
Subject: [PATCH] ITS#5802

---
 CHANGES                              | 1 +
 contrib/slapd-modules/nssov/passwd.c | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/CHANGES b/CHANGES
index 38d3eda18b..08d9593afb 100644
--- a/CHANGES
+++ b/CHANGES
@@ -61,6 +61,7 @@ OpenLDAP 2.4.13 Engineering
 	Fixed tools unaligned BerElement (ITS#5770)
 	Fixed contrib nssov crash on empty groups (ITS#5800)
 	Fixed contrib nssov crash with nssov-map (ITS#5801)
+	Fixed contrib nssov filter and search limits (ITS#5802)
 	Added contrib smbk5pwd honor principal expiration (ITS#5766)
 	Build Environment
 		Added ldapurl command
diff --git a/contrib/slapd-modules/nssov/passwd.c b/contrib/slapd-modules/nssov/passwd.c
index 41a53f8ff9..4897ac286b 100644
--- a/contrib/slapd-modules/nssov/passwd.c
+++ b/contrib/slapd-modules/nssov/passwd.c
@@ -172,7 +172,7 @@ int nssov_uid2dn(Operation *op,nssov_info *ni,struct berval *uid,struct berval *
 	if (!isvalidusername(uid))
 		return 0;
 	/* we have to look up the entry */
-	nssov_filter_byid(mi,UIDN_KEY,uid,&filter);
+	nssov_filter_byid(mi,UID_KEY,uid,&filter);
 	BER_BVZERO(dn);
 	cb.sc_private = dn;
 	cb.sc_response = uid2dn_cb;
@@ -184,6 +184,8 @@ int nssov_uid2dn(Operation *op,nssov_info *ni,struct berval *uid,struct berval *
 	op2.ors_filterstr = filter;
 	op2.ors_filter = str2filter_x( op, filter.bv_val );
 	op2.ors_attrs = slap_anlist_no_attrs;
+	op2.ors_tlimit = SLAP_NO_LIMIT;
+	op2.ors_slimit = SLAP_NO_LIMIT;
 	rc = op2.o_bd->be_search( &op2, &rs );
 	filter_free_x( op, op2.ors_filter, 1 );
 	return rc == LDAP_SUCCESS;
-- 
GitLab