Use the direct pointer to the syntax
authorAndrew Bartlett <abartlet@samba.org>
Tue, 2 Dec 2008 03:13:41 +0000 (14:13 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 2 Dec 2008 03:13:41 +0000 (14:13 +1100)
This rather than manually searching for it, and is inspired by a
similar commit in dsdb/schema/schema_description.c by metze

Andrew Bartlett

source4/utils/ad2oLschema.c

index e926dd1ccc50e476b88452fcc6f1b30db9b6f92a..2e3139d9c75300e515e3f1be914d8c840ca29563 100644 (file)
@@ -226,7 +226,6 @@ static struct schema_conv process_convert(struct ldb_context *ldb, enum dsdb_sch
                const char *equality = NULL, *substring = NULL;
                bool single_value = attribute->isSingleValued;
 
                const char *equality = NULL, *substring = NULL;
                bool single_value = attribute->isSingleValued;
 
-               const struct dsdb_syntax *map = find_syntax_map_by_ad_syntax(attribute->oMSyntax);
                char *schema_entry = NULL;
                int j;
 
                char *schema_entry = NULL;
                int j;
 
@@ -244,11 +243,11 @@ static struct schema_conv process_convert(struct ldb_context *ldb, enum dsdb_sch
                        }
                }
                
                        }
                }
                
-               if (map) {
+               if (attribute->syntax) {
                        /* We might have been asked to remap this oid,
                         * due to a conflict, or lack of
                         * implementation */
                        /* We might have been asked to remap this oid,
                         * due to a conflict, or lack of
                         * implementation */
-                       syntax = map->ldap_oid;
+                       syntax = attribute->syntax->ldap_oid;
                        /* We might have been asked to remap this oid, due to a conflict */
                        for (j=0; syntax && oid_map && oid_map[j].old_oid; j++) {
                                if (strcasecmp(syntax, oid_map[j].old_oid) == 0) {
                        /* We might have been asked to remap this oid, due to a conflict */
                        for (j=0; syntax && oid_map && oid_map[j].old_oid; j++) {
                                if (strcasecmp(syntax, oid_map[j].old_oid) == 0) {
@@ -257,8 +256,8 @@ static struct schema_conv process_convert(struct ldb_context *ldb, enum dsdb_sch
                                }
                        }
                        
                                }
                        }
                        
-                       equality = map->equality;
-                       substring = map->substring;
+                       equality = attribute->syntax->equality;
+                       substring = attribute->syntax->substring;
                }
 
                /* We might have been asked to remap this name, due to a conflict */
                }
 
                /* We might have been asked to remap this name, due to a conflict */