]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:mdssvc: the open command must work on shares with Spotlight disabled
authorRalph Boehme <slow@samba.org>
Mon, 6 May 2019 12:11:31 +0000 (14:11 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 8 Aug 2019 20:24:33 +0000 (20:24 +0000)
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 <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
selftest/knownfail.d/samba3.rpc
source3/rpc_server/mdssvc/mdssvc.c
source3/rpc_server/mdssvc/srv_mdssvc_nt.c

index 53c2c709ff8e1cb3bf15dfabcdc38662b2a7d9c1..2b9179863c8a75f47fb63c77e677f562b382e06d 100644 (file)
@@ -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\)
index c93775280b7635c68dfeedff78114da26701a0ac..1d42048243770cd080f33e6aa82c3d3fd91c7c6d 100644 (file)
@@ -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;
index 68a05bec5ffc8428703b979d7f0274d3447f2fb2..a4df2f136b7a23cb31f224a4f5916c1bfc464024 100644 (file)
@@ -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) {