]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/at.c
Prepare for unifdef -DSLAPD_SCHEMA_NOT_COMPAT
[openldap] / servers / slapd / at.c
index 40964b217b67c9482ee1fa2fe407cfac6ad8d869..3271ed303ea89db5f564674e9dc1b1422c2f844f 100644 (file)
@@ -92,7 +92,7 @@ at_config(
 #define SYNTAX_DSCE_OID        "2.5.13.5"
 #define SYNTAX_IA5_OID "1.3.6.1.4.1.1466.115.121.1.26"
 #define SYNTAX_IA5CE_OID       "1.3.6.1.4.1.1466.109.114.1"
-#define SYNTAX_DN_OID  SLAPD_OID_DN_SYNTAX
+#define SYNTAX_DN_OID  "1.3.6.1.4.1.1466.115.121.1.12"
 #define SYNTAX_TEL_OID "1.3.6.1.4.1.1466.115.121.1.50"
 #define SYNTAX_BIN_OID "1.3.6.1.4.1.1466.115.121.1.40" /* octetString */
 
@@ -173,6 +173,19 @@ at_fake_if_needed(
 
 #endif
 
+int is_at_syntax(
+       AttributeType *at,
+       const char *oid )
+{
+       for( ; at != NULL; at = at->sat_sup ) {
+               if( at->sat_syntax_oid ) {
+                       return ( strcmp( at->sat_syntax_oid, oid ) == 0 );
+               }
+       }
+
+       return 0;
+}
+
 int is_at_subtype(
        AttributeType *sub,
        AttributeType *sup )
@@ -402,7 +415,6 @@ at_add(
        Syntax          *syn;
        int             code;
        char                    *cname;
-       LDAP_SCHEMA_EXTENSION_ITEM      **ext;
 
        if ( at->at_names && at->at_names[0] ) {
                cname = at->at_names[0];
@@ -448,8 +460,6 @@ at_add(
                sat->sat_equality = sat->sat_sup->sat_equality;
                sat->sat_ordering = sat->sat_sup->sat_ordering;
                sat->sat_substr = sat->sat_sup->sat_substr;
-               sat->sat_binary = sat->sat_sup->sat_binary;
-               sat->sat_not_h_r = sat->sat_sup->sat_not_h_r;
        }
 
        if ( at->at_syntax_oid ) {
@@ -525,22 +535,6 @@ at_add(
                }
        }
 
-       if ( sat->sat_extensions ) {
-               for ( ext = sat->sat_extensions; *ext; ext++ ) {
-                       if ( strcmp((*ext)->lsei_name, "X-BINARY-TRANSFER-REQUIRED") == 0 &&
-                            (*ext)->lsei_values &&
-                            (*ext)->lsei_values[0] &&
-                            strcasecmp((*ext)->lsei_values[0], "true") == 0 ) {
-                               sat->sat_binary = 1;
-                       } else if ( strcmp((*ext)->lsei_name, "X-NOT-HUMAN-READABLE") == 0 &&
-                            (*ext)->lsei_values &&
-                            (*ext)->lsei_values[0] &&
-                            strcasecmp((*ext)->lsei_values[0], "true") == 0 ) {
-                               sat->sat_not_h_r = 1;
-                       }  
-               }
-       }
-
        code = at_insert(sat,err);
        return code;
 }