s4-lsa: Fix dcesrv_lsa_EnumTrustDom() and avoid infite windows client loop.
authorGünther Deschner <gd@samba.org>
Wed, 21 Oct 2009 00:18:54 +0000 (02:18 +0200)
committerGünther Deschner <gd@samba.org>
Wed, 21 Oct 2009 01:14:00 +0000 (03:14 +0200)
Found by RPC-LSA-TRUSTED-DOMAIN torture test.

Guenther

source4/rpc_server/lsa/dcesrv_lsa.c

index 0e6a55ec2f5df42d6c948179e58c1161a0ad0d5b..e35f2d8bf6fb8635f9b3916ab7b6fcb2354eda47 100644 (file)
@@ -1660,6 +1660,15 @@ static NTSTATUS dcesrv_lsa_EnumTrustDom(struct dcesrv_call_state *dce_call, TALL
                return STATUS_MORE_ENTRIES;
        }
 
+       /* according to MS-LSAD 3.1.4.7.8 output resume handle MUST
+        * always be larger than the previous input resume handle, in
+        * particular when hitting the last query it is vital to set the
+        * resume handle correctly to avoid infinite client loops, as
+        * seen e.g. with Windows XP SP3 when resume handle is 0 and
+        * status is NT_STATUS_OK - gd */
+
+       *r->out.resume_handle = (uint32_t)-1;
+
        return NT_STATUS_OK;
 }