diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-11-09 20:40:21 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-11-12 16:34:09 +1100 |
commit | d6563801d1783a8cb1b9740878d0a07d40085f32 (patch) | |
tree | 011ccf8ea51594c616dc031ad264d19b67d6360c /source4/torture/ldap | |
parent | d053584443613177bc8e7e18c594378baf9df34d (diff) | |
download | samba-d6563801d1783a8cb1b9740878d0a07d40085f32.tar.gz samba-d6563801d1783a8cb1b9740878d0a07d40085f32.tar.bz2 samba-d6563801d1783a8cb1b9740878d0a07d40085f32.zip |
s4:dsdb/schema Simplify schema loading from ldb messages
It turns out that we always add the class/attribute to the schema.
Diffstat (limited to 'source4/torture/ldap')
-rw-r--r-- | source4/torture/ldap/schema.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/source4/torture/ldap/schema.c b/source4/torture/ldap/schema.c index b0a4892d7a..c9423409a8 100644 --- a/source4/torture/ldap/schema.c +++ b/source4/torture/ldap/schema.c @@ -211,43 +211,28 @@ again: static int test_add_attribute(void *ptr, struct ldb_context *ldb, struct ldb_message *msg) { struct dsdb_schema *schema = talloc_get_type(ptr, struct dsdb_schema); - struct dsdb_attribute *attr = NULL; WERROR status; - attr = talloc_zero(schema, struct dsdb_attribute); - if (!attr) { - goto failed; - } - - status = dsdb_attribute_from_ldb(ldb, schema, msg, attr, attr); + status = dsdb_attribute_from_ldb(ldb, schema, msg); if (!W_ERROR_IS_OK(status)) { goto failed; } - DLIST_ADD_END(schema->attributes, attr, struct dsdb_attribute *); return LDB_SUCCESS; failed: - talloc_free(attr); return LDB_ERR_OTHER; } static int test_add_class(void *ptr, struct ldb_context *ldb, struct ldb_message *msg) { struct dsdb_schema *schema = talloc_get_type(ptr, struct dsdb_schema); - struct dsdb_class *obj; WERROR status; - obj = talloc_zero(schema, struct dsdb_class); - if (!obj) { - goto failed; - } - - status = dsdb_class_from_ldb(schema, msg, obj, obj); + status = dsdb_class_from_ldb(schema, msg); if (!W_ERROR_IS_OK(status)) { goto failed; } - DLIST_ADD_END(schema->classes, obj, struct dsdb_class *); return LDB_SUCCESS; failed: return LDB_ERR_OTHER; |