Fix bug 6097
authorVolker Lendecke <vl@samba.org>
Tue, 24 Mar 2009 10:07:16 +0000 (11:07 +0100)
committerVolker Lendecke <vl@samba.org>
Tue, 24 Mar 2009 10:59:42 +0000 (11:59 +0100)
A client sent a SID with authority 0 and 0 sub-authorities. W2k3 replies with
NT_STATUS_INVALID_SID, even if other SIDs in the list are valid.

Thanks to Pavel <wylda@volny.cz> for the bug report!

source3/passdb/lookup_sid.c
source3/rpc_server/srv_lsa_nt.c

index 9c20042a6282ae7fb06410db05c92ec25052d53b..a5c2d503662da13ea85d4445f7d7a144be577844 100644 (file)
@@ -804,7 +804,7 @@ NTSTATUS lookup_sids(TALLOC_CTX *mem_ctx, int num_sids,
                } else {
                        /* This is a normal SID with rid component */
                        if (!sid_split_rid(&sid, &rid)) {
-                               result = NT_STATUS_INVALID_PARAMETER;
+                               result = NT_STATUS_INVALID_SID;
                                goto fail;
                        }
                }
index ed54c3a86e9ffaa6dee96f43158995672f7a70de..5fdcaf2d4acf9b031b6c7b1e2d69bff2e2f84f28 100644 (file)
@@ -827,6 +827,10 @@ NTSTATUS _lsa_LookupSids(pipes_struct *p,
                                           &names,
                                           &mapped_count);
 
+       if (NT_STATUS_IS_ERR(status)) {
+               return status;
+       }
+
        /* Convert from lsa_TranslatedName2 to lsa_TranslatedName */
        names_out = TALLOC_ARRAY(p->mem_ctx, struct lsa_TranslatedName,
                                 num_sids);