diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-09-10 12:06:20 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-09-10 12:12:49 +1000 |
commit | 3671c9e99179b22b42acb61bfa751ab93714fdd2 (patch) | |
tree | 1ba69dd351965671bbbeedcf11a21d5dd6a5c9ac /source4/dsdb | |
parent | 7c5ce719ebb5b0247e479b3293acb4c56402fa57 (diff) | |
download | samba-3671c9e99179b22b42acb61bfa751ab93714fdd2.tar.gz samba-3671c9e99179b22b42acb61bfa751ab93714fdd2.tar.bz2 samba-3671c9e99179b22b42acb61bfa751ab93714fdd2.zip |
s4/schema: don't crash if we don't have subClassOf
Diffstat (limited to 'source4/dsdb')
-rw-r--r-- | source4/dsdb/schema/schema_inferiors.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source4/dsdb/schema/schema_inferiors.c b/source4/dsdb/schema/schema_inferiors.c index 63ddb4a424..b0ecc08600 100644 --- a/source4/dsdb/schema/schema_inferiors.c +++ b/source4/dsdb/schema/schema_inferiors.c @@ -49,7 +49,8 @@ static char **schema_supclasses(struct dsdb_schema *schema, struct dsdb_class *s } /* Cope with 'top SUP top', ie top is subClassOf top */ - if (strcmp(schema_class->lDAPDisplayName, schema_class->subClassOf) == 0) { + if (schema_class->subClassOf && + strcmp(schema_class->lDAPDisplayName, schema_class->subClassOf) == 0) { schema_class->supclasses = list; return list; } @@ -132,7 +133,11 @@ static void schema_create_subclasses(struct dsdb_schema *schema) for (schema_class=schema->classes; schema_class; schema_class=schema_class->next) { struct dsdb_class *schema_class2 = dsdb_class_by_lDAPDisplayName(schema, schema_class->subClassOf); - if (schema_class != schema_class2) { + if (schema_class2 == NULL) { + DEBUG(0,("ERROR: no subClassOf for '%s'\n", schema_class->lDAPDisplayName)); + continue; + } + if (schema_class2 && schema_class != schema_class2) { if (schema_class2->subclasses_direct == NULL) { schema_class2->subclasses_direct = str_list_make_empty(schema_class2); } |