summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-11-18 22:26:13 +0100
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-11-19 12:50:32 +0100
commitd0993e1278a9245fa4e5952c779cabc2e41cd3c7 (patch)
tree9661a32acf61095e8650b58e67803dc07d460a45 /source4/torture
parent3874331edb9a7bb0ff85104ffc4a5cc92bd87523 (diff)
downloadsamba-d0993e1278a9245fa4e5952c779cabc2e41cd3c7.tar.gz
samba-d0993e1278a9245fa4e5952c779cabc2e41cd3c7.tar.bz2
samba-d0993e1278a9245fa4e5952c779cabc2e41cd3c7.zip
s4:netlogon/LogonGetDomainInfo - handle a NULL "dns_hostname"
- Performs the short computer name check against the sam account name. - Enhances the LogonGetDomainInfo testsuite which checks the NULL "dns_hostname" behaviour Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Fri Nov 19 12:50:33 CET 2010 on sn-devel-104
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/netlogon.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c
index 9758185046..b1739a015c 100644
--- a/source4/torture/rpc/netlogon.c
+++ b/source4/torture/rpc/netlogon.c
@@ -3203,6 +3203,7 @@ static bool test_GetDomainInfo(struct torture_context *tctx,
info.domain_info->dns_hostname.string,
query.workstation_info->dns_hostname,
"In/Out 'DNS hostnames' don't match!");
+ old_dnsname = info.domain_info->dns_hostname.string;
/* Checks "workstation flags" */
torture_assert(tctx,
@@ -3246,12 +3247,29 @@ static bool test_GetDomainInfo(struct torture_context *tctx,
"Trusted domains have been requested!");
+ torture_comment(tctx, "Testing netr_LogonGetDomainInfo 6th call (no DNS hostname)\n");
+ netlogon_creds_client_authenticator(creds, &a);
+
+ query.workstation_info->dns_hostname = NULL;
+
+ torture_assert_ntstatus_ok(tctx, dcerpc_netr_LogonGetDomainInfo_r(b, tctx, &r),
+ "LogonGetDomainInfo failed");
+ torture_assert_ntstatus_ok(tctx, r.out.result, "LogonGetDomainInfo failed");
+ torture_assert(tctx, netlogon_creds_client_check(creds, &a.cred), "Credential chaining failed");
+
+ /* The old DNS hostname should stick */
+ torture_assert_str_equal(tctx,
+ info.domain_info->dns_hostname.string,
+ old_dnsname,
+ "'DNS hostname' changed!");
+
+
if (!torture_setting_bool(tctx, "dangerous", false)) {
- torture_comment(tctx, "Not testing netr_LogonGetDomainInfo 6th call (no workstation info) - enable dangerous tests in order to do so\n");
+ torture_comment(tctx, "Not testing netr_LogonGetDomainInfo 7th call (no workstation info) - enable dangerous tests in order to do so\n");
} else {
/* Try a call without the workstation information structure */
- torture_comment(tctx, "Testing netr_LogonGetDomainInfo 6th call (no workstation info)\n");
+ torture_comment(tctx, "Testing netr_LogonGetDomainInfo 7th call (no workstation info)\n");
netlogon_creds_client_authenticator(creds, &a);
query.workstation_info = NULL;