From: Ralph Boehme Date: Tue, 16 Apr 2019 12:04:16 +0000 (+0200) Subject: s3:mdssvc: supposed status field is in fact a fragment indicator X-Git-Tag: tdb-1.4.2~224 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0b1d9d40c249ca7f893cbcc54587ae8fc93f15ee;p=thirdparty%2Fsamba.git s3:mdssvc: supposed status field is in fact a fragment indicator 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 Reviewed-by: Jeremy Allison --- diff --git a/librpc/idl/mdssvc.idl b/librpc/idl/mdssvc.idl index bfb27c4a795..43447961b0d 100644 --- a/librpc/idl/mdssvc.idl +++ b/librpc/idl/mdssvc.idl @@ -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 ? */ ); diff --git a/source3/rpc_server/mdssvc/srv_mdssvc_nt.c b/source3/rpc_server/mdssvc/srv_mdssvc_nt.c index 293d0659909..4e3d8ea9ec1 100644 --- a/source3/rpc_server/mdssvc/srv_mdssvc_nt.c +++ b/source3/rpc_server/mdssvc/srv_mdssvc_nt.c @@ -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; }