From 992c03a1926cfbf6fb814583e4e2c1db810dd966 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 24 Oct 2008 02:01:16 +0200 Subject: s4-lsa: merge lsa_LookupSids/{2,3} from s3 lsa idl. Guenther --- source3/librpc/gen_ndr/lsa.h | 2 -- source3/librpc/idl/lsa.idl | 7 +------ source3/passdb/lookup_sid.c | 8 ++++---- source3/rpc_server/srv_lsa_nt.c | 8 +++++--- 4 files changed, 10 insertions(+), 15 deletions(-) (limited to 'source3') diff --git a/source3/librpc/gen_ndr/lsa.h b/source3/librpc/gen_ndr/lsa.h index d91cf4b66d..0ccbcdf5b0 100644 --- a/source3/librpc/gen_ndr/lsa.h +++ b/source3/librpc/gen_ndr/lsa.h @@ -9,8 +9,6 @@ #define LSA_ENUM_TRUST_DOMAIN_MULTIPLIER ( 60 ) #define LSA_REF_DOMAIN_LIST_MULTIPLIER ( 32 ) -#define MAX_REF_DOMAINS ( LSA_REF_DOMAIN_LIST_MULTIPLIER ) -#define MAX_LOOKUP_SIDS ( 0x5000 ) #define LSA_ENUM_TRUST_DOMAIN_EX_MULTIPLIER ( 82 ) #define LSA_CLIENT_REVISION_NO_DNS ( 0x00000001 ) #define LSA_CLIENT_REVISION_DNS ( 0x00000002 ) diff --git a/source3/librpc/idl/lsa.idl b/source3/librpc/idl/lsa.idl index cb1f2b028b..2ed267789d 100644 --- a/source3/librpc/idl/lsa.idl +++ b/source3/librpc/idl/lsa.idl @@ -391,8 +391,6 @@ import "misc.idl", "security.idl"; } lsa_TransSidArray; const int LSA_REF_DOMAIN_LIST_MULTIPLIER = 32; - const int MAX_REF_DOMAINS = LSA_REF_DOMAIN_LIST_MULTIPLIER; - typedef struct { [range(0,1000)] uint32 count; [size_is(count)] lsa_DomainInfo *domains; @@ -442,10 +440,7 @@ import "misc.idl", "security.idl"; [size_is(count)] lsa_TranslatedName *names; } lsa_TransNameArray; - /* This number is based on Win2k and later maximum response allowed */ - const int MAX_LOOKUP_SIDS = 0x5000; /* 20480 */ - - [public] NTSTATUS lsa_LookupSids ( + [public] NTSTATUS lsa_LookupSids( [in] policy_handle *handle, [in,ref] lsa_SidArray *sids, [out,ref] lsa_RefDomainList **domains, diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c index 3861c8e229..b9a67f208e 100644 --- a/source3/passdb/lookup_sid.c +++ b/source3/passdb/lookup_sid.c @@ -746,7 +746,7 @@ NTSTATUS lookup_sids(TALLOC_CTX *mem_ctx, int num_sids, } dom_infos = TALLOC_ZERO_ARRAY(mem_ctx, struct lsa_dom_info, - MAX_REF_DOMAINS); + LSA_REF_DOMAIN_LIST_MULTIPLIER); if (dom_infos == NULL) { result = NT_STATUS_NO_MEMORY; goto fail; @@ -816,7 +816,7 @@ NTSTATUS lookup_sids(TALLOC_CTX *mem_ctx, int num_sids, continue; } - for (j=0; jcount; } - if (num >= MAX_REF_DOMAINS) { + if (num >= LSA_REF_DOMAIN_LIST_MULTIPLIER) { /* index not found, already at maximum domain limit */ return -1; } ref->count = num + 1; - ref->max_size = MAX_REF_DOMAINS; + ref->max_size = LSA_REF_DOMAIN_LIST_MULTIPLIER; ref->domains = TALLOC_REALLOC_ARRAY(mem_ctx, ref->domains, struct lsa_DomainInfo, ref->count); @@ -725,7 +727,7 @@ static NTSTATUS _lsa_lookup_sids_internal(pipes_struct *p, return NT_STATUS_NO_MEMORY; } - for (i=0; i