X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fschema_check.c;h=0412bb4f2028bd2ebefec86835c42cca688d9a97;hb=b4e1ea15f3081a065318f5ee99336494c8765bca;hp=a6b6b98acc2ebd2947f1abac5d167b9e7dc49ec3;hpb=11236eae56b3e0464c1fe897a09bc8b4d70c7404;p=openldap diff --git a/servers/slapd/schema_check.c b/servers/slapd/schema_check.c index a6b6b98acc..0412bb4f20 100644 --- a/servers/slapd/schema_check.c +++ b/servers/slapd/schema_check.c @@ -113,7 +113,7 @@ entry_schema_check( #endif *text = "no structuralObjectClass operational attribute"; - return LDAP_OBJECT_CLASS_VIOLATION; + return LDAP_OTHER; } assert( asc->a_vals != NULL ); @@ -152,7 +152,7 @@ entry_schema_check( e->e_dn, textbuf, 0 ); #endif - return LDAP_OBJECT_CLASS_VIOLATION; + return LDAP_OTHER; } /* find the object class attribute */ @@ -189,7 +189,7 @@ entry_schema_check( } else if ( sc != oc ) { snprintf( textbuf, textlen, - "structuralObjectClass modification from '%s' to '%s' not allowed", + "structural object class modification from '%s' to '%s' not allowed", asc->a_vals[0].bv_val, nsc.bv_val ); return LDAP_NO_OBJECT_CLASS_MODS; } @@ -548,9 +548,14 @@ int structural_class( return LDAP_OBJECT_CLASS_VIOLATION; } + if( scn < 0 ) { + *text = "invalid structural object class"; + return LDAP_OBJECT_CLASS_VIOLATION; + } + *scbv = ocs[scn]; - if( scbv->bv_len ) { + if( scbv->bv_len == 0 ) { *text = "invalid structural object class"; return LDAP_OBJECT_CLASS_VIOLATION; }