From c7f1e6e83c2f1a6b2299e1929e489bbec9ea2300 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sat, 25 Oct 2003 02:26:19 +0000 Subject: [PATCH] More naming checks --- servers/slapd/schema_check.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/servers/slapd/schema_check.c b/servers/slapd/schema_check.c index 40ca1d54a1..239eb48a81 100644 --- a/servers/slapd/schema_check.c +++ b/servers/slapd/schema_check.c @@ -854,7 +854,31 @@ entry_naming_check( break; } - if( desc->ad_type->sat_equality == NULL ) { + if( desc->ad_type->sat_usage ) { + snprintf( textbuf, textlen, + "naming attribute '%s' is operational", + ava->la_attr.bv_val ); + rc = LDAP_NAMING_VIOLATION; + break; + } + + if( desc->ad_type->sat_collective ) { + snprintf( textbuf, textlen, + "naming attribute '%s' is collective", + ava->la_attr.bv_val ); + rc = LDAP_NAMING_VIOLATION; + break; + } + + if( desc->ad_type->sat_obsolete ) { + snprintf( textbuf, textlen, + "naming attribute '%s' is collective", + ava->la_attr.bv_val ); + rc = LDAP_NAMING_VIOLATION; + break; + } + + if( !desc->ad_type->sat_equality ) { snprintf( textbuf, textlen, "naming attribute '%s' has no equality matching rule", ava->la_attr.bv_val ); @@ -862,7 +886,7 @@ entry_naming_check( break; } - if( desc->ad_type->sat_equality->smr_match == NULL ) { + if( !desc->ad_type->sat_equality->smr_match ) { snprintf( textbuf, textlen, "naming attribute '%s' has unsupported equality matching rule", ava->la_attr.bv_val ); -- 2.39.5