summaryrefslogtreecommitdiff
path: root/source4/torture/libnet
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-01-14 15:49:06 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:40:50 -0500
commitcaf37188d625675d542736a69150f4e73de66666 (patch)
tree7d5528b40005f8d06ca2683b19008be6a5a9247e /source4/torture/libnet
parentabeb80b77fbd171d18ea50881022affdb1e9abbc (diff)
downloadsamba-caf37188d625675d542736a69150f4e73de66666.tar.gz
samba-caf37188d625675d542736a69150f4e73de66666.tar.bz2
samba-caf37188d625675d542736a69150f4e73de66666.zip
r20768: store the prefixMap and schemaInfo attributes on the schema head object
metze (This used to be commit ac228b3a6a8c33385ab63ab0608b3aa4b99375f5)
Diffstat (limited to 'source4/torture/libnet')
-rw-r--r--source4/torture/libnet/libnet_BecomeDC.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/source4/torture/libnet/libnet_BecomeDC.c b/source4/torture/libnet/libnet_BecomeDC.c
index aec776307c..c11801e5db 100644
--- a/source4/torture/libnet/libnet_BecomeDC.c
+++ b/source4/torture/libnet/libnet_BecomeDC.c
@@ -264,6 +264,11 @@ static NTSTATUS test_apply_schema(struct test_become_dc_state *s,
struct dsdb_extended_replicated_objects *objs;
struct repsFromTo1 *s_dsa;
char *tmp_dns_name;
+ struct ldb_message *msg;
+ struct ldb_val prefixMap_val;
+ struct ldb_message_element *prefixMap_el;
+ struct ldb_val schemaInfo_val;
+ struct ldb_message_element *schemaInfo_el;
uint32_t i;
int ret;
@@ -415,6 +420,33 @@ static NTSTATUS test_apply_schema(struct test_become_dc_state *s,
}
}
+ msg = ldb_msg_new(objs);
+ NT_STATUS_HAVE_NO_MEMORY(msg);
+ msg->dn = objs->partition_dn;
+
+ status = dsdb_get_oid_mappings_ldb(s->schema, msg, &prefixMap_val, &schemaInfo_val);
+ if (!W_ERROR_IS_OK(status)) {
+ DEBUG(0,("Failed dsdb_get_oid_mappings_ldb(%s)\n", win_errstr(status)));
+ return werror_to_ntstatus(status);
+ }
+
+ ret = ldb_msg_add_value(msg, "prefixMap", &prefixMap_val, &prefixMap_el);
+ if (ret != LDB_SUCCESS) {
+ return NT_STATUS_FOOBAR;
+ }
+ prefixMap_el->flags = LDB_FLAG_MOD_REPLACE;
+ ret = ldb_msg_add_value(msg, "prefixMap", &schemaInfo_val, &schemaInfo_el);
+ if (ret != LDB_SUCCESS) {
+ return NT_STATUS_FOOBAR;
+ }
+ schemaInfo_el->flags = LDB_FLAG_MOD_REPLACE;
+
+ ret = ldb_modify(s->ldb, msg);
+ if (ret != LDB_SUCCESS) {
+ DEBUG(0,("Failed to add prefixMap and schemaInfo %s\n", ldb_strerror(ret)));
+ return NT_STATUS_FOOBAR;
+ }
+
talloc_free(s_dsa);
talloc_free(objs);
return NT_STATUS_OK;