svn commit: samba r20283 - in branches/SAMBA_4_0/source: libnet
torture/libnet
metze at samba.org
metze at samba.org
Wed Dec 20 15:34:32 GMT 2006
Author: metze
Date: 2006-12-20 15:34:32 +0000 (Wed, 20 Dec 2006)
New Revision: 20283
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20283
Log:
pass in callbacks to libnet_BecomeDC() from the caller
and implement the check_options call
metze
Modified:
branches/SAMBA_4_0/source/libnet/libnet_become_dc.c
branches/SAMBA_4_0/source/libnet/libnet_become_dc.h
branches/SAMBA_4_0/source/torture/libnet/libnet_BecomeDC.c
Changeset:
Modified: branches/SAMBA_4_0/source/libnet/libnet_become_dc.c
===================================================================
--- branches/SAMBA_4_0/source/libnet/libnet_become_dc.c 2006-12-20 14:49:40 UTC (rev 20282)
+++ branches/SAMBA_4_0/source/libnet/libnet_become_dc.c 2006-12-20 15:34:32 UTC (rev 20283)
@@ -107,12 +107,7 @@
uint32_t user_account_control;
} dest_dsa;
- struct {
- uint32_t domain_behavior_version;
- uint32_t config_behavior_version;
- uint32_t schema_object_version;
- uint32_t w2k3_update_revision;
- } ads_options;
+ struct libnet_BecomeDC_Options ads_options;
struct becomeDC_partition {
struct drsuapi_DsReplicaObjectIdentifier nc;
@@ -138,14 +133,7 @@
struct becomeDC_fsmo rid_manager_fsmo;
- struct {
- void *private_data;
- NTSTATUS (*check_options)(void *private_data, void *todo);
- NTSTATUS (*prepare_db)(void *private_data, void *todo);
- NTSTATUS (*schema_chunk)(void *private_data, void *todo);
- NTSTATUS (*config_chunk)(void *private_data, void *todo);
- NTSTATUS (*domain_chunk)(void *private_data, void *todo);
- } callbacks;
+ struct libnet_BecomeDC_Callbacks callbacks;
};
static void becomeDC_connect_ldap1(struct libnet_BecomeDC_state *s);
@@ -613,7 +601,7 @@
{
if (!s->callbacks.check_options) return NT_STATUS_OK;
- return s->callbacks.check_options(s->callbacks.private_data, NULL);
+ return s->callbacks.check_options(s->callbacks.private_data, &s->ads_options);
}
static NTSTATUS becomeDC_ldap1_computer_object(struct libnet_BecomeDC_state *s)
@@ -2153,6 +2141,9 @@
s->domain.dns_name);
if (composite_nomem(s->dest_dsa.dns_name, c)) return c;
+ /* Callback function pointers */
+ s->callbacks = r->in.callbacks;
+
becomeDC_send_cldap(s);
return c;
}
Modified: branches/SAMBA_4_0/source/libnet/libnet_become_dc.h
===================================================================
--- branches/SAMBA_4_0/source/libnet/libnet_become_dc.h 2006-12-20 14:49:40 UTC (rev 20282)
+++ branches/SAMBA_4_0/source/libnet/libnet_become_dc.h 2006-12-20 15:34:32 UTC (rev 20283)
@@ -18,6 +18,22 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+struct libnet_BecomeDC_Options {
+ uint32_t domain_behavior_version;
+ uint32_t config_behavior_version;
+ uint32_t schema_object_version;
+ uint32_t w2k3_update_revision;
+};
+
+struct libnet_BecomeDC_Callbacks {
+ void *private_data;
+ NTSTATUS (*check_options)(void *private_data, const struct libnet_BecomeDC_Options *options);
+ NTSTATUS (*prepare_db)(void *private_data, void *todo);
+ NTSTATUS (*schema_chunk)(void *private_data, void *todo);
+ NTSTATUS (*config_chunk)(void *private_data, void *todo);
+ NTSTATUS (*domain_chunk)(void *private_data, void *todo);
+};
+
struct libnet_BecomeDC {
struct {
const char *domain_dns_name;
@@ -25,6 +41,8 @@
const struct dom_sid *domain_sid;
const char *source_dsa_address;
const char *dest_dsa_netbios_name;
+
+ struct libnet_BecomeDC_Callbacks callbacks;
} in;
struct {
Modified: branches/SAMBA_4_0/source/torture/libnet/libnet_BecomeDC.c
===================================================================
--- branches/SAMBA_4_0/source/torture/libnet/libnet_BecomeDC.c 2006-12-20 14:49:40 UTC (rev 20282)
+++ branches/SAMBA_4_0/source/torture/libnet/libnet_BecomeDC.c 2006-12-20 15:34:32 UTC (rev 20283)
@@ -29,6 +29,18 @@
#define TORTURE_NETBIOS_NAME "smbtorturedc"
+static NTSTATUS test_become_dc_chec_options(void *private_data,
+ const struct libnet_BecomeDC_Options *options)
+{
+ DEBUG(0,("Options: domain[%u] config[%u] schema[%u] w2k3_update[%u]\n",
+ options->domain_behavior_version,
+ options->config_behavior_version,
+ options->schema_object_version,
+ options->w2k3_update_revision));
+
+ return NT_STATUS_OK;
+}
+
BOOL torture_net_become_dc(struct torture_context *torture)
{
BOOL ret = True;
@@ -52,18 +64,22 @@
ctx = libnet_context_init(event_context_init(torture));
ctx->cred = cmdline_credentials;
+ ZERO_STRUCT(b);
b.in.domain_dns_name = torture_join_dom_dns_name(tj);
b.in.domain_netbios_name = torture_join_dom_netbios_name(tj);
b.in.domain_sid = torture_join_sid(tj);
b.in.source_dsa_address = lp_parm_string(-1, "torture", "host");
b.in.dest_dsa_netbios_name = TORTURE_NETBIOS_NAME;
+ b.in.callbacks.check_options = test_become_dc_chec_options;
+
status = libnet_BecomeDC(ctx, ctx, &b);
if (!NT_STATUS_IS_OK(status)) {
printf("libnet_BecomeDC() failed - %s\n", nt_errstr(status));
ret = False;
}
+ ZERO_STRUCT(u);
u.in.domain_dns_name = torture_join_dom_dns_name(tj);
u.in.domain_netbios_name = torture_join_dom_netbios_name(tj);
u.in.source_dsa_address = lp_parm_string(-1, "torture", "host");
More information about the samba-cvs
mailing list