s3: Allow up to 20480 entries in LookupSids, as mandated by the official IDL
authorVolker Lendecke <vl@samba.org>
Mon, 14 Dec 2009 15:48:38 +0000 (16:48 +0100)
committerVolker Lendecke <vl@samba.org>
Mon, 14 Dec 2009 16:00:12 +0000 (17:00 +0100)
Seen in the wild by putting >1000 users into BUILTIN\Users

librpc/gen_ndr/lsa.h
librpc/gen_ndr/ndr_lsa.c
librpc/idl/lsa.idl

index a0af5712834b7c602c270da1a731c1ebabd5d762..4a4a95d77a2668acf13cbdc8adbecc7dfaedaa74 100644 (file)
@@ -312,7 +312,7 @@ struct lsa_SidPtr {
 };
 
 struct lsa_SidArray {
-       uint32_t num_sids;/* [range(0,1000)] */
+       uint32_t num_sids;/* [range(0,20480)] */
        struct lsa_SidPtr *sids;/* [unique,size_is(num_sids)] */
 }/* [public] */;
 
@@ -397,7 +397,7 @@ struct lsa_TranslatedName {
 };
 
 struct lsa_TransNameArray {
-       uint32_t count;/* [range(0,1000)] */
+       uint32_t count;/* [range(0,20480)] */
        struct lsa_TranslatedName *names;/* [unique,size_is(count)] */
 };
 
index ad7b2be32e70ee323c380e30e865622f07b13bbc..b198350b2d6033749b31d424e1f85a50efc79070 100644 (file)
@@ -1945,7 +1945,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_lsa_SidArray(struct ndr_pull *ndr, int ndr_f
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 5));
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_sids));
-               if (r->num_sids > 1000) {
+               if (r->num_sids > 20480) {
                        return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
                }
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids));
@@ -2444,7 +2444,7 @@ static enum ndr_err_code ndr_pull_lsa_TransNameArray(struct ndr_pull *ndr, int n
        if (ndr_flags & NDR_SCALARS) {
                NDR_CHECK(ndr_pull_align(ndr, 5));
                NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
-               if (r->count > 1000) {
+               if (r->count > 20480) {
                        return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
                }
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_names));
index a893786afa5ae6f53d354ece091344d4eafd9b29..baa5c93c2c1bb02cb0f3ba9dda15960524068173 100644 (file)
@@ -451,7 +451,7 @@ import "misc.idl", "security.idl";
        } lsa_SidPtr;
 
        typedef [public] struct {
-               [range(0,1000)] uint32 num_sids;
+               [range(0,20480)] uint32 num_sids;
                [size_is(num_sids)] lsa_SidPtr *sids;
        } lsa_SidArray;
 
@@ -564,7 +564,7 @@ import "misc.idl", "security.idl";
        } lsa_TranslatedName;
 
        typedef struct {
-               [range(0,1000)] uint32 count;
+               [range(0,20480)] uint32 count;
                [size_is(count)] lsa_TranslatedName *names;
        } lsa_TransNameArray;