From b3272bfd62a21e8e3d9624c3d70bae40f8e667f6 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Fri, 1 Nov 2013 10:12:04 +0100 Subject: s4:torture/netlogon: Test with attrs: "netlogon *" --- source4/torture/ldap/netlogon.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source4/torture/ldap/netlogon.c b/source4/torture/ldap/netlogon.c index 5605570396..e09f30a396 100644 --- a/source4/torture/ldap/netlogon.c +++ b/source4/torture/ldap/netlogon.c @@ -450,6 +450,7 @@ static bool test_netlogon_extra_attrs(struct torture_context *tctx, "netlogon", "supportedCapabilities" }; + const char *attrs2[] = { "netlogon", "*" }; int num_attrs = ARRAY_SIZE(attrs); /* Additional attributes may be requested next to netlogon */ @@ -465,7 +466,15 @@ static bool test_netlogon_extra_attrs(struct torture_context *tctx, torture_assert(tctx, filter != NULL, "OOM"); status = ldap_rootdse(conn, tctx, filter, attrs, num_attrs, &res); CHECK_STATUS(status, NT_STATUS_OK); - CHECK_VAL(res->num_attributes, ARRAY_SIZE(attrs)); + CHECK_VAL(res->num_attributes, num_attrs); + + /* netlogon + '*' attr return zero results */ + torture_comment(tctx, "Requesting netlogon and '*' attributes\n"); + status = ldap_rootdse(conn, tctx, filter, attrs2, ARRAY_SIZE(attrs2), &res); + CHECK_STATUS(status, NT_STATUS_OK); + struct ldb_message msg = { NULL, res->num_attributes, res->attributes }; + torture_assert(tctx, ldb_msg_find_element(&msg, "netlogon") != NULL, + "Attribute netlogon not found in Result Entry\n"); /* Wildcards are not allowed in filters when netlogon is requested. */ torture_comment(tctx, "Requesting netlogon with invalid attr filter\n"); -- cgit