diff options
author | Rafal Szczesniak <mimir@samba.org> | 2006-05-04 14:54:31 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:05:36 -0500 |
commit | a3898df957f0aac183c16d0d613d965a70c1a49c (patch) | |
tree | 599c33eee86fd74a719aca5ec920de2a8d7d9c09 | |
parent | 538adbf677d225da8abc2adaefafa2a7c305ec17 (diff) | |
download | samba-a3898df957f0aac183c16d0d613d965a70c1a49c.tar.gz samba-a3898df957f0aac183c16d0d613d965a70c1a49c.tar.bz2 samba-a3898df957f0aac183c16d0d613d965a70c1a49c.zip |
r15436: Add test for LIBNET_RPC_CONNECT_DC_INFO level. Display received
information.
rafal
(This used to be commit 76d965b0b04496ae959ba6f13d748c6dfb858591)
-rw-r--r-- | source4/torture/libnet/libnet_rpc.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/source4/torture/libnet/libnet_rpc.c b/source4/torture/libnet/libnet_rpc.c index 723a2fd40b..b7d94813a6 100644 --- a/source4/torture/libnet/libnet_rpc.c +++ b/source4/torture/libnet/libnet_rpc.c @@ -22,6 +22,8 @@ #include "includes.h" #include "lib/cmdline/popt_common.h" #include "libnet/libnet.h" +#include "libcli/security/security.h" +#include "librpc/ndr/libndr.h" #include "librpc/gen_ndr/ndr_lsa.h" #include "librpc/gen_ndr/ndr_samr.h" #include "librpc/rpc/dcerpc.h" @@ -50,6 +52,34 @@ static BOOL test_lsa_connect(struct libnet_context *ctx) } +static BOOL test_lsa_dcinfo_connect(struct libnet_context *ctx) +{ + NTSTATUS status; + struct libnet_RpcConnect connect; + connect.level = LIBNET_RPC_CONNECT_DC_INFO; + connect.in.binding = lp_parm_string(-1, "torture", "binding"); + connect.in.dcerpc_iface = &dcerpc_table_lsarpc; + + status = libnet_RpcConnect(ctx, ctx, &connect); + + if (!NT_STATUS_IS_OK(status)) { + printf("Couldn't connect to rpc service %s on %s: %s\n", + connect.in.dcerpc_iface->name, connect.in.binding, + nt_errstr(status)); + + return False; + } + + printf("Domain Controller Info:\n"); + printf("\tDomain Name:\t %s\n", connect.out.domain_name); + printf("\tDomain SID:\t %s\n", dom_sid_string(ctx, connect.out.domain_sid)); + printf("\tRealm:\t\t %s\n", connect.out.realm); + printf("\tGUID:\t\t %s\n", GUID_string(ctx, connect.out.guid)); + + return True; +} + + static BOOL test_samr_connect(struct libnet_context *ctx) { NTSTATUS status; @@ -84,6 +114,12 @@ BOOL torture_rpc_connect(struct torture_context *torture) return False; } + printf("Testing connection with domain info to lsarpc interface\n"); + if (!test_lsa_dcinfo_connect(ctx)) { + printf("failed to connect lsarpc interface\n"); + return False; + } + printf("Testing connection to SAMR service\n"); if (!test_samr_connect(ctx)) { printf("failed to connect samr interface\n"); |