From: Kurt Zeilenga Date: Mon, 28 Jun 2004 22:53:19 +0000 (+0000) Subject: A more strict oidValidate X-Git-Tag: OPENDLAP_REL_ENG_2_2_MP~158 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=537aab8a141a4a6f71ac6e12010eec37179341dc;p=openldap A more strict oidValidate --- diff --git a/servers/slapd/schema_prep.c b/servers/slapd/schema_prep.c index 594338144c..33366f3a10 100644 --- a/servers/slapd/schema_prep.c +++ b/servers/slapd/schema_prep.c @@ -57,33 +57,26 @@ oidValidate( } } else { + int sep = 0; while( OID_LEADCHAR( val.bv_val[0] ) ) { - if ( val.bv_len == 1 ) { - return LDAP_SUCCESS; - } - - /* FIXME: the OID of 'dc' and other attributeTypes - * starts with '0'! */ - if ( val.bv_val[0] == '0' && !OID_SEPARATOR( val.bv_val[1] ) ) { - break; - } - val.bv_val++; val.bv_len--; - while ( OID_LEADCHAR( val.bv_val[0] )) { - val.bv_val++; - val.bv_len--; - - if ( val.bv_len == 0 ) { - return LDAP_SUCCESS; + if ( val.bv_val[-1] != '0' ) { + while ( OID_LEADCHAR( val.bv_val[0] )) { + val.bv_val++; + val.bv_len--; } } - if( !OID_SEPARATOR( val.bv_val[0] )) { - break; + if( val.bv_len == 0 ) { + if( sep == 0 ) break; + return LDAP_SUCCESS; } + if( !OID_SEPARATOR( val.bv_val[0] )) break; + + sep++; val.bv_val++; val.bv_len--; }