From: Ralph Boehme Date: Mon, 12 Oct 2020 11:21:07 +0000 (+0200) Subject: smbd: already set fsp fd in non_widelink_open() X-Git-Tag: samba-4.14.0rc1~383 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=abb7ab2c10eef05b54669c7bc947804d34470ee0;p=thirdparty%2Fsamba.git smbd: already set fsp fd in non_widelink_open() 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 Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 43be98b4d8f..b76e5d3e62d 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -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);