]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:mdssvc: use an early return if spotlight is not enabled.
authorRalph Boehme <slow@samba.org>
Tue, 16 Apr 2019 17:32:52 +0000 (19:32 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 8 Aug 2019 20:24:33 +0000 (20:24 +0000)
No change in behaviour, best viewed with git show -w.

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

index 839cd4614c2ebef129a0b7458f53622bfdb598b5..68a05bec5ffc8428703b979d7f0274d3447f2fb2 100644 (file)
@@ -160,35 +160,35 @@ 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) {
+               DBG_ERR("Couldn't create policy handle for %s\n",
+                       r->in.share_name);
+               p->fault_state = DCERPC_FAULT_CANT_PERFORM;
+               return;
+       }
 
-       if (lp_spotlight(snum)) {
-               DBG_DEBUG("Spotlight enabled: %s\n", r->in.share_name);
-
-               path = lp_path(talloc_tos(), snum);
-               if (path == NULL) {
-                       DBG_ERR("Couldn't create policy handle for %s\n",
-                               r->in.share_name);
-                       p->fault_state = DCERPC_FAULT_CANT_PERFORM;
-                       return;
-               }
-
-               status = create_mdssvc_policy_handle(p->mem_ctx, p,
-                                                    snum,
-                                                    r->in.share_name,
-                                                    path,
-                                                    r->out.handle);
-               if (!NT_STATUS_IS_OK(status)) {
-                       DBG_ERR("Couldn't create policy handle for %s\n",
-                               r->in.share_name);
-                       talloc_free(path);
-                       p->fault_state = DCERPC_FAULT_CANT_PERFORM;
-                       return;
-               }
-
-               strlcpy(outpath, path, 1024);
+       status = create_mdssvc_policy_handle(p->mem_ctx, p,
+                                            snum,
+                                            r->in.share_name,
+                                            path,
+                                            r->out.handle);
+       if (!NT_STATUS_IS_OK(status)) {
+               DBG_ERR("Couldn't create policy handle for %s\n",
+                       r->in.share_name);
                talloc_free(path);
+               p->fault_state = DCERPC_FAULT_CANT_PERFORM;
+               return;
        }
 
+       strlcpy(outpath, path, 1024);
+       talloc_free(path);
        return;
 }