]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Don't loose base_fsp statinfo in non_widelink_open
authorVolker Lendecke <vl@samba.org>
Thu, 31 Mar 2022 19:21:30 +0000 (21:21 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 1 Apr 2022 20:19:29 +0000 (20:19 +0000)
smb_fname_rel came from SMB_VFS_PARENT_PATHNAME() without a reference
to the underlying base_fsp. We want to pass the existing stat-info to
the VFS objects, so when creating the relative base fsp_name we should
copy the stat-info from the base fsp we were handed, not the fake one
that we just made up in SMB_VFS_PARENT_PATHNAME()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/open.c

index 35f572211717f16a431554bb263ef5dbd675b4be..1644d867566b2280df1f5080428e6aa74dbb3060 100644 (file)
@@ -745,7 +745,7 @@ static NTSTATUS non_widelink_open(const struct files_struct *dirfsp,
                                                talloc_tos(),
                                                smb_fname_rel->base_name,
                                                NULL,
-                                               &smb_fname_rel->st,
+                                               &fsp->base_fsp->fsp_name->st,
                                                smb_fname_rel->twrp,
                                                smb_fname_rel->flags);
                        if (base_smb_fname_rel == NULL) {