summaryrefslogtreecommitdiff
path: root/source4/libnet
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-12-20 15:34:32 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:29:31 -0500
commit4973fbe7732e93a9be989bbafc24b1e3d848ed08 (patch)
tree225a1ed2d8225c7efdae696f09bd2279c1361afc /source4/libnet
parentceaf036f42f20e8acbf0ca3cdbb599f7aeb4653c (diff)
downloadsamba-4973fbe7732e93a9be989bbafc24b1e3d848ed08.tar.gz
samba-4973fbe7732e93a9be989bbafc24b1e3d848ed08.tar.bz2
samba-4973fbe7732e93a9be989bbafc24b1e3d848ed08.zip
r20283: pass in callbacks to libnet_BecomeDC() from the caller
and implement the check_options call metze (This used to be commit fc9669e2a081a614599f7cdce1e031e8a8134c67)
Diffstat (limited to 'source4/libnet')
-rw-r--r--source4/libnet/libnet_become_dc.c21
-rw-r--r--source4/libnet/libnet_become_dc.h18
2 files changed, 24 insertions, 15 deletions
diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c
index acd3238089..677cfb7cd3 100644
--- a/source4/libnet/libnet_become_dc.c
+++ b/source4/libnet/libnet_become_dc.c
@@ -107,12 +107,7 @@ struct libnet_BecomeDC_state {
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 libnet_BecomeDC_state {
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 @@ static NTSTATUS becomeDC_check_options(struct libnet_BecomeDC_state *s)
{
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 @@ struct composite_context *libnet_BecomeDC_send(struct libnet_context *ctx, TALLO
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;
}
diff --git a/source4/libnet/libnet_become_dc.h b/source4/libnet/libnet_become_dc.h
index 4093026875..3803dad94b 100644
--- a/source4/libnet/libnet_become_dc.h
+++ b/source4/libnet/libnet_become_dc.h
@@ -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 @@ struct libnet_BecomeDC {
const struct dom_sid *domain_sid;
const char *source_dsa_address;
const char *dest_dsa_netbios_name;
+
+ struct libnet_BecomeDC_Callbacks callbacks;
} in;
struct {