summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-06-09 21:53:01 +1000
committerAndrew Bartlett <abartlet@samba.org>2010-06-15 10:51:34 +1000
commit9e28ceda96a0c76752af851db4ccba86c010ed67 (patch)
treee41a3cb60a3e969291d654b796bf6c1368e3e0ae /source4
parent5323485eb3d5aeb844535c5b08fbdd3e7f8c9429 (diff)
downloadsamba-9e28ceda96a0c76752af851db4ccba86c010ed67.tar.gz
samba-9e28ceda96a0c76752af851db4ccba86c010ed67.tar.bz2
samba-9e28ceda96a0c76752af851db4ccba86c010ed67.zip
s4:dsdb Keep the DRS-based prefix map for use in provision-based schema
We need to use the remote prefix map for the provision schema, or else we can't decode new, non-standard attributes into OIDs. Then once we decode that schema, we can try again and get them properly translated. Andrew Bartlett Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/libnet/libnet_vampire.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/source4/libnet/libnet_vampire.c b/source4/libnet/libnet_vampire.c
index f7c2d66fc6..3b0b5a78b3 100644
--- a/source4/libnet/libnet_vampire.c
+++ b/source4/libnet/libnet_vampire.c
@@ -61,6 +61,7 @@ struct libnet_vampire_cb_state {
struct cli_credentials *machine_account;
struct dsdb_schema *self_made_schema;
struct dsdb_schema *provision_schema;
+ DATA_BLOB prefixmap_blob;
const struct dsdb_schema *schema;
struct ldb_context *ldb;
@@ -266,7 +267,7 @@ static NTSTATUS libnet_vampire_cb_apply_schema(struct libnet_vampire_cb_state *s
c->gensec_skey,
s, &schema_objs_1);
if (!W_ERROR_IS_OK(status)) {
- DEBUG(0,("Failed to convert objects: %s\n", win_errstr(status)));
+ DEBUG(0,("Failed to convert objects when trying to import over DRS (1st pass, to create local schema): %s\n", win_errstr(status)));
return werror_to_ntstatus(status);
}
@@ -307,7 +308,7 @@ static NTSTATUS libnet_vampire_cb_apply_schema(struct libnet_vampire_cb_state *s
c->gensec_skey,
s, &schema_objs_2);
if (!W_ERROR_IS_OK(status)) {
- DEBUG(0,("Failed to convert objects: %s\n", win_errstr(status)));
+ DEBUG(0,("Failed to convert objects when trying to import over DRS (2nd pass, to store remote schema): %s\n", win_errstr(status)));
return werror_to_ntstatus(status);
}
@@ -423,6 +424,16 @@ NTSTATUS libnet_vampire_cb_schema_chunk(void *private_data,
}
if (!s->schema) {
+ WERROR werr;
+ /* Put the DRS prefixmap aside for the schema we are
+ * about to load in the provision, and into the one we
+ * are making with the help of DRS */
+
+ werr = dsdb_get_drsuapi_prefixmap_as_blob(mapping_ctr, s, &s->prefixmap_blob);
+ if (!W_ERROR_IS_OK(werr)) {
+ return werror_to_ntstatus(werr);
+ }
+
s->self_made_schema = dsdb_new_schema(s);
NT_STATUS_HAVE_NO_MEMORY(s->self_made_schema);