]> git.sur5r.net Git - openldap/commitdiff
Fix for ITS#1258 - even if we're accepting various malformed definitions,
authorHoward Chu <hyc@openldap.org>
Tue, 18 Sep 2001 12:21:33 +0000 (12:21 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 18 Sep 2001 12:21:33 +0000 (12:21 +0000)
don't allow OIDs that are a mix of numeric and non-numeric fields.

libraries/libldap/schema.c

index ae482c30862094bbd3530349ec91a16e55750691..18a66483580a24895a36d6f09da34e1d25697bbf 100644 (file)
@@ -1658,8 +1658,9 @@ ldap_str2attributetype( const char * s, int * code, const char ** errp, const in
        savepos = ss;
        at->at_oid = parse_numericoid(&ss,code,0);
        if ( !at->at_oid ) {
-               if ( flags & ( LDAP_SCHEMA_ALLOW_NO_OID
-                               | LDAP_SCHEMA_ALLOW_OID_MACRO ) ) {
+               if ( ( flags & ( LDAP_SCHEMA_ALLOW_NO_OID
+                               | LDAP_SCHEMA_ALLOW_OID_MACRO ) )
+                           && (ss == savepos) ) {
                        /* Backtracking */
                        ss = savepos;
                        kind = get_token(&ss,&sval);
@@ -2031,7 +2032,7 @@ ldap_str2objectclass( const char * s, int * code, const char ** errp, const int
        savepos = ss;
        oc->oc_oid = parse_numericoid(&ss,code,0);
        if ( !oc->oc_oid ) {
-               if ( flags & LDAP_SCHEMA_ALLOW_ALL ) {
+               if ( (flags & LDAP_SCHEMA_ALLOW_ALL) && (ss == savepos) ) {
                        /* Backtracking */
                        ss = savepos;
                        kind = get_token(&ss,&sval);