From: Volker Lendecke Date: Tue, 3 Dec 2024 16:24:40 +0000 (+0100) Subject: smbd: Simplify get_posix_fsp() X-Git-Tag: tdb-1.4.13~316 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a780c07c24929f44aca3d47f5d72309a5696d392;p=thirdparty%2Fsamba.git smbd: Simplify get_posix_fsp() Remove three variables only set at initialization time Signed-off-by: Volker Lendecke Reviewed-by: Pavel Filipenský --- diff --git a/source3/smbd/smb1_trans2.c b/source3/smbd/smb1_trans2.c index 942aa2665c5..cb822d1dced 100644 --- a/source3/smbd/smb1_trans2.c +++ b/source3/smbd/smb1_trans2.c @@ -2193,10 +2193,6 @@ static NTSTATUS get_posix_fsp(connection_struct *conn, files_struct **ret_fsp) { NTSTATUS status; - uint32_t create_disposition = FILE_OPEN; - uint32_t share_access = FILE_SHARE_READ| - FILE_SHARE_WRITE| - FILE_SHARE_DELETE; struct smb2_create_blobs *posx = NULL; /* @@ -2204,7 +2200,6 @@ static NTSTATUS get_posix_fsp(connection_struct *conn, * but set reasonable defaults. */ uint32_t file_attributes = 0664; - uint32_t oplock = NO_OPLOCK; uint32_t create_options = FILE_NON_DIRECTORY_FILE; /* File or directory must exist. */ @@ -2234,25 +2229,26 @@ static NTSTATUS get_posix_fsp(connection_struct *conn, } status = SMB_VFS_CREATE_FILE( - conn, /* conn */ - req, /* req */ - NULL, /* dirfsp */ - smb_fname, /* fname */ - access_mask, /* access_mask */ - share_access, /* share_access */ - create_disposition,/* create_disposition*/ - create_options, /* create_options */ - file_attributes,/* file_attributes */ - oplock, /* oplock_request */ - NULL, /* lease */ - 0, /* allocation_size */ - 0, /* private_flags */ - NULL, /* sd */ - NULL, /* ea_list */ - ret_fsp, /* result */ - NULL, /* pinfo */ - posx, /* in_context */ - NULL); /* out_context */ + conn, /* conn */ + req, /* req */ + NULL, /* dirfsp */ + smb_fname, /* fname */ + access_mask, /* access_mask */ + FILE_SHARE_READ | FILE_SHARE_WRITE | + FILE_SHARE_DELETE, /* share_access */ + FILE_OPEN, /* create_disposition*/ + create_options, /* create_options */ + file_attributes, /* file_attributes */ + NO_OPLOCK, /* oplock_request */ + NULL, /* lease */ + 0, /* allocation_size */ + 0, /* private_flags */ + NULL, /* sd */ + NULL, /* ea_list */ + ret_fsp, /* result */ + NULL, /* pinfo */ + posx, /* in_context */ + NULL); /* out_context */ done: TALLOC_FREE(posx);