summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-07-13 19:36:59 +1000
committerAndrew Tridgell <tridge@samba.org>2011-07-13 14:03:30 +0200
commit3dae32397a87534ff1cf764260e7fcadd6665a49 (patch)
treef15150baf9693cb1b9e4e24683212ede17611cbd
parent18995cde5c5d2e647d94f9dcde4ba9261464c217 (diff)
downloadsamba-3dae32397a87534ff1cf764260e7fcadd6665a49.tar.gz
samba-3dae32397a87534ff1cf764260e7fcadd6665a49.tar.bz2
samba-3dae32397a87534ff1cf764260e7fcadd6665a49.zip
s4-dsdb: fixed the defaultObjectCategory to have a full GUID
this fixes the DN to have a full GUID for new objects Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Wed Jul 13 14:03:30 CEST 2011 on sn-devel-104
-rw-r--r--source4/dsdb/samdb/ldb_modules/samldb.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c
index 5f17e3bd6f..5c940992ae 100644
--- a/source4/dsdb/samdb/ldb_modules/samldb.c
+++ b/source4/dsdb/samdb/ldb_modules/samldb.c
@@ -379,6 +379,30 @@ static int samldb_find_for_defaultObjectCategory(struct samldb_ctx *ac)
return ret;
}
+ if (ret == LDB_SUCCESS) {
+ /* ensure the defaultObjectCategory has a full GUID */
+ struct ldb_message *m;
+ m = ldb_msg_new(ac->msg);
+ if (m == NULL) {
+ return ldb_oom(ldb);
+ }
+ m->dn = ac->msg->dn;
+ if (ldb_msg_add_string(m, "defaultObjectCategory",
+ ldb_dn_get_extended_linearized(m, res->msgs[0]->dn, 1)) !=
+ LDB_SUCCESS) {
+ return ldb_oom(ldb);
+ }
+ m->elements[0].flags = LDB_FLAG_MOD_REPLACE;
+
+ ret = dsdb_module_modify(ac->module, m,
+ DSDB_FLAG_NEXT_MODULE,
+ ac->req);
+ if (ret != LDB_SUCCESS) {
+ return ret;
+ }
+ }
+
+
ac->res_dn = ac->dn;
return samldb_next_step(ac);