From: Ralph Boehme Date: Thu, 7 May 2020 14:51:35 +0000 (+0200) Subject: smbd: pass dirfsp to open_directory() X-Git-Tag: ldb-2.2.0~426 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f581fb384fc6e5751c6bdbc088e36d2c8888756;p=thirdparty%2Fsamba.git smbd: pass dirfsp to open_directory() As the calls to * SMB_VFS_LSTAT() * get_share_mode_lock() and maybe others still have to be updated to work with atnames, we assert (dirfsp == conn->cwd_fsp). Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/open.c b/source3/smbd/open.c index d3a18cea3a0..7c0854ac124 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -4253,6 +4253,7 @@ static NTSTATUS mkdir_internal(connection_struct *conn, static NTSTATUS open_directory(connection_struct *conn, struct smb_request *req, + struct files_struct **dirfsp, struct smb_filename *smb_dname, uint32_t access_mask, uint32_t share_access, @@ -4271,6 +4272,8 @@ static NTSTATUS open_directory(connection_struct *conn, int flags; bool ok; + SMB_ASSERT(*dirfsp == conn->cwd_fsp); + if (is_ntfs_stream_smb_fname(smb_dname)) { DEBUG(2, ("open_directory: %s is a stream name!\n", smb_fname_str_dbg(smb_dname))); @@ -5633,6 +5636,7 @@ static NTSTATUS create_file_unixpath(connection_struct *conn, oplock_request = 0; status = open_directory(conn, req, + dirfsp, smb_fname, access_mask, share_access, @@ -5711,6 +5715,7 @@ static NTSTATUS create_file_unixpath(connection_struct *conn, oplock_request = 0; status = open_directory(conn, req, + dirfsp, smb_fname, access_mask, share_access,