From: Alexander Bokovoy Date: Sat, 10 Aug 2019 08:53:12 +0000 (+0300) Subject: smbtorture: extend rpc.lsa to lookup machine over forest-wide LookupNames X-Git-Tag: samba-4.9.12~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf5ac945151b83f7eb3158e0d18aec97c712c8ba;p=thirdparty%2Fsamba.git smbtorture: extend rpc.lsa to lookup machine over forest-wide LookupNames Add a simple test to resolve DOMAIN\MACHINE$ via LSA LookupNames3 using LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2 level. This level would pass zero lookup flags to lookup_name(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=14091 Signed-off-by: Alexander Bokovoy Reviewed-by: Andreas Schneider Autobuild-User(master): Alexander Bokovoy Autobuild-Date(master): Wed Aug 14 13:07:42 UTC 2019 on sn-devel-184 (cherry picked from commit 4d276a93fc624dc04d880f5b4157f272d3555be6) Autobuild-User(v4-9-test): Karolin Seeger Autobuild-Date(v4-9-test): Fri Aug 16 14:18:35 UTC 2019 on sn-devel-144 --- diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c index 51b4ca0171a..907f6e4759c 100644 --- a/source4/torture/rpc/lsa.c +++ b/source4/torture/rpc/lsa.c @@ -4794,7 +4794,7 @@ static bool test_QueryInfoPolicyCalls( bool version2, || i == LSA_POLICY_INFO_DNS_INT)) { /* Let's look up some of these names */ - struct lsa_TransNameArray tnames; + struct lsa_TransNameArray tnames, dnames; tnames.count = 14; tnames.names = talloc_zero_array(tctx, struct lsa_TranslatedName, tnames.count); tnames.names[0].name.string = info->dns.name.string; @@ -4827,6 +4827,12 @@ static bool test_QueryInfoPolicyCalls( bool version2, tnames.names[13].sid_type = SID_NAME_USER; ret &= test_LookupNames(b, tctx, handle, LSA_LOOKUP_NAMES_ALL, &tnames); + /* Try to use in-forest search for the test machine */ + dnames.count = 1; + dnames.names = talloc_zero_array(tctx, struct lsa_TranslatedName, dnames.count); + dnames.names[0].name.string = talloc_asprintf(tctx, "%s\\"TEST_MACHINENAME "$", info->dns.name.string); + dnames.names[0].sid_type = SID_NAME_USER; + ret &= test_LookupNames(b, tctx, handle, LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2, &dnames); } }