1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-27 14:04:05 +03:00

torture: fix check_dom_trust_pw in the rpc:lsa test

This makes sure a host*NAME* handed in will get properly resolved.
Bug uncovered by the new nss_wrapper code (1.1.2) which fixed
the handling of the AI_NUMERICHOST flag in getaddrinfo.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Michael Adam 2015-12-17 13:59:40 +01:00
parent 38c2305fe5
commit 688590f07f

View File

@ -36,6 +36,7 @@
#include "source4/auth/kerberos/kerberos_util.h"
#include "lib/util/util_net.h"
#include "../lib/crypto/crypto.h"
#include "libcli/resolve/resolve.h"
#define TEST_MACHINENAME "lsatestmach"
#define TRUSTPW "12345678"
@ -4127,6 +4128,8 @@ static bool check_dom_trust_pw(struct dcerpc_pipe *p,
char *workstation = NULL;
const char *binding = torture_setting_string(tctx, "binding", NULL);
const char *host = torture_setting_string(tctx, "host", NULL);
const char *ip;
struct nbt_name nbt_name;
struct dcerpc_binding *b2;
struct netlogon_creds_CredentialState *creds;
struct samr_CryptPassword samr_crypt_password;
@ -4182,8 +4185,16 @@ static bool check_dom_trust_pw(struct dcerpc_pipe *p,
cli_credentials_set_workstation(incoming_creds, workstation, CRED_SPECIFIED);
cli_credentials_set_secure_channel_type(incoming_creds, secure_channel_type);
make_nbt_name_server(&nbt_name, host);
status = resolve_name_ex(lpcfg_resolve_context(tctx->lp_ctx),
0, 0, &nbt_name, tctx, &ip, tctx->ev);
torture_assert_ntstatus_ok(tctx, status,
talloc_asprintf(tctx,"Failed to resolve %s: %s",
nbt_name.name, nt_errstr(status)));
rc = tsocket_address_inet_from_strings(tctx, "ip",
host,
ip,
lpcfg_cldap_port(tctx->lp_ctx),
&dest_addr);
torture_assert_int_equal(tctx, rc, 0,