From: Ralph Boehme Date: Thu, 7 May 2020 14:32:10 +0000 (+0200) Subject: smbd: pass dirfsp to create_file_unixpath() X-Git-Tag: ldb-2.2.0~428 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f5fd73846931b7de90e1d5decf46a6e92cc6f21;p=thirdparty%2Fsamba.git smbd: pass dirfsp to create_file_unixpath() As the calls to * lease_match() * open_streams_for_delete() * check_base_file_access * SMB_VFS_STAT and others needs to be updated to work with atnames in the future, 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 bd54b1b24ad..3ff21526b3b 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -5377,6 +5377,7 @@ static NTSTATUS lease_match(connection_struct *conn, static NTSTATUS create_file_unixpath(connection_struct *conn, struct smb_request *req, + struct files_struct **dirfsp, struct smb_filename *smb_fname, uint32_t access_mask, uint32_t share_access, @@ -5399,6 +5400,8 @@ static NTSTATUS create_file_unixpath(connection_struct *conn, files_struct *fsp = NULL; NTSTATUS status; + SMB_ASSERT(*dirfsp == conn->cwd_fsp); + DBG_DEBUG("create_file_unixpath: access_mask = 0x%x " "file_attributes = 0x%x, share_access = 0x%x, " "create_disposition = 0x%x create_options = 0x%x " @@ -5574,6 +5577,7 @@ static NTSTATUS create_file_unixpath(connection_struct *conn, /* Open the base file. */ status = create_file_unixpath(conn, NULL, + dirfsp, smb_fname_base, 0, FILE_SHARE_READ @@ -5985,6 +5989,7 @@ NTSTATUS create_file_default(connection_struct *conn, status = create_file_unixpath(conn, req, + _dirfsp, smb_fname, access_mask, share_access,