Author: jmcd
Date: 2005-02-19 10:56:40 +0000 (Sat, 19 Feb 2005)
New Revision: 5458

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=5458

Log:
Generate a sane response to exceeding lookupsids limit.  Truncate list to zero
and return NT_STATUS_NONE_MAPPED.  This does not crash windows and maintains
the benefit of not overallocating memory.  The previous response of
truncating to the MAX limit was not useful because it crashed lsass.exe on
windows (bug opened with MS), and it was also misleading the client to 
believe that a complete answer was received.

Modified:
   branches/SAMBA_3_0/source/rpc_server/srv_lsa_nt.c


Changeset:
Modified: branches/SAMBA_3_0/source/rpc_server/srv_lsa_nt.c
===================================================================
--- branches/SAMBA_3_0/source/rpc_server/srv_lsa_nt.c   2005-02-19 10:43:11 UTC 
(rev 5457)
+++ branches/SAMBA_3_0/source/rpc_server/srv_lsa_nt.c   2005-02-19 10:56:40 UTC 
(rev 5458)
@@ -647,8 +647,9 @@
        uint32 mapped_count = 0;
 
        if (num_entries >  MAX_LOOKUP_SIDS) {
-               num_entries = MAX_LOOKUP_SIDS;
-               DEBUG(5,("_lsa_lookup_sids: truncating SID lookup list to 
%d\n", num_entries));
+               num_entries = 0;
+               DEBUG(5,("_lsa_lookup_sids: limit of %d exceeded, truncating 
SID lookup list to %d\n", MAX_LOOKUP_SIDS, num_entries));
+               r_u->status = NT_STATUS_NONE_MAPPED;
        }
 
        ref = TALLOC_ZERO_P(p->mem_ctx, DOM_R_REF);

Reply via email to