]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: simplify openat_pathref_fullname()
authorVolker Lendecke <vl@samba.org>
Tue, 8 Oct 2024 15:42:11 +0000 (17:42 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 12 Nov 2024 18:07:33 +0000 (18:07 +0000)
We don't have to deal with stream opens anymore.

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

index ed668124bf8f7c82bc8bfb2c0f266f8154ae0cc8..28a0e0c018715bfdf8220637e83166dad92bb6f2 100644 (file)
@@ -404,20 +404,16 @@ static int smb_fname_fsp_destructor(struct smb_filename *smb_fname)
 static NTSTATUS openat_pathref_fullname(
        struct connection_struct *conn,
        const struct files_struct *dirfsp,
-       struct files_struct *basefsp,
        struct smb_filename **full_fname,
        struct smb_filename *smb_fname,
        const struct vfs_open_how *how)
 {
        struct files_struct *fsp = NULL;
-       bool have_dirfsp = (dirfsp != NULL);
-       bool have_basefsp = (basefsp != NULL);
        NTSTATUS status;
 
        DBG_DEBUG("smb_fname [%s]\n", smb_fname_str_dbg(smb_fname));
 
        SMB_ASSERT(smb_fname->fsp == NULL);
-       SMB_ASSERT(have_dirfsp != have_basefsp);
 
        status = fsp_new(conn, conn, &fsp);
        if (!NT_STATUS_IS_OK(status)) {
@@ -434,7 +430,6 @@ static NTSTATUS openat_pathref_fullname(
        if (!NT_STATUS_IS_OK(status)) {
                goto fail;
        }
-       fsp_set_base_fsp(fsp, basefsp);
 
        status = fd_openat(dirfsp, smb_fname, fsp, how);
        if (!NT_STATUS_IS_OK(status)) {
@@ -493,7 +488,6 @@ fail:
                  smb_fname_str_dbg(smb_fname),
                  nt_errstr(status));
 
-       fsp_set_base_fsp(fsp, NULL);
        fd_close(fsp);
        file_free(NULL, fsp);
        return status;
@@ -546,7 +540,7 @@ NTSTATUS openat_pathref_fsp(const struct files_struct *dirfsp,
                        goto fail;
                }
                status = openat_pathref_fullname(
-                       conn, dirfsp, NULL, &full_fname, smb_fname, &how);
+                       conn, dirfsp, &full_fname, smb_fname, &how);
                TALLOC_FREE(full_fname);
                return status;
        }
@@ -569,7 +563,7 @@ NTSTATUS openat_pathref_fsp(const struct files_struct *dirfsp,
        }
 
        status = openat_pathref_fullname(
-               conn, dirfsp, NULL, &full_fname, base_fname, &how);
+               conn, dirfsp, &full_fname, base_fname, &how);
        TALLOC_FREE(full_fname);
        if (!NT_STATUS_IS_OK(status)) {
                DBG_DEBUG("openat_pathref_fullname() failed: %s\n",