summaryrefslogtreecommitdiff
path: root/source4/libnet/libnet_samdump_keytab.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-01-12 09:33:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:50:55 -0500
commita5a79e8b8cbdf24d5c2db45ece4110ed5d85e58f (patch)
tree71b27ab4d11e2fc537b0ccf5d4e9c75dcc9757eb /source4/libnet/libnet_samdump_keytab.c
parent4c6b9c79ff5d35e1d03ad5eb543db4b6b906b5ce (diff)
downloadsamba-a5a79e8b8cbdf24d5c2db45ece4110ed5d85e58f.tar.gz
samba-a5a79e8b8cbdf24d5c2db45ece4110ed5d85e58f.tar.bz2
samba-a5a79e8b8cbdf24d5c2db45ece4110ed5d85e58f.zip
r12865: Upgrade the librpc and libnet code.
In librpc, always try SMB level authentication, even if trying schannel, but allow fallback to anonymous. This should better function with servers that set restrict anonymous. There are too many parts of Samba that get, parse and modify the binding parameters. Avoid the extra work, and add a binding element to the struct dcerpc_pipe The libnet vampire code has been refactored, to reduce extra layers and to better conform with the standard argument pattern. Also, take advantage of the new libnet_Lookup code, so we don't require the silly 'password server' smb.conf parameter. To better support forcing traffic to be sealed for the vampire operation, the dcerpc_bind_auth() function now takes an auth level parameter. Andrew Bartlett (This used to be commit d65b354959842326fdd4bd7eb7fbeea0390f4afa)
Diffstat (limited to 'source4/libnet/libnet_samdump_keytab.c')
-rw-r--r--source4/libnet/libnet_samdump_keytab.c42
1 files changed, 8 insertions, 34 deletions
diff --git a/source4/libnet/libnet_samdump_keytab.c b/source4/libnet/libnet_samdump_keytab.c
index e267cfdc2e..f16e0ae383 100644
--- a/source4/libnet/libnet_samdump_keytab.c
+++ b/source4/libnet/libnet_samdump_keytab.c
@@ -94,17 +94,18 @@ static NTSTATUS libnet_samdump_keytab_fn(TALLOC_CTX *mem_ctx,
return nt_status;
}
-static NTSTATUS libnet_SamDump_keytab_netlogon(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, struct libnet_SamDump_keytab *r)
+NTSTATUS libnet_SamDump_keytab(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, struct libnet_SamDump_keytab *r)
{
NTSTATUS nt_status;
struct libnet_SamSync r2;
- r2.error_string = NULL;
- r2.delta_fn = libnet_samdump_keytab_fn;
- r2.fn_ctx = r->keytab_name;
- r2.machine_account = NULL; /* TODO: Create a machine account, fill this in, and the delete it */
- nt_status = libnet_SamSync_netlogon(ctx, mem_ctx, &r2);
- r->error_string = r2.error_string;
+ r2.out.error_string = NULL;
+ r2.in.binding_string = r->in.binding_string;
+ r2.in.delta_fn = libnet_samdump_keytab_fn;
+ r2.in.fn_ctx = discard_const(r->in.keytab_name);
+ 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;
if (!NT_STATUS_IS_OK(nt_status)) {
return nt_status;
@@ -112,30 +113,3 @@ static NTSTATUS libnet_SamDump_keytab_netlogon(struct libnet_context *ctx, TALLO
return nt_status;
}
-
-
-
-static NTSTATUS libnet_SamDump_keytab_generic(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, struct libnet_SamDump_keytab *r)
-{
- NTSTATUS nt_status;
- struct libnet_SamDump_keytab r2;
- r2.level = LIBNET_SAMDUMP_NETLOGON;
- r2.error_string = NULL;
- r2.keytab_name = r->keytab_name;
- nt_status = libnet_SamDump_keytab(ctx, mem_ctx, &r2);
- r->error_string = r2.error_string;
-
- return nt_status;
-}
-
-NTSTATUS libnet_SamDump_keytab(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, struct libnet_SamDump_keytab *r)
-{
- switch (r->level) {
- case LIBNET_SAMDUMP_GENERIC:
- return libnet_SamDump_keytab_generic(ctx, mem_ctx, r);
- case LIBNET_SAMDUMP_NETLOGON:
- return libnet_SamDump_keytab_netlogon(ctx, mem_ctx, r);
- }
-
- return NT_STATUS_INVALID_LEVEL;
-}