From: Ralph Boehme Date: Mon, 6 May 2019 12:11:31 +0000 (+0200) Subject: s3:mdssvc: the open command must work on shares with Spotlight disabled X-Git-Tag: tdb-1.4.2~203 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=63366996879fab5b1729de6d6224ca167bdb05b0;p=thirdparty%2Fsamba.git s3:mdssvc: the open command must work on shares with Spotlight disabled Move the implementation of this setting down to the actual search query processing. macOS has no notion of "spotlight = false" at the DCERPC layer and the open request will always succeed even on all shares. When later the client issues search requests on such shares, we ensure we use the noindex backend. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/selftest/knownfail.d/samba3.rpc b/selftest/knownfail.d/samba3.rpc index 53c2c709ff8..2b9179863c8 100644 --- a/selftest/knownfail.d/samba3.rpc +++ b/selftest/knownfail.d/samba3.rpc @@ -1,4 +1,3 @@ -^samba3.rpc.mdssvc.rpccmd.open_spotlight_disabled\(fileserver\) ^samba3.rpc.mdssvc.rpccmd.close\(fileserver\) ^samba3.rpc.mdssvc.rpccmd.null_ph\(fileserver\) ^samba3.rpc.mdssvc.disconnect1.invalid_ph_unknown1\(fileserver\) diff --git a/source3/rpc_server/mdssvc/mdssvc.c b/source3/rpc_server/mdssvc/mdssvc.c index c93775280b7..1d420482437 100644 --- a/source3/rpc_server/mdssvc/mdssvc.c +++ b/source3/rpc_server/mdssvc/mdssvc.c @@ -1521,6 +1521,9 @@ struct mds_ctx *mds_init_ctx(TALLOC_CTX *mem_ctx, } backend = lp_spotlight_backend(snum); + if (!lp_spotlight(snum)) { + backend = SPOTLIGHT_BACKEND_NOINDEX; + } switch (backend) { case SPOTLIGHT_BACKEND_NOINDEX: mds_ctx->backend = &mdsscv_backend_noindex; diff --git a/source3/rpc_server/mdssvc/srv_mdssvc_nt.c b/source3/rpc_server/mdssvc/srv_mdssvc_nt.c index 68a05bec5ff..a4df2f136b7 100644 --- a/source3/rpc_server/mdssvc/srv_mdssvc_nt.c +++ b/source3/rpc_server/mdssvc/srv_mdssvc_nt.c @@ -160,11 +160,6 @@ void _mdssvc_open(struct pipes_struct *p, struct mdssvc_open *r) if (!VALID_SNUM(snum)) { return; } - if (!lp_spotlight(snum)) { - return; - } - - DBG_DEBUG("Spotlight enabled: %s\n", r->in.share_name); path = lp_path(talloc_tos(), snum); if (path == NULL) {