The branch, master has been updated
       via  a4d5487... s4-smbtorture: fix RPC-LSA-LSALOOKUP test against w2k3 
and w2k8.
      from  e349e2c... Fix "make install" by removing all references to python. 
Not currently needed in source3, and isn't working anyway. Jeremy.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit a4d54875768bbe6bcd019a788081d182ce9d4a80
Author: Günther Deschner <g...@samba.org>
Date:   Tue Oct 20 23:47:40 2009 +0200

    s4-smbtorture: fix RPC-LSA-LSALOOKUP test against w2k3 and w2k8.
    
    Make sure to split out lsa_LookupName NULL name test so that we can better 
track
    results from bogus names and NULL names.
    
    Guenther

-----------------------------------------------------------------------

Summary of changes:
 source4/torture/rpc/lsa.c |   66 ++++++++++++++++++++++++++++++++++-----------
 1 files changed, 50 insertions(+), 16 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c
index e4a6a84..9cee4e2 100644
--- a/source4/torture/rpc/lsa.c
+++ b/source4/torture/rpc/lsa.c
@@ -232,31 +232,19 @@ static bool test_LookupNames_bogus(struct dcerpc_pipe *p,
        struct lsa_LookupNames r;
        struct lsa_TransSidArray sids;
        struct lsa_RefDomainList *domains = NULL;
-       struct lsa_String *names;
+       struct lsa_String names[1];
        uint32_t count = 0;
        NTSTATUS status;
-       int i;
-
-       struct lsa_TranslatedName name[2];
-       struct lsa_TransNameArray tnames;
-
-       tnames.names = name;
-       tnames.count = 2;
-       name[0].name.string = "NT AUTHORITY\\BOGUS";
-       name[1].name.string = NULL;
 
-       torture_comment(tctx, "\nTesting LookupNames with bogus names\n");
+       torture_comment(tctx, "\nTesting LookupNames with bogus name\n");
 
        sids.count = 0;
        sids.sids = NULL;
 
-       names = talloc_array(tctx, struct lsa_String, tnames.count);
-       for (i=0;i<tnames.count;i++) {
-               init_lsa_String(&names[i], tnames.names[i].name.string);
-       }
+       init_lsa_String(&names[0], "NT AUTHORITY\\BOGUS");
 
        r.in.handle = handle;
-       r.in.num_names = tnames.count;
+       r.in.num_names = 1;
        r.in.names = names;
        r.in.sids = &sids;
        r.in.level = 1;
@@ -276,6 +264,48 @@ static bool test_LookupNames_bogus(struct dcerpc_pipe *p,
        return true;
 }
 
+static bool test_LookupNames_NULL(struct dcerpc_pipe *p,
+                                 struct torture_context *tctx,
+                                 struct policy_handle *handle)
+{
+       struct lsa_LookupNames r;
+       struct lsa_TransSidArray sids;
+       struct lsa_RefDomainList *domains = NULL;
+       struct lsa_String names[1];
+       uint32_t count = 0;
+
+       torture_comment(tctx, "\nTesting LookupNames with NULL name\n");
+
+       sids.count = 0;
+       sids.sids = NULL;
+
+       names[0].string = NULL;
+
+       r.in.handle = handle;
+       r.in.num_names = 1;
+       r.in.names = names;
+       r.in.sids = &sids;
+       r.in.level = 1;
+       r.in.count = &count;
+       r.out.count = &count;
+       r.out.sids = &sids;
+       r.out.domains = &domains;
+
+       /* nt4 returns NT_STATUS_NONE_MAPPED with sid_type
+        * SID_NAME_UNKNOWN, rid 0, and sid_index -1;
+        *
+        * w2k3/w2k8 return NT_STATUS_OK with sid_type
+        * SID_NAME_DOMAIN, rid -1 and sid_index 0 and BUILTIN domain
+        */
+
+       torture_assert_ntstatus_ok(tctx, dcerpc_lsa_LookupNames(p, tctx, &r),
+               "LookupNames with NULL name failed");
+
+       torture_comment(tctx, "\n");
+
+       return true;
+}
+
 static bool test_LookupNames_wellknown(struct dcerpc_pipe *p,
                                       struct torture_context *tctx,
                                       struct policy_handle *handle)
@@ -2768,6 +2798,10 @@ static bool testcase_LookupNames(struct torture_context 
*tctx,
                ret = false;
        }
 
+       if (!test_LookupNames_NULL(p, tctx, handle)) {
+               ret = false;
+       }
+
        if (!test_LookupNames_bogus(p, tctx, handle)) {
                ret = false;
        }


-- 
Samba Shared Repository

Reply via email to