]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: already set fsp fd in non_widelink_open()
authorRalph Boehme <slow@samba.org>
Mon, 12 Oct 2020 11:21:07 +0000 (13:21 +0200)
committerRalph Boehme <slow@samba.org>
Wed, 16 Dec 2020 09:08:30 +0000 (09:08 +0000)
A subsequent commit will add a consumer of the fd to non_widelink_open() (by
calling SMB_VFS_FSTAT()), so we need to set the fd already here. And it makes
more sense anyway. :)

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

index 43be98b4d8fff52f2300d6363f565913ba77d842..b76e5d3e62d92e01458b0588aed67a1dd3caa772 100644 (file)
@@ -708,6 +708,7 @@ static int non_widelink_open(files_struct *fsp,
                            flags,
                            mode);
 
+       fsp_set_fd(fsp, fd);
        fsp->fsp_name = tmp_fsp_name;
 
        if (fd == -1) {
@@ -824,8 +825,6 @@ NTSTATUS fd_open(files_struct *fsp,
                return status;
        }
 
-       fsp_set_fd(fsp, fd);
-
        DBG_DEBUG("name %s, flags = 0%o mode = 0%o, fd = %d\n",
                  smb_fname_str_dbg(smb_fname), flags, (int)mode, fd);