From: Volker Lendecke Date: Tue, 23 Nov 2021 11:29:17 +0000 (+0100) Subject: Revert "vfs: remove dirfsp arg from SMB_VFS_CREATE_FILE()" X-Git-Tag: talloc-2.3.4~319 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6086a73f4e50fc12db1155e52f026a4ca0f8fc40;p=thirdparty%2Fsamba.git Revert "vfs: remove dirfsp arg from SMB_VFS_CREATE_FILE()" This reverts commit 322574834f1e71bc01f21be9059ca4d386517c84. Not strictly a revert anymore, but for future work we do need "dirfsp" in create_file_default() passed through the VFS. Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index 3c511ead769..23614b660d9 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -206,6 +206,7 @@ static int skel_openat(struct vfs_handle_struct *handle, static NTSTATUS skel_create_file(struct vfs_handle_struct *handle, struct smb_request *req, + struct files_struct *dirfsp, struct smb_filename *smb_fname, uint32_t access_mask, uint32_t share_access, diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 43d5e818378..9fc211c5e2e 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -214,6 +214,7 @@ static int skel_openat(struct vfs_handle_struct *handle, static NTSTATUS skel_create_file(struct vfs_handle_struct *handle, struct smb_request *req, + struct files_struct *dirfsp, struct smb_filename *smb_fname, uint32_t access_mask, uint32_t share_access, @@ -232,6 +233,7 @@ static NTSTATUS skel_create_file(struct vfs_handle_struct *handle, { return SMB_VFS_NEXT_CREATE_FILE(handle, req, + dirfsp, smb_fname, access_mask, share_access, diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 316a6c0ec73..841a930d309 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -371,6 +371,7 @@ from files_struct. * Version 47 - Add SMB_VFS_GET_REAL_FILENAME_AT * Version 47 - Replace SMB_VFS_GET_REAL_FILENAME with SMB_VFS_GET_REAL_FILENAME_AT + * Version 47 - Re-add dirfsp to CREATE_FILE */ #define SMB_VFS_INTERFACE_VERSION 47 @@ -975,6 +976,7 @@ struct vfs_fn_pointers { mode_t mode); NTSTATUS (*create_file_fn)(struct vfs_handle_struct *handle, struct smb_request *req, + struct files_struct *dirfsp, struct smb_filename *smb_fname, uint32_t access_mask, uint32_t share_access, @@ -1460,6 +1462,7 @@ int smb_vfs_call_openat(struct vfs_handle_struct *handle, mode_t mode); NTSTATUS smb_vfs_call_create_file(struct vfs_handle_struct *handle, struct smb_request *req, + struct files_struct *dirfsp, struct smb_filename *smb_fname, uint32_t access_mask, uint32_t share_access, @@ -1904,6 +1907,7 @@ int vfs_not_implemented_openat(vfs_handle_struct *handle, mode_t mode); NTSTATUS vfs_not_implemented_create_file(struct vfs_handle_struct *handle, struct smb_request *req, + struct files_struct *dirfsp, struct smb_filename *smb_fname, uint32_t access_mask, uint32_t share_access, diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index 43cfee814fd..840e77cf1b0 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -147,14 +147,14 @@ #define SMB_VFS_NEXT_OPENAT(handle, dirfsp, smb_fname, fsp, flags, mode) \ smb_vfs_call_openat((handle)->next, (dirfsp), (smb_fname), (fsp), (flags), (mode)) -#define SMB_VFS_CREATE_FILE(conn, req, smb_fname, access_mask, share_access, create_disposition, \ +#define SMB_VFS_CREATE_FILE(conn, req, dirfsp, smb_fname, access_mask, share_access, create_disposition, \ create_options, file_attributes, oplock_request, lease, allocation_size, private_flags, sd, ea_list, result, pinfo, in_context_blobs, out_context_blobs) \ - smb_vfs_call_create_file((conn)->vfs_handles, (req), (smb_fname), (access_mask), (share_access), (create_disposition), \ + smb_vfs_call_create_file((conn)->vfs_handles, (req), (dirfsp), (smb_fname), (access_mask), (share_access), (create_disposition), \ (create_options), (file_attributes), (oplock_request), (lease), (allocation_size), (private_flags), (sd), (ea_list), (result), (pinfo), \ (in_context_blobs), (out_context_blobs)) -#define SMB_VFS_NEXT_CREATE_FILE(handle, req, smb_fname, access_mask, share_access, create_disposition, \ +#define SMB_VFS_NEXT_CREATE_FILE(handle, req, dirfsp, smb_fname, access_mask, share_access, create_disposition, \ create_options, file_attributes, oplock_request, lease, allocation_size, private_flags, sd, ea_list, result, pinfo, in_context_blobs, out_context_blobs) \ - smb_vfs_call_create_file((handle)->next, (req), (smb_fname), (access_mask), (share_access), (create_disposition), \ + smb_vfs_call_create_file((handle)->next, (req), (dirfsp), (smb_fname), (access_mask), (share_access), (create_disposition), \ (create_options), (file_attributes), (oplock_request), (lease), (allocation_size), (private_flags), (sd), (ea_list), (result), (pinfo), \ (in_context_blobs), (out_context_blobs)) diff --git a/source3/lib/adouble.c b/source3/lib/adouble.c index ddc43fab0f4..b831464f5a9 100644 --- a/source3/lib/adouble.c +++ b/source3/lib/adouble.c @@ -1219,6 +1219,7 @@ static bool ad_convert_xattr(vfs_handle_struct *handle, status = SMB_VFS_CREATE_FILE( handle->conn, /* conn */ NULL, /* req */ + NULL, /* dirfsp */ stream_name, /* fname */ FILE_GENERIC_WRITE, /* access_mask */ FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */ @@ -1355,6 +1356,7 @@ static bool ad_convert_finderinfo(vfs_handle_struct *handle, status = SMB_VFS_CREATE_FILE( handle->conn, /* conn */ NULL, /* req */ + NULL, /* dirfsp */ stream_name, /* fname */ FILE_GENERIC_WRITE, /* access_mask */ FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */ @@ -1604,6 +1606,7 @@ static bool ad_unconvert_open_ad(TALLOC_CTX *mem_ctx, status = SMB_VFS_CREATE_FILE( handle->conn, NULL, /* req */ + NULL, /* dirfsp */ adpath, FILE_READ_DATA|FILE_WRITE_DATA, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, @@ -1660,6 +1663,7 @@ static bool ad_unconvert_get_streams(struct vfs_handle_struct *handle, status = SMB_VFS_CREATE_FILE( handle->conn, /* conn */ NULL, /* req */ + NULL, /* dirfsp */ smb_fname, /* fname */ FILE_READ_ATTRIBUTES, /* access_mask */ (FILE_SHARE_READ | FILE_SHARE_WRITE | /* share_access */ @@ -1755,6 +1759,7 @@ static bool ad_collect_one_stream(struct vfs_handle_struct *handle, status = SMB_VFS_CREATE_FILE( handle->conn, NULL, /* req */ + NULL, /* dirfsp */ sname, FILE_READ_DATA|DELETE_ACCESS, FILE_SHARE_READ, diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 400bd98cacb..d67a9fe4325 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -735,6 +735,7 @@ out: } static NTSTATUS vfswrap_create_file(vfs_handle_struct *handle, struct smb_request *req, + struct files_struct *dirfsp, struct smb_filename *smb_fname, uint32_t access_mask, uint32_t share_access, @@ -752,7 +753,7 @@ static NTSTATUS vfswrap_create_file(vfs_handle_struct *handle, const struct smb2_create_blobs *in_context_blobs, struct smb2_create_blobs *out_context_blobs) { - return create_file_default(handle->conn, req, smb_fname, + return create_file_default(handle->conn, req, dirfsp, smb_fname, access_mask, share_access, create_disposition, create_options, file_attributes, oplock_request, lease, diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index 81bc0cf4cc2..183c4e02371 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -964,6 +964,7 @@ static bool readdir_attr_meta_finderi_stream( status = SMB_VFS_CREATE_FILE( handle->conn, /* conn */ NULL, /* req */ + NULL, /* dirfsp */ stream_name, /* fname */ FILE_READ_DATA, /* access_mask */ (FILE_SHARE_READ | FILE_SHARE_WRITE | /* share_access */ @@ -4136,6 +4137,7 @@ static int fruit_ftruncate(struct vfs_handle_struct *handle, static NTSTATUS fruit_create_file(vfs_handle_struct *handle, struct smb_request *req, + struct files_struct *dirfsp, struct smb_filename *smb_fname, uint32_t access_mask, uint32_t share_access, @@ -4188,7 +4190,7 @@ static NTSTATUS fruit_create_file(vfs_handle_struct *handle, } status = SMB_VFS_NEXT_CREATE_FILE( - handle, req, smb_fname, + handle, req, dirfsp, smb_fname, access_mask, share_access, create_disposition, create_options, file_attributes, oplock_request, @@ -4957,6 +4959,7 @@ static bool fruit_get_bandsize(vfs_handle_struct *handle, status = SMB_VFS_NEXT_CREATE_FILE( handle, /* conn */ NULL, /* req */ + NULL, /* dirfsp */ smb_fname, /* fname */ FILE_GENERIC_READ, /* access_mask */ FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */ diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index dc013e7e3a1..af37cf19335 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -1119,6 +1119,7 @@ static int smb_full_audit_openat(vfs_handle_struct *handle, static NTSTATUS smb_full_audit_create_file(vfs_handle_struct *handle, struct smb_request *req, + struct files_struct *dirfsp, struct smb_filename *smb_fname, uint32_t access_mask, uint32_t share_access, @@ -1165,6 +1166,7 @@ static NTSTATUS smb_full_audit_create_file(vfs_handle_struct *handle, result = SMB_VFS_NEXT_CREATE_FILE( handle, /* handle */ req, /* req */ + dirfsp, /* dirfsp */ smb_fname, /* fname */ access_mask, /* access_mask */ share_access, /* share_access */ diff --git a/source3/modules/vfs_media_harmony.c b/source3/modules/vfs_media_harmony.c index a26db2beebc..38340daa3af 100644 --- a/source3/modules/vfs_media_harmony.c +++ b/source3/modules/vfs_media_harmony.c @@ -1116,6 +1116,7 @@ out: */ static NTSTATUS mh_create_file(vfs_handle_struct *handle, struct smb_request *req, + struct files_struct *dirfsp, struct smb_filename *smb_fname, uint32_t access_mask, uint32_t share_access, @@ -1145,6 +1146,7 @@ static NTSTATUS mh_create_file(vfs_handle_struct *handle, status = SMB_VFS_NEXT_CREATE_FILE( handle, req, + dirfsp, smb_fname, access_mask, share_access, @@ -1183,6 +1185,7 @@ static NTSTATUS mh_create_file(vfs_handle_struct *handle, status = SMB_VFS_NEXT_CREATE_FILE( handle, req, + dirfsp, clientFname, access_mask, share_access, diff --git a/source3/modules/vfs_not_implemented.c b/source3/modules/vfs_not_implemented.c index 9c72e417f26..3bfd86a9613 100644 --- a/source3/modules/vfs_not_implemented.c +++ b/source3/modules/vfs_not_implemented.c @@ -226,6 +226,7 @@ int vfs_not_implemented_openat(vfs_handle_struct *handle, _PUBLIC_ NTSTATUS vfs_not_implemented_create_file(struct vfs_handle_struct *handle, struct smb_request *req, + struct files_struct *dirsp, struct smb_filename *smb_fname, uint32_t access_mask, uint32_t share_access, diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c index 4f9ad52592f..481a9b0829f 100644 --- a/source3/modules/vfs_time_audit.c +++ b/source3/modules/vfs_time_audit.c @@ -647,6 +647,7 @@ static int smb_time_audit_openat(vfs_handle_struct *handle, static NTSTATUS smb_time_audit_create_file(vfs_handle_struct *handle, struct smb_request *req, + struct files_struct *dirfsp, struct smb_filename *fname, uint32_t access_mask, uint32_t share_access, @@ -672,6 +673,7 @@ static NTSTATUS smb_time_audit_create_file(vfs_handle_struct *handle, result = SMB_VFS_NEXT_CREATE_FILE( handle, /* handle */ req, /* req */ + dirfsp, /* dirfsp */ fname, /* fname */ access_mask, /* access_mask */ share_access, /* share_access */ diff --git a/source3/modules/vfs_unityed_media.c b/source3/modules/vfs_unityed_media.c index fbd4d968172..30200da9ae4 100644 --- a/source3/modules/vfs_unityed_media.c +++ b/source3/modules/vfs_unityed_media.c @@ -851,6 +851,7 @@ err: static NTSTATUS um_create_file(vfs_handle_struct *handle, struct smb_request *req, + struct files_struct *dirfsp, struct smb_filename *smb_fname, uint32_t access_mask, uint32_t share_access, @@ -878,6 +879,7 @@ static NTSTATUS um_create_file(vfs_handle_struct *handle, return SMB_VFS_NEXT_CREATE_FILE( handle, req, + dirfsp, smb_fname, access_mask, share_access, @@ -912,6 +914,7 @@ static NTSTATUS um_create_file(vfs_handle_struct *handle, status = SMB_VFS_NEXT_CREATE_FILE( handle, req, + dirfsp, client_fname, access_mask, share_access, diff --git a/source3/modules/vfs_worm.c b/source3/modules/vfs_worm.c index 76762e0a84f..833a0ac26fe 100644 --- a/source3/modules/vfs_worm.c +++ b/source3/modules/vfs_worm.c @@ -24,6 +24,7 @@ static NTSTATUS vfs_worm_create_file(vfs_handle_struct *handle, struct smb_request *req, + struct files_struct *dirfsp, struct smb_filename *smb_fname, uint32_t access_mask, uint32_t share_access, @@ -62,7 +63,7 @@ static NTSTATUS vfs_worm_create_file(vfs_handle_struct *handle, } status = SMB_VFS_NEXT_CREATE_FILE( - handle, req, smb_fname, access_mask, + handle, req, dirfsp, smb_fname, access_mask, share_access, create_disposition, create_options, file_attributes, oplock_request, lease, allocation_size, private_flags, sd, ea_list, result, pinfo, diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index c1d6458e36a..6961a4ddda9 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -830,6 +830,7 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr status = SMB_VFS_CREATE_FILE( conn, /* conn */ NULL, /* req */ + NULL, /* dirfsp */ smb_fname, /* fname */ FILE_GENERIC_READ, /* access_mask */ FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */ @@ -892,6 +893,7 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr status = SMB_VFS_CREATE_FILE( conn, /* conn */ NULL, /* req */ + NULL, /* dirfsp */ smb_fname, /* fname */ FILE_GENERIC_READ, /* access_mask */ FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */ @@ -1108,6 +1110,7 @@ static uint32_t get_correct_cversion(const struct auth_session_info *session_inf nt_status = SMB_VFS_CREATE_FILE( conn, /* conn */ NULL, /* req */ + NULL, /* dirfsp */ smb_fname, /* fname */ FILE_GENERIC_READ, /* access_mask */ FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */ diff --git a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c index ea296eaa6ab..e863bdf3dab 100644 --- a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c +++ b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c @@ -2482,6 +2482,7 @@ WERROR _srvsvc_NetGetFileSecurity(struct pipes_struct *p, nt_status = SMB_VFS_CREATE_FILE( conn, /* conn */ NULL, /* req */ + NULL, /* dirfsp */ smb_fname, /* fname */ FILE_READ_ATTRIBUTES, /* access_mask */ FILE_SHARE_READ|FILE_SHARE_WRITE, /* share_access */ @@ -2619,6 +2620,7 @@ WERROR _srvsvc_NetSetFileSecurity(struct pipes_struct *p, nt_status = SMB_VFS_CREATE_FILE( conn, /* conn */ NULL, /* req */ + NULL, /* dirfsp */ smb_fname, /* fname */ FILE_WRITE_ATTRIBUTES, /* access_mask */ FILE_SHARE_READ|FILE_SHARE_WRITE, /* share_access */ diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 056fa470b0d..e5d559f6c6b 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -4765,6 +4765,7 @@ NTSTATUS create_directory(connection_struct *conn, struct smb_request *req, status = SMB_VFS_CREATE_FILE( conn, /* conn */ req, /* req */ + NULL, /* dirfsp */ smb_dname, /* fname */ FILE_READ_ATTRIBUTES, /* access_mask */ FILE_SHARE_NONE, /* share_access */ @@ -5008,6 +5009,7 @@ static NTSTATUS open_streams_for_delete(connection_struct *conn, status = SMB_VFS_CREATE_FILE( conn, /* conn */ NULL, /* req */ + NULL, /* dirfsp */ smb_fname_cp, /* fname */ DELETE_ACCESS, /* access_mask */ (FILE_SHARE_READ | /* share_access */ @@ -6150,6 +6152,7 @@ static NTSTATUS create_file_unixpath(connection_struct *conn, NTSTATUS create_file_default(connection_struct *conn, struct smb_request *req, + struct files_struct *dirfsp, struct smb_filename *smb_fname, uint32_t access_mask, uint32_t share_access, diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 890e577e466..5d1b97e81af 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -743,6 +743,7 @@ struct fsp_lease *find_fsp_lease(struct files_struct *new_fsp, uint16_t lease_epoch); NTSTATUS create_file_default(connection_struct *conn, struct smb_request *req, + struct files_struct *dirfsp, struct smb_filename * smb_fname, uint32_t access_mask, uint32_t share_access, diff --git a/source3/smbd/smb1_nttrans.c b/source3/smbd/smb1_nttrans.c index c370da4c935..39783c4b3a1 100644 --- a/source3/smbd/smb1_nttrans.c +++ b/source3/smbd/smb1_nttrans.c @@ -653,6 +653,7 @@ void reply_ntcreate_and_X(struct smb_request *req) status = SMB_VFS_CREATE_FILE( conn, /* conn */ req, /* req */ + NULL, /* dirfsp */ smb_fname, /* fname */ access_mask, /* access_mask */ share_access, /* share_access */ @@ -1186,6 +1187,7 @@ static void call_nt_transact_create(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 */ diff --git a/source3/smbd/smb1_reply.c b/source3/smbd/smb1_reply.c index b99898fbad7..ec774e23ee3 100644 --- a/source3/smbd/smb1_reply.c +++ b/source3/smbd/smb1_reply.c @@ -1087,6 +1087,7 @@ void reply_search(struct smb_request *req) nt_status = SMB_VFS_CREATE_FILE( conn, /* conn */ req, /* req */ + NULL, /* dirfsp */ smb_dname, /* dname */ FILE_LIST_DIRECTORY, /* access_mask */ FILE_SHARE_READ| @@ -1465,6 +1466,7 @@ void reply_open(struct smb_request *req) status = SMB_VFS_CREATE_FILE( conn, /* conn */ req, /* req */ + NULL, /* dirfsp */ smb_fname, /* fname */ access_mask, /* access_mask */ share_mode, /* share_access */ @@ -1654,6 +1656,7 @@ void reply_open_and_X(struct smb_request *req) status = SMB_VFS_CREATE_FILE( conn, /* conn */ req, /* req */ + NULL, /* dirfsp */ smb_fname, /* fname */ access_mask, /* access_mask */ share_mode, /* share_access */ @@ -2084,6 +2087,7 @@ void reply_mknew(struct smb_request *req) status = SMB_VFS_CREATE_FILE( conn, /* conn */ req, /* req */ + NULL, /* dirfsp */ smb_fname, /* fname */ access_mask, /* access_mask */ share_mode, /* share_access */ @@ -2219,6 +2223,7 @@ void reply_ctemp(struct smb_request *req) status = SMB_VFS_CREATE_FILE( conn, /* conn */ req, /* req */ + NULL, /* dirfsp */ smb_fname, /* fname */ FILE_GENERIC_READ | FILE_GENERIC_WRITE, /* access_mask */ FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */ @@ -5858,6 +5863,7 @@ void reply_rmdir(struct smb_request *req) status = SMB_VFS_CREATE_FILE( conn, /* conn */ req, /* req */ + NULL, /* dirfsp */ smb_dname, /* fname */ DELETE_ACCESS, /* access_mask */ (FILE_SHARE_READ | FILE_SHARE_WRITE | /* share_access */ diff --git a/source3/smbd/smb1_trans2.c b/source3/smbd/smb1_trans2.c index 5edba322839..ea11788c783 100644 --- a/source3/smbd/smb1_trans2.c +++ b/source3/smbd/smb1_trans2.c @@ -660,6 +660,7 @@ static void call_trans2open(connection_struct *conn, status = SMB_VFS_CREATE_FILE( conn, /* conn */ req, /* req */ + NULL, /* dirfsp */ smb_fname, /* fname */ access_mask, /* access_mask */ share_mode, /* share_access */ @@ -1018,6 +1019,7 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd ntstatus = SMB_VFS_CREATE_FILE( conn, /* conn */ req, /* req */ + NULL, /* dirfsp */ smb_dname, /* dname */ FILE_LIST_DIRECTORY, /* access_mask */ FILE_SHARE_READ| @@ -2723,6 +2725,7 @@ static void call_trans2mkdir(connection_struct *conn, struct smb_request *req, status = SMB_VFS_CREATE_FILE( conn, /* conn */ req, /* req */ + NULL, /* dirfsp */ smb_dname, /* fname */ MAXIMUM_ALLOWED_ACCESS, /* access_mask */ FILE_SHARE_NONE, /* share_access */ diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c index 856bf9e50de..275f539af7f 100644 --- a/source3/smbd/smb2_create.c +++ b/source3/smbd/smb2_create.c @@ -1015,6 +1015,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx, status = SMB_VFS_CREATE_FILE(smb1req->conn, smb1req, + NULL, smb_fname, in_desired_access, in_share_access, diff --git a/source3/smbd/smb2_nttrans.c b/source3/smbd/smb2_nttrans.c index b8cb6424ca5..a7e4c0f5c85 100644 --- a/source3/smbd/smb2_nttrans.c +++ b/source3/smbd/smb2_nttrans.c @@ -246,6 +246,7 @@ NTSTATUS copy_internals(TALLOC_CTX *ctx, status = SMB_VFS_CREATE_FILE( conn, /* conn */ req, /* req */ + NULL, /* dirfsp */ smb_fname_src, /* fname */ FILE_READ_DATA|FILE_READ_ATTRIBUTES| FILE_READ_EA, /* access_mask */ @@ -271,6 +272,7 @@ NTSTATUS copy_internals(TALLOC_CTX *ctx, status = SMB_VFS_CREATE_FILE( conn, /* conn */ req, /* req */ + NULL, /* dirfsp */ smb_fname_dst, /* fname */ FILE_WRITE_DATA|FILE_WRITE_ATTRIBUTES| FILE_WRITE_EA, /* access_mask */ diff --git a/source3/smbd/smb2_reply.c b/source3/smbd/smb2_reply.c index 3f8eb74c9f0..5f3c9be41eb 100644 --- a/source3/smbd/smb2_reply.c +++ b/source3/smbd/smb2_reply.c @@ -844,6 +844,7 @@ NTSTATUS unlink_internals(connection_struct *conn, status = SMB_VFS_CREATE_FILE (conn, /* conn */ req, /* req */ + NULL, /* dirfsp */ smb_fname, /* fname */ DELETE_ACCESS, /* access_mask */ FILE_SHARE_NONE, /* share_access */ @@ -1779,6 +1780,7 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx, status = SMB_VFS_CREATE_FILE( conn, /* conn */ req, /* req */ + NULL, /* dirfsp */ smb_fname_src, /* fname */ access_mask, /* access_mask */ (FILE_SHARE_READ | /* share_access */ @@ -1904,6 +1906,7 @@ NTSTATUS copy_file(TALLOC_CTX *ctx, status = SMB_VFS_CREATE_FILE( conn, /* conn */ NULL, /* req */ + NULL, /* dirfsp */ smb_fname_src, /* fname */ FILE_GENERIC_READ, /* access_mask */ FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */ @@ -1941,6 +1944,7 @@ NTSTATUS copy_file(TALLOC_CTX *ctx, status = SMB_VFS_CREATE_FILE( conn, /* conn */ NULL, /* req */ + NULL, /* dirfsp */ smb_fname_dst, /* fname */ FILE_GENERIC_WRITE, /* access_mask */ FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */ diff --git a/source3/smbd/smb2_trans2.c b/source3/smbd/smb2_trans2.c index 65d8532468d..ba54c5ada6e 100644 --- a/source3/smbd/smb2_trans2.c +++ b/source3/smbd/smb2_trans2.c @@ -148,6 +148,7 @@ 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 */ @@ -4537,6 +4538,7 @@ static NTSTATUS smb_set_file_size(connection_struct *conn, status = SMB_VFS_CREATE_FILE( conn, /* conn */ req, /* req */ + NULL, /* dirfsp */ smb_fname, /* fname */ FILE_WRITE_DATA, /* access_mask */ (FILE_SHARE_READ | FILE_SHARE_WRITE | /* share_access */ @@ -5640,6 +5642,7 @@ static NTSTATUS smb_set_file_allocation_info(connection_struct *conn, status = SMB_VFS_CREATE_FILE( conn, /* conn */ req, /* req */ + NULL, /* dirfsp */ smb_fname, /* fname */ FILE_WRITE_DATA, /* access_mask */ (FILE_SHARE_READ | FILE_SHARE_WRITE | /* share_access */ @@ -6162,6 +6165,7 @@ static NTSTATUS smb_posix_mkdir(connection_struct *conn, status = SMB_VFS_CREATE_FILE( conn, /* conn */ req, /* req */ + NULL, /* dirfsp */ smb_fname, /* fname */ FILE_READ_ATTRIBUTES, /* access_mask */ FILE_SHARE_NONE, /* share_access */ @@ -6403,6 +6407,7 @@ static NTSTATUS smb_posix_open(connection_struct *conn, status = SMB_VFS_CREATE_FILE( conn, /* conn */ req, /* req */ + NULL, /* dirfsp */ smb_fname, /* fname */ access_mask, /* access_mask */ (FILE_SHARE_READ | FILE_SHARE_WRITE | /* share_access */ @@ -6545,6 +6550,7 @@ static NTSTATUS smb_posix_unlink(connection_struct *conn, status = SMB_VFS_CREATE_FILE( conn, /* conn */ req, /* req */ + NULL, /* dirfsp */ smb_fname, /* fname */ DELETE_ACCESS, /* access_mask */ (FILE_SHARE_READ | FILE_SHARE_WRITE | /* share_access */ diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 6ae68cdf878..1f46e9a2529 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -1688,6 +1688,7 @@ int smb_vfs_call_openat(struct vfs_handle_struct *handle, NTSTATUS smb_vfs_call_create_file(struct vfs_handle_struct *handle, struct smb_request *req, + struct files_struct *dirfsp, struct smb_filename *smb_fname, uint32_t access_mask, uint32_t share_access, @@ -1707,7 +1708,7 @@ NTSTATUS smb_vfs_call_create_file(struct vfs_handle_struct *handle, { VFS_FIND(create_file); return handle->fns->create_file_fn( - handle, req, smb_fname, + handle, req, dirfsp, smb_fname, access_mask, share_access, create_disposition, create_options, file_attributes, oplock_request, lease, allocation_size, private_flags, sd, ea_list, diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c index e0098442fbb..b27eca87ab4 100644 --- a/source3/torture/cmd_vfs.c +++ b/source3/torture/cmd_vfs.c @@ -2240,6 +2240,7 @@ static NTSTATUS cmd_create_file( status = SMB_VFS_CREATE_FILE( vfs->conn, NULL, + NULL, /* * Using fname->fsp->fsp_name seems to be legal, diff --git a/source3/utils/net_vfs.c b/source3/utils/net_vfs.c index 53e4583af39..90822bf368c 100644 --- a/source3/utils/net_vfs.c +++ b/source3/utils/net_vfs.c @@ -252,6 +252,7 @@ static int net_vfs_get_ntacl(struct net_context *net, status = SMB_VFS_CREATE_FILE( state.conn_tos->conn, NULL, /* req */ + NULL, smb_fname, FILE_READ_ATTRIBUTES|READ_CONTROL_ACCESS, FILE_SHARE_READ|FILE_SHARE_WRITE,