[PATCH] Re: Fix up NET-API-BECOME-DC and repl_meta_data
Andrew Bartlett
abartlet at samba.org
Tue Jan 22 11:36:09 GMT 2008
On Tue, 2008-01-22 at 12:16 +0100, Stefan (metze) Metzmacher wrote:
> Andrew,
>
> please commit this in small pieces using 'git add -i'
> and check with 'git diff --cached' what is selected for the next
> commit.
Thanks, as indicated I'll break this up, and for simo's sanity reduce
the ldb changes to what is acually required (probably skip the extra
debugging).
I'll also ensure I don't disrupt the rest of Samba (need to run make
test).
Thankyou very much!
Andrew Bartlett
> metze
> >> ------------------------------------------------------------------------
> >>
> >> diff --git a/source/dsdb/repl/replicated_objects.c b/source/dsdb/repl/replicated_objects.c
> >> index 8aff134..552d83f 100644
> >> --- a/source/dsdb/repl/replicated_objects.c
> >> +++ b/source/dsdb/repl/replicated_objects.c
> >> @@ -400,8 +400,8 @@ WERROR dsdb_extended_replicated_objects_commit(struct ldb_context *ldb,
> >>
> >> ret = ldb_extended(ldb, DSDB_EXTENDED_REPLICATED_OBJECTS_OID, out, &ext_res);
> >> if (ret != LDB_SUCCESS) {
> >> - DEBUG(0,("Failed to apply records: %d: %s\n",
> >> - ret, ldb_strerror(ret)));
> >> + DEBUG(0,("Failed to apply records: %s: %s\n",
> >> + ldb_errstring(ldb), ldb_strerror(ret)));
> >> talloc_free(out);
> >> return WERR_FOOBAR;
> >> }
>
> please commit this in a single commit.
>
> >> diff --git a/source/dsdb/samdb/ldb_modules/partition.c b/source/dsdb/samdb/ldb_modules/partition.c
> >> index 61b6444..40511a9 100644
> >> --- a/source/dsdb/samdb/ldb_modules/partition.c
> >> +++ b/source/dsdb/samdb/ldb_modules/partition.c
> >> @@ -303,10 +303,19 @@ static int partition_replicate(struct ldb_module *module, struct ldb_request *re
> >> * if we haven't found a matching partition
> >> * pass the request to the main ldb
> >> *
> >> - * TODO: we should maybe return an error here
> >> - * if it's not a special dn
> >> */
> >>
> >> + if (!ldb_dn_is_special(dn)) {
> >> + /* TODO:
> >> + We should change this to a referral,
> >> + based on pulling the DN apart, in future
> >> + */
> >> + ldb_asprintf_errstring(module->ldb,
> >> + "partition_replicate: "
> >> + "Operation on DN %s invalid, not a partition",
> >> + ldb_dn_get_linearized(dn));
> >> + return LDB_ERR_NO_SUCH_OBJECT;
> >> + }
> >> return ldb_next_request(module, req);
> >> }
>
> This should also be a small commit.
>
> >> @@ -678,7 +687,6 @@ static int partition_sequence_number(struct ldb_module *module, struct ldb_reque
> >> static int partition_extended_replicated_objects(struct ldb_module *module, struct ldb_request *req)
> >> {
> >> struct dsdb_extended_replicated_objects *ext;
> >> -
> >> ext = talloc_get_type(req->op.extended.data, struct dsdb_extended_replicated_objects);
> >> if (!ext) {
> >> ldb_debug(module->ldb, LDB_DEBUG_FATAL, "partition_extended_replicated_objects: invalid extended data\n");
> >> @@ -692,6 +700,7 @@ static int partition_extended_replicated_objects(struct ldb_module *module, stru
> >> }
> >>
> >> return partition_replicate(module, req, ext->partition_dn);
> >> +
> >> }
> >>
> >> /* extended */
>
> please drop this reformatting.
>
> >> diff --git a/source/dsdb/samdb/ldb_modules/repl_meta_data.c b/source/dsdb/samdb/ldb_modules/repl_meta_data.c
> >> index 5a3cc4b..a21cf25 100644
> >> --- a/source/dsdb/samdb/ldb_modules/repl_meta_data.c
> >> +++ b/source/dsdb/samdb/ldb_modules/repl_meta_data.c
> >> @@ -240,12 +240,9 @@ static int replmd_prepare_originating(struct ldb_module *module, struct ldb_requ
> >> struct ldb_dn *dn, const char *fn_name,
> >> int (*fn)(struct ldb_module *,
> >> struct ldb_request *,
> >> - const struct dsdb_schema *,
> >> - const struct dsdb_control_current_partition *))
> >> + const struct dsdb_schema *))
> >> {
> >> const struct dsdb_schema *schema;
> >> - const struct ldb_control *partition_ctrl;
> >> - const struct dsdb_control_current_partition *partition;
> >>
> >> /* do not manipulate our control entries */
> >> if (ldb_dn_is_special(dn)) {
> >> @@ -260,46 +257,16 @@ static int replmd_prepare_originating(struct ldb_module *module, struct ldb_requ
> >> return LDB_ERR_CONSTRAINT_VIOLATION;
> >> }
> >>
> >> - partition_ctrl = ldb_request_get_control(req, DSDB_CONTROL_CURRENT_PARTITION_OID);
> >> - if (!partition_ctrl) {
> >> - ldb_debug_set(module->ldb, LDB_DEBUG_FATAL,
> >> - "%s: no current partition control found",
> >> - fn_name);
> >> - return LDB_ERR_CONSTRAINT_VIOLATION;
> >> - }
> >> -
> >> - partition = talloc_get_type(partition_ctrl->data,
> >> - struct dsdb_control_current_partition);
> >> - if (!partition) {
> >> - ldb_debug_set(module->ldb, LDB_DEBUG_FATAL,
> >> - "%s: current partition control contains invalid data",
> >> - fn_name);
> >> - return LDB_ERR_CONSTRAINT_VIOLATION;
> >> - }
> >> -
> >> - if (partition->version != DSDB_CONTROL_CURRENT_PARTITION_VERSION) {
> >> - ldb_debug_set(module->ldb, LDB_DEBUG_FATAL,
> >> - "%s: current partition control contains invalid version [%u != %u]\n",
> >> - fn_name, partition->version, DSDB_CONTROL_CURRENT_PARTITION_VERSION);
> >> - return LDB_ERR_CONSTRAINT_VIOLATION;
> >> - }
> >> -
> >> - return fn(module, req, schema, partition);
> >> + return fn(module, req, schema);
> >> }
> >>
> >> static int replmd_add_originating(struct ldb_module *module,
> >> struct ldb_request *req,
> >> - const struct dsdb_schema *schema,
> >> - const struct dsdb_control_current_partition *partition)
> >> + const struct dsdb_schema *schema)
> >> {
> >> enum ndr_err_code ndr_err;
> >> struct ldb_request *down_req;
> >> struct ldb_message *msg;
> >> - uint32_t instance_type;
> >> - struct ldb_dn *new_dn;
> >> - const char *rdn_name;
> >> - const char *rdn_name_upper;
> >> - const struct ldb_val *rdn_value = NULL;
> >> const struct dsdb_attribute *rdn_attr = NULL;
> >> struct GUID guid;
> >> struct ldb_val guid_value;
> >> @@ -321,12 +288,6 @@ static int replmd_add_originating(struct ldb_module *module,
> >> return LDB_ERR_UNWILLING_TO_PERFORM;
> >> }
> >>
> >> - if (ldb_msg_find_element(req->op.add.message, "instanceType")) {
> >> - ldb_debug_set(module->ldb, LDB_DEBUG_ERROR,
> >> - "replmd_add_originating: it's not allowed to add an object with instanceType\n");
> >> - return LDB_ERR_UNWILLING_TO_PERFORM;
> >> - }
> >> -
> >> /* Get a sequence number from the backend */
> >> ret = ldb_sequence_number(module->ldb, LDB_SEQ_NEXT, &seq_num);
> >> if (ret != LDB_SUCCESS) {
> >> @@ -368,32 +329,9 @@ static int replmd_add_originating(struct ldb_module *module,
> >> return LDB_ERR_OPERATIONS_ERROR;
> >> }
> >>
> >> - /*
> >> - * get details of the rdn name
> >> - */
> >> - rdn_name = ldb_dn_get_rdn_name(msg->dn);
> >> - if (!rdn_name) {
> >> - talloc_free(down_req);
> >> - ldb_oom(module->ldb);
> >> - return LDB_ERR_OPERATIONS_ERROR;
> >> - }
> >> - rdn_attr = dsdb_attribute_by_lDAPDisplayName(schema, rdn_name);
> >> - if (!rdn_attr) {
> >> - talloc_free(down_req);
> >> - return LDB_ERR_OPERATIONS_ERROR;
> >> - }
> >> - rdn_value = ldb_dn_get_rdn_val(msg->dn);
> >> - if (!rdn_value) {
> >> - talloc_free(down_req);
> >> - ldb_oom(module->ldb);
> >> - return LDB_ERR_OPERATIONS_ERROR;
> >> - }
> >> -
> >> /*
> >> * remove autogenerated attributes
> >> */
> >> - ldb_msg_remove_attr(msg, rdn_name);
> >> - ldb_msg_remove_attr(msg, "name");
> >> ldb_msg_remove_attr(msg, "whenCreated");
> >> ldb_msg_remove_attr(msg, "whenChanged");
> >> ldb_msg_remove_attr(msg, "uSNCreated");
> >> @@ -401,69 +339,14 @@ static int replmd_add_originating(struct ldb_module *module,
> >> ldb_msg_remove_attr(msg, "replPropertyMetaData");
> >>
> >> /*
> >> - * TODO: construct a new DN out of:
> >> - * - the parent DN
> >> - * - the upper case of rdn_attr->LDAPDisplayName
> >> - * - rdn_value
> >> - */
> >> - new_dn = ldb_dn_copy(msg, msg->dn);
> >> - if (!new_dn) {
> >> - talloc_free(down_req);
> >> - ldb_oom(module->ldb);
> >> - return LDB_ERR_OPERATIONS_ERROR;
> >> - }
> >> - rdn_name_upper = strupper_talloc(msg, rdn_attr->lDAPDisplayName);
> >> - if (!rdn_name_upper) {
> >> - talloc_free(down_req);
> >> - ldb_oom(module->ldb);
> >> - return LDB_ERR_OPERATIONS_ERROR;
> >> - }
> >> - ret = ldb_dn_set_component(new_dn, 0, rdn_name_upper, *rdn_value);
> >> - if (ret != LDB_SUCCESS) {
> >> - talloc_free(down_req);
> >> - ldb_oom(module->ldb);
> >> - return LDB_ERR_OPERATIONS_ERROR;
> >> - }
> >> - msg->dn = new_dn;
> >> -
> >> - /*
> >> - * TODO: calculate correct instance type
> >> - */
> >> - instance_type = INSTANCE_TYPE_WRITE;
> >> - if (ldb_dn_compare(partition->dn, msg->dn) == 0) {
> >> - instance_type |= INSTANCE_TYPE_IS_NC_HEAD;
> >> - if (ldb_dn_compare(msg->dn, samdb_base_dn(module->ldb)) != 0) {
> >> - instance_type |= INSTANCE_TYPE_NC_ABOVE;
> >> - }
> >> - }
> >> -
> >> - /*
> >> * readd replicated attributes
> >> */
> >> - ret = ldb_msg_add_value(msg, rdn_attr->lDAPDisplayName, rdn_value, NULL);
> >> - if (ret != LDB_SUCCESS) {
> >> - talloc_free(down_req);
> >> - ldb_oom(module->ldb);
> >> - return LDB_ERR_OPERATIONS_ERROR;
> >> - }
> >> - ret = ldb_msg_add_value(msg, "name", rdn_value, NULL);
> >> - if (ret != LDB_SUCCESS) {
> >> - talloc_free(down_req);
> >> - ldb_oom(module->ldb);
> >> - return LDB_ERR_OPERATIONS_ERROR;
> >> - }
> >> ret = ldb_msg_add_string(msg, "whenCreated", time_str);
> >> if (ret != LDB_SUCCESS) {
> >> talloc_free(down_req);
> >> ldb_oom(module->ldb);
> >> return LDB_ERR_OPERATIONS_ERROR;
> >> }
> >> - ret = ldb_msg_add_fmt(msg, "instanceType", "%u", instance_type);
> >> - if (ret != LDB_SUCCESS) {
> >> - talloc_free(down_req);
> >> - ldb_oom(module->ldb);
> >> - return LDB_ERR_OPERATIONS_ERROR;
> >> - }
> >>
> >> /* build the replication meta_data */
> >> ZERO_STRUCT(nmd);
> >> @@ -598,8 +481,7 @@ static int replmd_add(struct ldb_module *module, struct ldb_request *req)
> >>
> >> static int replmd_modify_originating(struct ldb_module *module,
> >> struct ldb_request *req,
> >> - const struct dsdb_schema *schema,
> >> - const struct dsdb_control_current_partition *partition)
> >> + const struct dsdb_schema *schema)
> >> {
> >> struct ldb_request *down_req;
> >> struct ldb_message *msg;
> >> @@ -806,10 +688,16 @@ static int replmd_replicated_apply_add(struct replmd_replicated_request *ar)
> >> return ldb_next_request(ar->module, ar->sub.change_req);
> >> #else
> >> ret = ldb_next_request(ar->module, ar->sub.change_req);
> >> - if (ret != LDB_SUCCESS) return replmd_replicated_request_error(ar, ret);
> >> + if (ret != LDB_SUCCESS) {
> >> + ldb_asprintf_errstring(ar->module->ldb, "Failed to add replicated object %s: %s", ldb_dn_get_linearized(ar->sub.change_req->op.add.message->dn),
> >> + ldb_errstring(ar->module->ldb));
> >> + return replmd_replicated_request_error(ar, ret);
> >> + }
> >>
> >> - ar->sub.change_ret = ldb_wait(ar->sub.search_req->handle, LDB_WAIT_ALL);
> >> + ar->sub.change_ret = ldb_wait(ar->sub.change_req->handle, LDB_WAIT_ALL);
> >> if (ar->sub.change_ret != LDB_SUCCESS) {
> >> + ldb_asprintf_errstring(ar->module->ldb, "Failed while waiting on add replicated object %s: %s", ldb_dn_get_linearized(ar->sub.change_req->op.add.message->dn),
> >> + ldb_errstring(ar->module->ldb));
> >> return replmd_replicated_request_error(ar, ar->sub.change_ret);
> >> }
> >>
> >> @@ -1053,7 +941,7 @@ static int replmd_replicated_apply_merge(struct replmd_replicated_request *ar)
> >> ret = ldb_next_request(ar->module, ar->sub.change_req);
> >> if (ret != LDB_SUCCESS) return replmd_replicated_request_error(ar, ret);
> >>
> >> - ar->sub.change_ret = ldb_wait(ar->sub.search_req->handle, LDB_WAIT_ALL);
> >> + ar->sub.change_ret = ldb_wait(ar->sub.change_req->handle, LDB_WAIT_ALL);
> >> if (ar->sub.change_ret != LDB_SUCCESS) {
> >> return replmd_replicated_request_error(ar, ar->sub.change_ret);
> >> }
> >> @@ -1137,7 +1025,7 @@ static int replmd_replicated_apply_search(struct replmd_replicated_request *ar)
> >> if (ret != LDB_SUCCESS) return replmd_replicated_request_error(ar, ret);
> >>
> >> ar->sub.search_ret = ldb_wait(ar->sub.search_req->handle, LDB_WAIT_ALL);
> >> - if (ar->sub.search_ret != LDB_SUCCESS) {
> >> + if (ar->sub.search_ret != LDB_SUCCESS && ar->sub.search_ret != LDB_ERR_NO_SUCH_OBJECT) {
> >> return replmd_replicated_request_error(ar, ar->sub.search_ret);
> >> }
> >> if (ar->sub.search_msg) {
>
> The above looks ok.
>
> >> diff --git a/source/dsdb/schema/schema_syntax.c b/source/dsdb/schema/schema_syntax.c
> >> index 9bc51c6..2c133b6 100644
> >> --- a/source/dsdb/schema/schema_syntax.c
> >> +++ b/source/dsdb/schema/schema_syntax.c
> >> @@ -939,7 +939,7 @@ static WERROR dsdb_syntax_DN_BINARY_drsuapi_to_ldb(const struct dsdb_schema *sch
> >> }
> >>
> >> ndr_err = ndr_pull_struct_blob_all(in->value_ctr.values[i].blob,
> >> - out->values, NULL, &id3b,
> >> + out->values, lp_iconv_convenience(global_loadparm), &id3b,
> >> (ndr_pull_flags_fn_t)ndr_pull_drsuapi_DsReplicaObjectIdentifier3Binary);
> >> if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
> >> NTSTATUS status = ndr_map_error2ntstatus(ndr_err);
> >> @@ -997,7 +997,7 @@ static WERROR dsdb_syntax_DN_BINARY_ldb_to_drsuapi(const struct dsdb_schema *sch
> >> id3b.dn = (const char *)in->values[i].data;
> >> id3b.binary = data_blob(NULL, 0);
> >>
> >> - ndr_err = ndr_push_struct_blob(&blobs[i], blobs, NULL, &id3b,
> >> + ndr_err = ndr_push_struct_blob(&blobs[i], blobs, lp_iconv_convenience(global_loadparm), &id3b,
> >> (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3Binary);
> >> if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
> >> NTSTATUS status = ndr_map_error2ntstatus(ndr_err);
>
> Here also an extra commit.
>
> >> diff --git a/source/heimdal/lib/asn1/lex.c b/source/heimdal/lib/asn1/lex.c
> >> index 86c4359..6a3a49c 100644
> >> --- a/source/heimdal/lib/asn1/lex.c
> >> +++ b/source/heimdal/lib/asn1/lex.c
> >> @@ -1907,7 +1907,7 @@ static int yy_get_next_buffer (void)
> >>
> >> /* Read in more data. */
> >> YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
> >> - (yy_n_chars), (size_t) num_to_read );
> >> + (yy_n_chars), num_to_read );
> >>
> >> YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
> >> }
> >> @@ -2408,7 +2408,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
> >>
> >> /** Setup the input buffer state to scan a string. The next call to yylex() will
> >> * scan from a @e copy of @a str.
> >> - * @param yystr a NUL-terminated string to scan
> >> + * @param str a NUL-terminated string to scan
> >> *
> >> * @return the newly allocated buffer state object.
> >> * @note If you want to scan bytes that may contain NUL values, then use
>
> please skip this reformatting.
>
> >> diff --git a/source/lib/ldb/common/ldb.c b/source/lib/ldb/common/ldb.c
> >> index 87f791c..5601a33 100644
> >> --- a/source/lib/ldb/common/ldb.c
> >> +++ b/source/lib/ldb/common/ldb.c
> >> @@ -463,11 +463,17 @@ static int ldb_autotransaction_request(struct ldb_context *ldb, struct ldb_reque
> >>
> >> int ldb_wait(struct ldb_handle *handle, enum ldb_wait_type type)
> >> {
> >> + int ret;
> >> if (!handle) {
> >> return LDB_SUCCESS;
> >> }
> >>
> >> - return handle->module->ops->wait(handle, type);
> >> + ret = handle->module->ops->wait(handle, type);
> >> + if (!ldb_errstring(handle->module->ldb)) {
> >> + /* Set a default error string, to place the blame somewhere */
> >> + ldb_asprintf_errstring(handle->module->ldb, "error waiting on module %s: %s (%d)", handle->module->ops->name, ldb_strerror(ret), ret);
> >> + }
> >> + return ret;
> >> }
> >>
> >> /* set the specified timeout or, if timeout is 0 set the default timeout */
>
> also an extra commit please.
>
> >> diff --git a/source/libnet/libnet_become_dc.c b/source/libnet/libnet_become_dc.c
> >> index 862631f..c9185c7 100644
> >> --- a/source/libnet/libnet_become_dc.c
> >> +++ b/source/libnet/libnet_become_dc.c
> >> @@ -1514,10 +1514,10 @@ static void becomeDC_drsuapi_connect_send(struct libnet_BecomeDC_state *s,
> >>
> >> if (!drsuapi->binding) {
> >> if (lp_parm_bool(s->libnet->lp_ctx, NULL, "become_dc", "print", false)) {
> >> - binding_str = talloc_asprintf(s, "ncacn_ip_tcp:%s[krb5,print,seal]", s->source_dsa.dns_name);
> >> + binding_str = talloc_asprintf(s, "ncacn_ip_tcp:%s[print,seal]", s->source_dsa.dns_name);
> >> if (composite_nomem(binding_str, c)) return;
> >> } else {
> >> - binding_str = talloc_asprintf(s, "ncacn_ip_tcp:%s[krb5,seal]", s->source_dsa.dns_name);
> >> + binding_str = talloc_asprintf(s, "ncacn_ip_tcp:%s[seal]", s->source_dsa.dns_name);
> >> if (composite_nomem(binding_str, c)) return;
> >> }
> >> c->status = dcerpc_parse_binding(s, binding_str, &drsuapi->binding);
>
> Is this change really needed?
> We should really use krb5.
>
> >> @@ -1687,6 +1687,7 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s)
> >> struct drsuapi_DsReplicaObjectIdentifier *identifier;
> >> uint32_t num_attrs, i = 0;
> >> struct drsuapi_DsReplicaAttribute *attrs;
> >> + struct smb_iconv_convenience *iconv_convenience = lp_iconv_convenience(s->libnet->lp_ctx);
> >> enum ndr_err_code ndr_err;
> >> bool w2k3;
> >>
> >> @@ -1785,7 +1786,7 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s)
> >> NULL);
> >> if (composite_nomem(v, c)) return;
> >>
> >> - ndr_err = ndr_push_struct_blob(&vd[0], vd, NULL, v,(ndr_push_flags_fn_t)ndr_push_security_descriptor);
> >> + ndr_err = ndr_push_struct_blob(&vd[0], vd, iconv_convenience, v,(ndr_push_flags_fn_t)ndr_push_security_descriptor);
> >> if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
> >> c->status = ndr_map_error2ntstatus(ndr_err);
> >> if (!composite_is_ok(c)) return;
> >> @@ -1844,7 +1845,7 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s)
> >> s->forest.schema_dn_str);
> >> if (composite_nomem(v[0].dn, c)) return;
> >>
> >> - ndr_err = ndr_push_struct_blob(&vd[0], vd, NULL, &v[0],
> >> + ndr_err = ndr_push_struct_blob(&vd[0], vd, iconv_convenience, &v[0],
> >> (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3);
> >> if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
> >> c->status = ndr_map_error2ntstatus(ndr_err);
> >> @@ -1874,7 +1875,7 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s)
> >>
> >> v = &s->dest_dsa.invocation_id;
> >>
> >> - ndr_err = ndr_push_struct_blob(&vd[0], vd, NULL, v, (ndr_push_flags_fn_t)ndr_push_GUID);
> >> + ndr_err = ndr_push_struct_blob(&vd[0], vd, iconv_convenience, v, (ndr_push_flags_fn_t)ndr_push_GUID);
> >> if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
> >> c->status = ndr_map_error2ntstatus(ndr_err);
> >> if (!composite_is_ok(c)) return;
> >> @@ -1913,21 +1914,21 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s)
> >> v[2].sid = s->zero_sid;
> >> v[2].dn = s->forest.schema_dn_str;
> >>
> >> - ndr_err = ndr_push_struct_blob(&vd[0], vd, NULL, &v[0],
> >> + ndr_err = ndr_push_struct_blob(&vd[0], vd, iconv_convenience, &v[0],
> >> (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3);
> >> if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
> >> c->status = ndr_map_error2ntstatus(ndr_err);
> >> if (!composite_is_ok(c)) return;
> >> }
> >>
> >> - ndr_err = ndr_push_struct_blob(&vd[1], vd, NULL, &v[1],
> >> + ndr_err = ndr_push_struct_blob(&vd[1], vd, iconv_convenience, &v[1],
> >> (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3);
> >> if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
> >> c->status = ndr_map_error2ntstatus(ndr_err);
> >> if (!composite_is_ok(c)) return;
> >> }
> >>
> >> - ndr_err = ndr_push_struct_blob(&vd[2], vd, NULL, &v[2],
> >> + ndr_err = ndr_push_struct_blob(&vd[2], vd, iconv_convenience, &v[2],
> >> (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3);
> >> if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
> >> c->status = ndr_map_error2ntstatus(ndr_err);
> >> @@ -1969,21 +1970,21 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s)
> >> v[2].sid = s->zero_sid;
> >> v[2].dn = s->forest.schema_dn_str;
> >>
> >> - ndr_err = ndr_push_struct_blob(&vd[0], vd, NULL, &v[0],
> >> + ndr_err = ndr_push_struct_blob(&vd[0], vd, iconv_convenience, &v[0],
> >> (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3);
> >> if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
> >> c->status = ndr_map_error2ntstatus(ndr_err);
> >> if (!composite_is_ok(c)) return;
> >> }
> >>
> >> - ndr_err = ndr_push_struct_blob(&vd[1], vd, NULL, &v[1],
> >> + ndr_err = ndr_push_struct_blob(&vd[1], vd, iconv_convenience, &v[1],
> >> (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3);
> >> if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
> >> c->status = ndr_map_error2ntstatus(ndr_err);
> >> if (!composite_is_ok(c)) return;
> >> }
> >>
> >> - ndr_err = ndr_push_struct_blob(&vd[2], vd, NULL, &v[2],
> >> + ndr_err = ndr_push_struct_blob(&vd[2], vd, iconv_convenience, &v[2],
> >> (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3);
> >> if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
> >> c->status = ndr_map_error2ntstatus(ndr_err);
> >> @@ -2017,7 +2018,7 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s)
> >> v[0].sid = s->zero_sid;
> >> v[0].dn = s->forest.schema_dn_str;
> >>
> >> - ndr_err = ndr_push_struct_blob(&vd[0], vd, NULL, &v[0],
> >> + ndr_err = ndr_push_struct_blob(&vd[0], vd, iconv_convenience, &v[0],
> >> (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3);
> >> if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
> >> c->status = ndr_map_error2ntstatus(ndr_err);
> >> @@ -2049,7 +2050,7 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s)
> >> v[0].sid = s->zero_sid;
> >> v[0].dn = s->domain.dn_str;
> >>
> >> - ndr_err = ndr_push_struct_blob(&vd[0], vd, NULL, &v[0],
> >> + ndr_err = ndr_push_struct_blob(&vd[0], vd, iconv_convenience, &v[0],
> >> (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3);
> >> if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
> >> c->status = ndr_map_error2ntstatus(ndr_err);
> >> @@ -2131,7 +2132,7 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s)
> >> v[0].sid = s->zero_sid;
> >> v[0].dn = s->dest_dsa.computer_dn_str;
> >>
> >> - ndr_err = ndr_push_struct_blob(&vd[0], vd, NULL, &v[0],
> >> + ndr_err = ndr_push_struct_blob(&vd[0], vd, iconv_convenience, &v[0],
> >> (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3);
> >> if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
> >> c->status = ndr_map_error2ntstatus(ndr_err);
>
> This should also be its own commit.
>
> >> diff --git a/source/selftest/target/Samba4.pm b/source/selftest/target/Samba4.pm
> >> index 87a86ef..4a827cc 100644
> >> --- a/source/selftest/target/Samba4.pm
> >> +++ b/source/selftest/target/Samba4.pm
> >> @@ -670,7 +670,7 @@ nogroup:x:65534:nobody
> >> push (@provision_options, split(' ', $configuration));
> >> push (@provision_options, "--host-name=$netbiosname");
> >> push (@provision_options, "--host-ip=$ifaceipv4");
> >> - push (@provision_options, "--quiet");
> >> +# push (@provision_options, "--quiet");
> >> push (@provision_options, "--domain=$domain");
> >> push (@provision_options, "--realm=$realm");
> >> push (@provision_options, "--adminpass=$password");
>
> please remove this.
>
> >> diff --git a/source/torture/libnet/libnet_BecomeDC.c b/source/torture/libnet/libnet_BecomeDC.c
> >> index 10625b2..932498a 100644
> >> --- a/source/torture/libnet/libnet_BecomeDC.c
> >> +++ b/source/torture/libnet/libnet_BecomeDC.c
> >> @@ -60,7 +60,9 @@ struct test_become_dc_state {
> >> const char *configdn_ldb;
> >> const char *schemadn_ldb;
> >> const char *secrets_ldb;
> >> + const char *templates_ldb;
> >> const char *secrets_keytab;
> >> + const char *dns_keytab;
> >> } path;
> >> };
> >>
> >> @@ -195,25 +197,13 @@ static NTSTATUS test_become_dc_prepare_db(void *private_data,
> >> "subobj.SCHEMADN = \"%s\";\n"
> >> "subobj.SCHEMADN_LDB = \"%s\";\n"
> >> "subobj.HOSTNAME = \"%s\";\n"
> >> - "subobj.DNSNAME = \"%s\";\n"
> >> + "subobj.REALM = \"%s\";\n"
> >> + "subobj.DOMAIN = \"%s\";\n"
> >> "subobj.DEFAULTSITE = \"%s\";\n"
> >> "\n"
> >> - "modules_list = new Array(\"rootdse\",\n"
> >> - " \"kludge_acl\",\n"
> >> - " \"paged_results\",\n"
> >> - " \"server_sort\",\n"
> >> - " \"extended_dn\",\n"
> >> - " \"asq\",\n"
> >> - " \"samldb\",\n"
> >> - " \"operational\",\n"
> >> - " \"objectclass\",\n"
> >> - " \"rdn_name\",\n"
> >> - " \"show_deleted\",\n"
> >> - " \"partition\");\n"
> >> - "subobj.MODULES_LIST = join(\",\", modules_list);\n"
> >> - "subobj.DOMAINDN_MOD = \"pdc_fsmo,password_hash,repl_meta_data\";\n"
> >> - "subobj.CONFIGDN_MOD = \"naming_fsmo,repl_meta_data\";\n"
> >> - "subobj.SCHEMADN_MOD = \"schema_fsmo,repl_meta_data\";\n"
> >> + "subobj.DOMAINDN_MOD2 = \",repl_meta_data\";\n"
> >> + "subobj.CONFIGDN_MOD2 = \",repl_meta_data\";\n"
> >> + "subobj.SCHEMADN_MOD2 = \",repl_meta_data\";\n"
> >> "\n"
> >> "subobj.KRBTGTPASS = \"_NOT_USED_\";\n"
> >> "subobj.MACHINEPASS = \"%s\";\n"
> >> @@ -222,7 +212,9 @@ static NTSTATUS test_become_dc_prepare_db(void *private_data,
> >> "var paths = provision_default_paths(subobj);\n"
> >> "paths.samdb = \"%s\";\n"
> >> "paths.secrets = \"%s\";\n"
> >> + "paths.templates = \"%s\";\n"
> >> "paths.keytab = \"%s\";\n"
> >> + "paths.dns_keytab = \"%s\";\n"
> >> "\n"
> >> "var system_session = system_session();\n"
> >> "\n"
> >> @@ -238,12 +230,15 @@ static NTSTATUS test_become_dc_prepare_db(void *private_data,
> >> p->forest->schema_dn_str, /* subobj.SCHEMADN */
> >> s->path.schemadn_ldb, /* subobj.SCHEMADN_LDB */
> >> p->dest_dsa->netbios_name, /* subobj.HOSTNAME */
> >> - p->dest_dsa->dns_name, /* subobj.DNSNAME */
> >> + torture_join_dom_dns_name(s->tj),/* subobj.REALM */
> >> + torture_join_dom_netbios_name(s->tj),/* subobj.DOMAIN */
> >> p->dest_dsa->site_name, /* subobj.DEFAULTSITE */
> >> cli_credentials_get_password(s->machine_account),/* subobj.MACHINEPASS */
> >> s->path.samdb_ldb, /* paths.samdb */
> >> + s->path.templates_ldb, /* paths.templates */
> >> s->path.secrets_ldb, /* paths.secrets */
> >> - s->path.secrets_keytab); /* paths.keytab */
> >> + s->path.secrets_keytab, /* paths.keytab */
> >> + s->path.dns_keytab); /* paths.dns_keytab */
> >> NT_STATUS_HAVE_NO_MEMORY(ejs);
> >>
> >> ret = test_run_ejs(ejs);
> >> @@ -854,8 +849,12 @@ bool torture_net_become_dc(struct torture_context *torture)
> >> if (!s->path.schemadn_ldb) return false;
> >> s->path.secrets_ldb = talloc_asprintf(s, "%s_secrets.ldb", s->netbios_name);
> >> if (!s->path.secrets_ldb) return false;
> >> + s->path.templates_ldb = talloc_asprintf(s, "%s_templates.ldb", s->netbios_name);
> >> + if (!s->path.templates_ldb) return false;
> >> s->path.secrets_keytab = talloc_asprintf(s, "%s_secrets.keytab", s->netbios_name);
> >> if (!s->path.secrets_keytab) return false;
> >> + s->path.dns_keytab = talloc_asprintf(s, "%s_dns.keytab", s->netbios_name);
> >> + if (!s->path.dns_keytab) return false;
> >>
> >> /* Join domain as a member server. */
> >> s->tj = torture_join_domain(torture, s->netbios_name,
>
> The rest looks also good.
>
--
Andrew Bartlett
http://samba.org/~abartlet/
Authentication Developer, Samba Team http://samba.org
Samba Developer, Red Hat Inc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20080122/e5e5cc0d/attachment.bin
More information about the samba-technical
mailing list