]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
mdssvc: fix kMDScopeArray parsing
authorRalph Boehme <slow@samba.org>
Wed, 18 Jan 2023 15:21:16 +0000 (16:21 +0100)
committerJule Anger <janger@samba.org>
Fri, 10 Feb 2023 12:15:02 +0000 (12:15 +0000)
In macOS Ventura marshalling of kMDScopeArray in the "openQueryWithParams"
request has changed from

  string: kMDScopeArray
  sl_array_t(#1): {
    string: /foo/bar
  }

to:

  string: kMDScopeArray
  sl_array_t(#1): {
    sl_array_t(#1): {
      string: /foo/bar
    }
  }

With this patch we check both encodings. Bug fixed according to user feedback.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15299
RN: Spotlight doesn't work with latest macOS Ventura

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 1dd0cd2f4e644ad43b0e7ee2aaae19799e859585)

Autobuild-User(v4-16-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-16-test): Fri Feb 10 12:15:02 UTC 2023 on sn-devel-184

source3/rpc_server/mdssvc/mdssvc.c

index a4b082b3274151ce136623e44d96b622d6505826..4f1629b2b4d1d6a85861e492469cf5410237b207 100644 (file)
@@ -932,6 +932,12 @@ static bool slrpc_open_query(struct mds_ctx *mds_ctx,
 
        scope = dalloc_get(path_scope, "char *", 0);
        if (scope == NULL) {
+               scope = dalloc_get(path_scope,
+                                  "DALLOC_CTX", 0,
+                                  "char *", 0);
+       }
+       if (scope == NULL) {
+               DBG_ERR("Failed to parse kMDScopeArray\n");
                goto error;
        }