From: Ralph Boehme Date: Fri, 10 Apr 2020 13:36:34 +0000 (+0200) Subject: smbd: pass dirfsp to mkdir_internal() X-Git-Tag: ldb-2.2.0~423 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31a4a3a5ca8cf72cb75e5b9d610b569cd01cea29;p=thirdparty%2Fsamba.git smbd: pass dirfsp to mkdir_internal() Not really used for now and marked with SMB_ASSERT(dirfsp == conn->cwd_fsp) because it needs to be updated later to work with real dirfsp. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/open.c b/source3/smbd/open.c index b6787b1767b..5ebe6aa18c1 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -4111,6 +4111,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, } static NTSTATUS mkdir_internal(connection_struct *conn, + struct files_struct **dirfsp, struct smb_filename *smb_dname, uint32_t file_attributes) { @@ -4125,6 +4126,8 @@ static NTSTATUS mkdir_internal(connection_struct *conn, int ret; bool ok; + SMB_ASSERT(*dirfsp == conn->cwd_fsp); + if (!CAN_WRITE(conn) || (access_mask & ~(conn->share_access))) { DEBUG(5,("mkdir_internal: failing share access " "%s\n", lp_servicename(talloc_tos(), lp_sub, SNUM(conn)))); @@ -4343,7 +4346,7 @@ static NTSTATUS open_directory(connection_struct *conn, return status; } - status = mkdir_internal(conn, smb_dname, + status = mkdir_internal(conn, dirfsp, smb_dname, file_attributes); if (!NT_STATUS_IS_OK(status)) { @@ -4367,7 +4370,7 @@ static NTSTATUS open_directory(connection_struct *conn, status = NT_STATUS_OK; info = FILE_WAS_OPENED; } else { - status = mkdir_internal(conn, smb_dname, + status = mkdir_internal(conn, dirfsp, smb_dname, file_attributes); if (NT_STATUS_IS_OK(status)) {