]> git.sur5r.net Git - openldap/commitdiff
All empty IA5 and Printable strings, but not Directory strings.
authorKurt Zeilenga <kurt@openldap.org>
Thu, 3 Jan 2002 20:03:27 +0000 (20:03 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 3 Jan 2002 20:03:27 +0000 (20:03 +0000)
servers/slapd/schema_init.c

index 8f781d3338f995cb78f889c17751e040d79835bd..968dc443a30a982635d830a4c6ceb999e7d3e0c1 100644 (file)
@@ -1939,8 +1939,6 @@ printableStringValidate(
 {
        ber_len_t i;
 
-       if( !val->bv_len ) return LDAP_INVALID_SYNTAX;
-
        for(i=0; i < val->bv_len; i++) {
                if( !SLAP_PRINTABLE(val->bv_val[i]) ) {
                        return LDAP_INVALID_SYNTAX;
@@ -1957,8 +1955,6 @@ printablesStringValidate(
 {
        ber_len_t i;
 
-       if( !val->bv_len ) return LDAP_INVALID_SYNTAX;
-
        for(i=0; i < val->bv_len; i++) {
                if( !SLAP_PRINTABLES(val->bv_val[i]) ) {
                        return LDAP_INVALID_SYNTAX;
@@ -1975,10 +1971,10 @@ IA5StringValidate(
 {
        ber_len_t i;
 
-       if( !val->bv_len ) return LDAP_INVALID_SYNTAX;
-
        for(i=0; i < val->bv_len; i++) {
-               if( !isascii(val->bv_val[i]) ) return LDAP_INVALID_SYNTAX;
+               if( !LDAP_ASCII(val->bv_val[i]) ) {
+                       return LDAP_INVALID_SYNTAX;
+               }
        }
 
        return LDAP_SUCCESS;
@@ -1999,10 +1995,6 @@ IA5StringNormalize(
                p++;
        }
 
-       if( *p == '\0' ) {
-               return LDAP_INVALID_SYNTAX;
-       }
-
        normalized->bv_val = ch_strdup( p );
        p = q = normalized->bv_val;
 
@@ -2019,12 +2011,9 @@ IA5StringNormalize(
                }
        }
 
-       assert( normalized->bv_val < p );
+       assert( normalized->bv_val <= p );
        assert( q <= p );
 
-       /* cannot start with a space */
-       assert( !ASCII_SPACE(*normalized->bv_val) );
-
        /*
         * If the string ended in space, backup the pointer one
         * position.  One is enough because the above loop collapsed
@@ -2035,9 +2024,6 @@ IA5StringNormalize(
                --q;
        }
 
-       /* cannot end with a space */
-       assert( !ASCII_SPACE( q[-1] ) );
-
        /* null terminate */
        *q = '\0';