]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
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:57:26 +0000 (11:57 +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!

source/passdb/lookup_sid.c
source/rpc_server/srv_lsa_nt.c

index a7175b9647fa4af2a4f14ce900fab9d519ed5e7d..d767fa4f50aa586c56ada125531ae889ac2574cf 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 9ce992ce25d0d38eaf0b0304ae0ce333a79052eb..9d411eccb9d1624fa33b980595c1f555a9367df2 100644 (file)
@@ -830,6 +830,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);