summaryrefslogtreecommitdiff
path: root/source4/libnet/libnet_samdump_keytab.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-10-21 14:51:13 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-10-21 14:51:13 +0200
commit5209a846a9157e649fcdcb561f7eaf19c8c0e465 (patch)
treeb0a7e52b5646c8eec182dbc391e7934b6804488c /source4/libnet/libnet_samdump_keytab.c
parent625359b2e266105022309df8985720108ecd6f67 (diff)
parent2ee8d29d22bcb1c350ab59d71b0aee548489bc9c (diff)
downloadsamba-5209a846a9157e649fcdcb561f7eaf19c8c0e465.tar.gz
samba-5209a846a9157e649fcdcb561f7eaf19c8c0e465.tar.bz2
samba-5209a846a9157e649fcdcb561f7eaf19c8c0e465.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba into regsrv
Conflicts: source4/lib/registry/ldb.c source4/rpc_server/winreg/rpc_winreg.c
Diffstat (limited to 'source4/libnet/libnet_samdump_keytab.c')
-rw-r--r--source4/libnet/libnet_samdump_keytab.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/source4/libnet/libnet_samdump_keytab.c b/source4/libnet/libnet_samdump_keytab.c
index 0c4d3e5c59..4b71b0c24d 100644
--- a/source4/libnet/libnet_samdump_keytab.c
+++ b/source4/libnet/libnet_samdump_keytab.c
@@ -68,6 +68,11 @@ static NTSTATUS samdump_keytab_handle_user(TALLOC_CTX *mem_ctx,
return NT_STATUS_OK;
}
+struct libnet_samdump_keytab_data {
+ const char *keytab_name;
+ struct loadparm_context *lp_ctx;
+};
+
static NTSTATUS libnet_samdump_keytab_fn(TALLOC_CTX *mem_ctx,
void *private,
enum netr_SamDatabaseID database,
@@ -75,8 +80,7 @@ static NTSTATUS libnet_samdump_keytab_fn(TALLOC_CTX *mem_ctx,
char **error_string)
{
NTSTATUS nt_status = NT_STATUS_OK;
- const char *keytab_name = private;
-
+ struct libnet_samdump_keytab_data *data = private;
*error_string = NULL;
switch (delta->delta_type) {
case NETR_DELTA_USER:
@@ -85,8 +89,8 @@ static NTSTATUS libnet_samdump_keytab_fn(TALLOC_CTX *mem_ctx,
if (database == SAM_DATABASE_DOMAIN) {
nt_status = samdump_keytab_handle_user(mem_ctx,
event_context_find(mem_ctx),
- global_loadparm,
- keytab_name,
+ data->lp_ctx,
+ data->keytab_name,
delta);
break;
}
@@ -101,14 +105,18 @@ static NTSTATUS libnet_samdump_keytab_fn(TALLOC_CTX *mem_ctx,
NTSTATUS libnet_SamDump_keytab(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, struct libnet_SamDump_keytab *r)
{
NTSTATUS nt_status;
+ struct libnet_samdump_keytab_data data;
struct libnet_SamSync r2;
+ data.keytab_name = r->in.keytab_name;
+ data.lp_ctx = ctx->lp_ctx;
+
r2.out.error_string = NULL;
r2.in.binding_string = r->in.binding_string;
r2.in.rid_crypt = true;
r2.in.init_fn = NULL;
r2.in.delta_fn = libnet_samdump_keytab_fn;
- r2.in.fn_ctx = discard_const(r->in.keytab_name);
+ r2.in.fn_ctx = &data;
r2.in.machine_account = r->in.machine_account;
nt_status = libnet_SamSync_netlogon(ctx, mem_ctx, &r2);
r->out.error_string = r2.out.error_string;