s3:mdssvc: supposed status field is in fact a fragment indicator
authorRalph Boehme <slow@samba.org>
Tue, 16 Apr 2019 12:04:16 +0000 (14:04 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 8 Aug 2019 20:24:32 +0000 (20:24 +0000)
Spotted this in mdssvc response that containied many results for a search
request: if the mdssvc response blob is larger then ~32k, the server fragments
the response in 32k fragments and sets the "fragment" field to 1.

Note that mdssvc implemenets result set "fragmentation" at the result set layer,
not at the marshalled response buffer layer. Therefor mdssvc always sets this
field to 0.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
librpc/idl/mdssvc.idl
source3/rpc_server/mdssvc/srv_mdssvc_nt.c

index bfb27c4a795184cad3c7252ddb032a746a9f8378..43447961b0dcb6683a625816266a2807c1202c4d 100644 (file)
@@ -51,7 +51,7 @@ interface mdssvc
                [in]        uint32          max_fragment_size2,
                [in]        uint32          unkn7, /* always 0 ? */
                [in]        uint32          unkn8, /* always 0 ? */
-               [out,ref]   uint32         *status,
+               [out,ref]   uint32         *fragment,
                [out,ref]   mdssvc_blob    *response_blob,
                [out,ref]   uint32         *unkn9  /* always 0 ? */
        );
index 293d0659909b06f9ad4890af5392897acea86276..4e3d8ea9ec16ec0de1b47650f35c04d90acd499f 100644 (file)
@@ -264,13 +264,14 @@ void _mdssvc_cmd(struct pipes_struct *p, struct mdssvc_cmd *r)
        r->out.response_blob->spotlight_blob = (uint8_t *)rbuf;
        r->out.response_blob->size = r->in.max_fragment_size1;
 
+       /* We currently don't use fragmentation at the mdssvc RPC layer */
+       *r->out.fragment = 0;
+
        ok = mds_dispatch(mds_ctx, &r->in.request_blob, r->out.response_blob);
        if (ok) {
-               *r->out.status = 0;
                *r->out.unkn9 = 0;
        } else {
                /* FIXME: just interpolating from AFP, needs verification */
-               *r->out.status = UINT32_MAX;
                *r->out.unkn9 = UINT32_MAX;
        }