]> git.sur5r.net Git - openldap/commitdiff
Add SLAP_SYNTAX_DN syntax flag
authorQuanah Gibson-Mount <quanah@openldap.org>
Wed, 15 Dec 2010 20:07:24 +0000 (20:07 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Wed, 15 Dec 2010 20:07:24 +0000 (20:07 +0000)
Check for SLAP_SYNTAX_DN flag instead of distinguishedName syntax

servers/slapd/overlays/deref.c
servers/slapd/schema_init.c
servers/slapd/slap.h

index d3e29921f1b05e9580ce1cb55d23902e712f3f63..1c247832a747d77bde4eaa30f464392cd84913c9 100644 (file)
@@ -210,7 +210,7 @@ deref_parseCtrl (
                        }
                }
 
-               if ( ds->ds_derefAttr->ad_type->sat_syntax != slap_schema.si_syn_distinguishedName ) {
+               if ( !( ds->ds_derefAttr->ad_type->sat_syntax->ssyn_flags & SLAP_SYNTAX_DN )) {
                        if ( ctrl->ldctl_iscritical ) {
                                rs->sr_text = "Dereference control: derefAttr syntax not distinguishedName";
                                rs->sr_err = LDAP_PROTOCOL_ERROR;
index 82ff09d06d726aa8417b7d623d4994f868aa38b2..df805dbffc25aa67195a94a3ef92361f4f00f8d3 100644 (file)
@@ -6058,7 +6058,7 @@ static slap_syntax_defs_rec syntax_defs[] = {
                countryStringValidate, NULL},
 #endif
        {"( 1.3.6.1.4.1.1466.115.121.1.12 DESC 'Distinguished Name' )",
-               0, NULL, dnValidate, dnPretty},
+               SLAP_SYNTAX_DN, NULL, dnValidate, dnPretty},
        {"( 1.2.36.79672281.1.5.0 DESC 'RDN' )",
                0, NULL, rdnValidate, rdnPretty},
 #ifdef LDAP_COMP_MATCH
@@ -6108,7 +6108,7 @@ static slap_syntax_defs_rec syntax_defs[] = {
        {"( 1.3.6.1.4.1.1466.115.121.1.33 DESC 'MHS OR Address' )",
                0, NULL, NULL, NULL},
        {"( 1.3.6.1.4.1.1466.115.121.1.34 DESC 'Name And Optional UID' )",
-               0, NULL, nameUIDValidate, nameUIDPretty },
+               SLAP_SYNTAX_DN, NULL, nameUIDValidate, nameUIDPretty },
        {"( 1.3.6.1.4.1.1466.115.121.1.35 DESC 'Name Form Description' )",
                0, NULL, NULL, NULL},
        {"( 1.3.6.1.4.1.1466.115.121.1.36 DESC 'Numeric String' )",
index d16f3c8d8e47f3e754c2fb8bdd5f942ff3712b49..e082c321a79953e090d5d200c7b8655a0183ef35 100644 (file)
@@ -421,6 +421,7 @@ struct Syntax {
 #define SLAP_SYNTAX_HIDE       0x8000U /* hide (do not publish) */
 #endif
 #define        SLAP_SYNTAX_HARDCODE    0x10000U        /* This is hardcoded schema */
+#define        SLAP_SYNTAX_DN          0x20000U        /* Treat like a DN */
 
        Syntax                          **ssyn_sups;