From 9d84a2356b1000b222f303e8cfd20badc998c8fb Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Fri, 2 Oct 2020 16:41:27 +0200 Subject: [PATCH] smbd: remove dirfsp arg from create_file_unixpath() Prepares for removing the dirfsp arg from SMB_VFS_CREATE_FILE() again. In the future dirfsp has to opened as needed within create_file_unixpath() and below. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- source3/smbd/open.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/source3/smbd/open.c b/source3/smbd/open.c index b22ed954f06..29d7025e3c7 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -5412,7 +5412,6 @@ 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, @@ -5435,8 +5434,6 @@ 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 " @@ -5612,7 +5609,6 @@ 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 @@ -5651,11 +5647,7 @@ static NTSTATUS create_file_unixpath(connection_struct *conn, goto fail; } - if (*dirfsp == fsp->conn->cwd_fsp) { - fsp->dirfsp = fsp->conn->cwd_fsp; - } else { - fsp->dirfsp = talloc_move(fsp, dirfsp); - } + fsp->dirfsp = fsp->conn->cwd_fsp; if (base_fsp) { /* @@ -6035,7 +6027,6 @@ NTSTATUS create_file_default(connection_struct *conn, status = create_file_unixpath(conn, req, - _dirfsp, smb_fname, access_mask, share_access, -- 2.47.3