summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2021-06-22 23:38:44 -0700
committerRalph Boehme <slow@samba.org>2021-06-25 15:53:31 +0000
commitb63ac2ed97f92e1c435e72e8edaee00a8366a31d (patch)
tree132328ae809703efa5f9e0f0f692e500c8a15754 /source3
parentbd0bad6f58ab9aff789392ba1a8e817d7bdca5c8 (diff)
downloadsamba-b63ac2ed97f92e1c435e72e8edaee00a8366a31d.tar.gz
s3: smbd: Move the call to fsp_set_fd(conn->cwd_fsp, AT_FDCWD) to just after SMB_VFS_CHDIR().
Once SMB_VFS_CHDIR() has been called and returned success, cwd_fsp *must* be AT_FDCWD. We needs this so that SMB_VFS_STAT() can work correctly with at startup time with modules that need to create pathref fsp's. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/vfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 5cc86fb96f1..a241fbbb9d2 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -947,6 +947,7 @@ int vfs_ChDir(connection_struct *conn, const struct smb_filename *smb_fname)
* don't know if it's been modified by
* VFS modules in the stack.
*/
+ fsp_set_fd(conn->cwd_fsp, AT_FDCWD);
/* conn cache. */
cwd = vfs_GetWd(conn, conn);
@@ -995,7 +996,6 @@ int vfs_ChDir(connection_struct *conn, const struct smb_filename *smb_fname)
talloc_move(talloc_tos(), &conn->cwd_fsp->fsp_name);
conn->cwd_fsp->fsp_name = talloc_move(conn->cwd_fsp, &cwd);
- fsp_set_fd(conn->cwd_fsp, AT_FDCWD);
DBG_INFO("vfs_ChDir got %s\n", fsp_str_dbg(conn->cwd_fsp));