From cfc07409faaec1b9f963991a37206a98b9b1f681 Mon Sep 17 00:00:00 2001
From: Quanah Gibson-Mount <quanah@openldap.org>
Date: Wed, 3 Sep 2008 02:07:57 +0000
Subject: [PATCH] ITS#5641

---
 CHANGES                         | 1 +
 servers/slapd/overlays/unique.c | 9 +++++++++
 2 files changed, 10 insertions(+)

diff --git a/CHANGES b/CHANGES
index 04db6fee6a..27379cb27c 100644
--- a/CHANGES
+++ b/CHANGES
@@ -15,6 +15,7 @@ OpenLDAP 2.4.12 Engineering
 	Fixed slapo-rwm callback cleanup (ITS#5601)
 	Fixed slapo-rwm attr mapping and merging (ITS#5624)
 	Fixed slapo-unique filter validation (ITS#5581)
+	Fixed slapo-unique suffix testing (ITS#5641)
 	Build Environment
 		Fixed ODBC library detection (ITS#5602)
 	Documentation
diff --git a/servers/slapd/overlays/unique.c b/servers/slapd/overlays/unique.c
index 0f6479b2a7..e28e6b3540 100644
--- a/servers/slapd/overlays/unique.c
+++ b/servers/slapd/overlays/unique.c
@@ -197,6 +197,15 @@ unique_new_domain_uri ( unique_domain_uri **urip,
 			goto exit;
 		}
 
+		if ( be->be_nsuffix == NULL ) {
+			snprintf( c->cr_msg, sizeof( c->cr_msg ),
+				  "suffix must be set" );
+			Debug ( LDAP_DEBUG_CONFIG, "unique config: %s\n",
+				c->cr_msg, NULL, NULL );
+			rc = ARG_BAD_CONF;
+			goto exit;
+		}
+
 		if ( !dnIsSuffix ( &uri->ndn, &be->be_nsuffix[0] ) ) {
 			snprintf( c->cr_msg, sizeof( c->cr_msg ),
 				  "dn <%s> is not a suffix of backend base dn <%s>",
-- 
GitLab