summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/samldb.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-09-03 04:14:54 +0200
committerStefan Metzmacher <metze@samba.org>2007-12-21 03:32:23 +0100
commit34e3445c60dba4638e21042ac8356007c1d27f4a (patch)
treeb5241ff297c86f25d75f214c0736e4b996058fad /source4/dsdb/samdb/ldb_modules/samldb.c
parent3afdc12b96c0e249a9e4ff665c3b2147a99381a9 (diff)
downloadsamba-34e3445c60dba4638e21042ac8356007c1d27f4a.tar.gz
samba-34e3445c60dba4638e21042ac8356007c1d27f4a.tar.bz2
samba-34e3445c60dba4638e21042ac8356007c1d27f4a.zip
r24916: (merge to release branch)
In response to bug #4892 by Matthias Wallnöfer <mwallnoefer@yahoo.de> allow the objectclass module to reconstruct the objectclass hierarchy, rather than using templates. The issue being fixed in particular is that 'top' was not being set on containers. This should ensure we do this right for all objects. Andrew Bartlett (This used to be commit eeaa6f82492f2ec5f6595d93451c1429c4f6947e)
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/samldb.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/samldb.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c
index d448e30b31..5342c14967 100644
--- a/source4/dsdb/samdb/ldb_modules/samldb.c
+++ b/source4/dsdb/samdb/ldb_modules/samldb.c
@@ -411,7 +411,7 @@ static int samldb_fill_group_object(struct ldb_module *module, const struct ldb_
}
ret = samdb_copy_template(module->ldb, msg2,
- "(&(CN=TemplateGroup)(objectclass=groupTemplate))",
+ "group",
&errstr);
if (ret != 0) {
@@ -476,7 +476,7 @@ static int samldb_fill_user_or_computer_object(struct ldb_module *module, const
if (samdb_find_attribute(module->ldb, msg, "objectclass", "computer") != NULL) {
ret = samdb_copy_template(module->ldb, msg2,
- "(&(CN=TemplateComputer)(objectclass=userTemplate))",
+ "computer",
&errstr);
if (ret) {
ldb_asprintf_errstring(module->ldb,
@@ -486,22 +486,9 @@ static int samldb_fill_user_or_computer_object(struct ldb_module *module, const
talloc_free(mem_ctx);
return ret;
}
-
- /* readd user and then computer objectclasses */
- ret = samdb_find_or_add_value(module->ldb, msg2, "objectclass", "user");
- if (ret) {
- talloc_free(mem_ctx);
- return ret;
- }
- ret = samdb_find_or_add_value(module->ldb, msg2, "objectclass", "computer");
- if (ret) {
- talloc_free(mem_ctx);
- return ret;
- }
-
} else {
ret = samdb_copy_template(module->ldb, msg2,
- "(&(CN=TemplateUser)(objectclass=userTemplate))",
+ "user",
&errstr);
if (ret) {
ldb_asprintf_errstring(module->ldb,
@@ -582,7 +569,7 @@ static int samldb_fill_foreignSecurityPrincipal_object(struct ldb_module *module
}
ret = samdb_copy_template(module->ldb, msg2,
- "(&(CN=TemplateForeignSecurityPrincipal)(objectclass=foreignSecurityPrincipalTemplate))",
+ "ForeignSecurityPrincipal",
&errstr);
if (ret != 0) {
ldb_asprintf_errstring(module->ldb,