]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_fake_acls: Reduce indentation in fake_acls_stat()
authorVolker Lendecke <vl@samba.org>
Sat, 4 Oct 2025 16:36:47 +0000 (18:36 +0200)
committerRalph Boehme <slow@samba.org>
Fri, 10 Oct 2025 08:23:37 +0000 (08:23 +0000)
Use an early error return

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_fake_acls.c

index bb1ed25cdff239ff572353ca91aad0ed912472fc..3387461626fe7e9f10d1dcd8377c624c357b35c1 100644 (file)
@@ -129,6 +129,13 @@ static int fake_acls_stat(vfs_handle_struct *handle,
                return 0;
        }
 
+       if (fsp_get_pathref_fd(handle->conn->cwd_fsp) == -1) {
+               /*
+                * No tcon around, fail as if we don't have the EAs
+                */
+               return 0;
+       }
+
        /*
         * openat_pathref_fsp() expects a talloc'ed smb_filename. stat
         * can be passed a struct from the stack. Make a talloc'ed
@@ -140,19 +147,13 @@ static int fake_acls_stat(vfs_handle_struct *handle,
                return -1;
        }
 
-       if (fsp_get_pathref_fd(handle->conn->cwd_fsp) == -1) {
-               /*
-                * No tcon around, fail as if we don't have the EAs
-                */
-               status = NT_STATUS_INVALID_HANDLE;
-       } else {
-               /* Recursion guard. */
-               prd->calling_pathref_fsp = true;
-               status = openat_pathref_fsp(handle->conn->cwd_fsp,
-                                           smb_fname_cp);
-               /* End recursion guard. */
-               prd->calling_pathref_fsp = false;
-       }
+       /* Recursion guard. */
+       prd->calling_pathref_fsp = true;
+
+       status = openat_pathref_fsp(handle->conn->cwd_fsp, smb_fname_cp);
+
+       /* End recursion guard. */
+       prd->calling_pathref_fsp = false;
 
        if (!NT_STATUS_IS_OK(status)) {
                /*