s3-lsa: When looking up domains in LookupNames, do not strip the sid.
authorGünther Deschner <gd@samba.org>
Tue, 20 Oct 2009 13:12:58 +0000 (15:12 +0200)
committerGünther Deschner <gd@samba.org>
Tue, 20 Oct 2009 13:28:31 +0000 (15:28 +0200)
Found by RPC-LSA-LOOKUPNAMES torture test.

Guenther

source3/rpc_server/srv_lsa_nt.c

index c5805ef3d4b78222fde0d1f7346023ba1d922e80..a3a1218956efc4fb29334f00e7df706a1dd9ae0c 100644 (file)
@@ -195,7 +195,11 @@ static NTSTATUS lookup_lsa_rids(TALLOC_CTX *mem_ctx,
                dom_idx = -1;
 
                if (type != SID_NAME_UNKNOWN) {
                dom_idx = -1;
 
                if (type != SID_NAME_UNKNOWN) {
-                       sid_split_rid(&sid, &rid);
+                       if (type == SID_NAME_DOMAIN) {
+                               rid = (uint32_t)-1;
+                       } else {
+                               sid_split_rid(&sid, &rid);
+                       }
                        dom_idx = init_lsa_ref_domain_list(mem_ctx, ref, domain, &sid);
                        mapped_count++;
                }
                        dom_idx = init_lsa_ref_domain_list(mem_ctx, ref, domain, &sid);
                        mapped_count++;
                }