From 9e28ceda96a0c76752af851db4ccba86c010ed67 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 9 Jun 2010 21:53:01 +1000 Subject: 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 --- source4/libnet/libnet_vampire.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'source4/libnet/libnet_vampire.c') 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); -- cgit