]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/schema_init.c
check consistency of referrals and result code (ITS#4861)
[openldap] / servers / slapd / schema_init.c
index 152ea67614b3f9ae3d6b5b0a3059f452c852d4e4..616d9703842915b381cccaf56eea1facf464339e 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2006 The OpenLDAP Foundation.
+ * Copyright 1998-2007 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -795,7 +795,7 @@ bitStringValidate(
    [X.520].
 
  *
- * draft-ietf-ldapbis-models-xx.txt [MODELS] says:
+ * RFC 4512 says:
  *
 
 1.4. Common ABNF Productions
@@ -813,11 +813,11 @@ bitStringValidate(
  * 
  * 1.3.6.1.4.1.1466.0=#04024869,o=test,c=gb#'101'B
  * 
- * Since draft-ietf-ldapbis-dn-xx.txt clarifies that SHARP,
- * i.e. "#", doesn't have to be escaped except when at the
- * beginning of a value, the definition of Name and Optional
- * UID appears to be flawed, because there is no clear means
- * to determine whether the UID part is present or not.
+ * RFC 4514 clarifies that SHARP, i.e. "#", doesn't have to
+ * be escaped except when at the beginning of a value, the
+ * definition of Name and Optional UID appears to be flawed,
+ * because there is no clear means to determine whether the
+ * UID part is present or not.
  *
  * Example:
  *
@@ -1263,7 +1263,7 @@ Summary:
 
   TelephoneNumber      subset  subset  i + ignore all spaces and "-"
 
-  See draft-ietf-ldapbis-strpro for details (once published).
+  See RFC 4518 for details.
 
 
 Directory String -
@@ -2049,8 +2049,6 @@ IA5StringValidate(
 {
        ber_len_t i;
 
-       if( BER_BVISEMPTY( val ) ) return LDAP_INVALID_SYNTAX;
-
        for(i=0; i < val->bv_len; i++) {
                if( !LDAP_ASCII(val->bv_val[i]) ) {
                        return LDAP_INVALID_SYNTAX;
@@ -2073,8 +2071,6 @@ IA5StringNormalize(
        int casefold = !SLAP_MR_ASSOCIATED( mr,
                slap_schema.si_mr_caseExactIA5Match );
 
-       assert( !BER_BVISEMPTY( val ) );
-
        assert( SLAP_MR_IS_VALUE_OF_SYNTAX( use ) != 0 );
 
        p = val->bv_val;
@@ -2111,18 +2107,12 @@ IA5StringNormalize(
         * position.  One is enough because the above loop collapsed
         * all whitespace to a single space.
         */
-       if ( ASCII_SPACE( q[-1] ) ) --q;
+       if ( q > normalized->bv_val && ASCII_SPACE( q[-1] ) ) --q;
 
        /* null terminate */
        *q = '\0';
 
        normalized->bv_len = q - normalized->bv_val;
-       if( BER_BVISEMPTY( normalized ) ) {
-               normalized->bv_val = slap_sl_realloc( normalized->bv_val, 2, ctx );
-               normalized->bv_val[0] = ' ';
-               normalized->bv_val[1] = '\0';
-               normalized->bv_len = 1;
-       }
 
        return LDAP_SUCCESS;
 }
@@ -4165,13 +4155,13 @@ char *directoryStringSyntaxes[] = {
 };
 char *integerFirstComponentMatchSyntaxes[] = {
        "1.3.6.1.4.1.1466.115.121.1.27" /* INTEGER */,
-       "1.3.6.1.4.1.1466.115.121.1.17" /* ditStructureRuleDescription */,
+       "1.3.6.1.4.1.1466.115.121.1.17" /* dITStructureRuleDescription */,
        NULL
 };
 char *objectIdentifierFirstComponentMatchSyntaxes[] = {
        "1.3.6.1.4.1.1466.115.121.1.38" /* OID */,
        "1.3.6.1.4.1.1466.115.121.1.3"  /* attributeTypeDescription */,
-       "1.3.6.1.4.1.1466.115.121.1.16" /* ditContentRuleDescription */,
+       "1.3.6.1.4.1.1466.115.121.1.16" /* dITContentRuleDescription */,
        "1.3.6.1.4.1.1466.115.121.1.54" /* ldapSyntaxDescription */,
        "1.3.6.1.4.1.1466.115.121.1.30" /* matchingRuleDescription */,
        "1.3.6.1.4.1.1466.115.121.1.31" /* matchingRuleUseDescription */,