]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Ignore twrp in chdir_below_conn()
authorVolker Lendecke <vl@samba.org>
Sun, 20 Oct 2024 12:41:55 +0000 (14:41 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 12 Nov 2024 18:07:33 +0000 (18:07 +0000)
We can't deal with snapdir paths in non_widelink_open fully with
snapdirseverywhere active: There is no way for
shadow_copy2_parent_pathname() to work when a snapshot directory is
below the directory that we want to calculate the parent for. What is
the parent directory supposed to point at? I don't know.

For me the only way out is to accept that we should ignore what
happens behind shadow_copy2's path manipulation in core
smbd. This *might* open symlink races, but the whole point of
snapshots is that they are r/o copies of the real active file system
and as such they should be immune to those races.

Found while trying to refactor code around fd_openat()

P.S: This code will go away pretty soon

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

index 799b178757043743f7cfdc43f8b8b7ea2ff384a1..540cf1acc8c70813de9981b14507a7707137a961 100644 (file)
@@ -507,7 +507,7 @@ static NTSTATUS chdir_below_conn(
                ".",
                NULL,
                NULL,
-               dir_fname->twrp,
+               0,
                dir_fname->flags);
        if (smb_fname_dot == NULL) {
                status = NT_STATUS_NO_MEMORY;
@@ -625,7 +625,7 @@ static NTSTATUS non_widelink_open(const struct files_struct *dirfsp,
                             const struct vfs_open_how *_how)
 {
        struct connection_struct *conn = fsp->conn;
-       const char *connpath = SMB_VFS_CONNECTPATH(conn, dirfsp, smb_fname);
+       const char *connpath = conn->connectpath;
        size_t connpath_len;
        NTSTATUS status = NT_STATUS_OK;
        int fd = -1;