summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-12-02 10:08:26 +0000
committerAndrew Tridgell <tridge@samba.org>2003-12-02 10:08:26 +0000
commit02df116352778c2bd1fd4053e7f183215216da2f (patch)
tree49eb4815da339b7b0c86758a3bc7e66d6d897e44
parent16c688c9eaa7f4124553872e9d30273c2507df87 (diff)
downloadsamba-02df116352778c2bd1fd4053e7f183215216da2f.tar.gz
samba-02df116352778c2bd1fd4053e7f183215216da2f.tar.bz2
samba-02df116352778c2bd1fd4053e7f183215216da2f.zip
added netr_GetDcName() - quite a useful call
(This used to be commit 63f46b223e16a3495b4a4a48c6489f1f0d7d84c4)
-rw-r--r--source4/librpc/idl/netlogon.idl11
-rw-r--r--source4/torture/rpc/netlogon.c35
2 files changed, 36 insertions, 10 deletions
diff --git a/source4/librpc/idl/netlogon.idl b/source4/librpc/idl/netlogon.idl
index 16f699129e..2c18edac30 100644
--- a/source4/librpc/idl/netlogon.idl
+++ b/source4/librpc/idl/netlogon.idl
@@ -652,16 +652,17 @@ interface netlogon
[in,out] netr_UAS_INFO_0 recordid
);
-#if 0
/*****************/
/* Function 0x0B */
NTSTATUS netr_GetDcName(
- [in] unistr logon_server,
- [in] unistr *domainname,
- [out]unistr *dcname,
- };
+ [in] unistr logon_server,
+ [in] unistr *domainname,
+ [out] unistr *dcname
+ );
+
+#if 0
typedef struct {
uint32 flags;
diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c
index 89f1a0132b..a38990bdc1 100644
--- a/source4/torture/rpc/netlogon.c
+++ b/source4/torture/rpc/netlogon.c
@@ -428,6 +428,28 @@ static BOOL test_AccountSync(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
return ret;
}
+/*
+ try a netlogon GetDcName
+*/
+static BOOL test_GetDcName(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
+{
+ NTSTATUS status;
+ struct netr_GetDcName r;
+
+ r.in.logon_server = talloc_asprintf(mem_ctx, "\\\\%s", dcerpc_server_name(p));
+ r.in.domainname = lp_workgroup();
+
+ printf("Testing GetDcName\n");
+
+ status = dcerpc_netr_GetDcName(p, mem_ctx, &r);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("GetDcName - %s\n", nt_errstr(status));
+ return False;
+ }
+
+ return True;
+}
+
BOOL torture_rpc_netlogon(int dummy)
{
@@ -448,11 +470,6 @@ BOOL torture_rpc_netlogon(int dummy)
p->flags |= DCERPC_DEBUG_PRINT_BOTH;
- if (!test_AccountSync(p, mem_ctx)) {
- ret = False;
- }
- return ret;
-
if (!test_LogonUasLogon(p, mem_ctx)) {
ret = False;
}
@@ -481,6 +498,14 @@ BOOL torture_rpc_netlogon(int dummy)
ret = False;
}
+ if (!test_AccountSync(p, mem_ctx)) {
+ ret = False;
+ }
+
+ if (!test_GetDcName(p, mem_ctx)) {
+ ret = False;
+ }
+
torture_rpc_close(p);
return ret;