mirror of
https://github.com/samba-team/samba.git
synced 2025-03-27 22:50:26 +03:00
smbd: add dirfsp arg to SMB_VFS_CREATE_FILE()
As create_file_default() still need to be updated in the future to replace the SMB_VFS_STAT() calls with AT-based versions, it asserts (dirfsp == dirfsp->conn->cwd_fsp). Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
a947b67d78
commit
44cd415921
@ -200,6 +200,7 @@ static int skel_open(vfs_handle_struct *handle, struct smb_filename *smb_fname,
|
||||
|
||||
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,
|
||||
|
@ -208,6 +208,7 @@ static int skel_open(vfs_handle_struct *handle, struct smb_filename *smb_fname,
|
||||
|
||||
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,
|
||||
@ -226,6 +227,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,
|
||||
|
@ -321,6 +321,7 @@
|
||||
* Version 43 - Move SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT().
|
||||
* Version 43 - Remove root_dir_fid from SMB_VFS_CREATE_FILE().
|
||||
* Version 43 - Add dirfsp to struct files_struct
|
||||
* Version 43 - Add dirfsp args to SMB_VFS_CREATE_FILE()
|
||||
*/
|
||||
|
||||
#define SMB_VFS_INTERFACE_VERSION 43
|
||||
@ -765,6 +766,7 @@ struct vfs_fn_pointers {
|
||||
int flags, 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,
|
||||
@ -1276,6 +1278,7 @@ int smb_vfs_call_open(struct vfs_handle_struct *handle,
|
||||
int flags, 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,
|
||||
@ -1730,6 +1733,7 @@ int vfs_not_implemented_open(vfs_handle_struct *handle,
|
||||
files_struct *fsp, int flags, 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,
|
||||
|
@ -147,14 +147,14 @@
|
||||
#define SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode) \
|
||||
smb_vfs_call_open((handle)->next, (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))
|
||||
|
||||
|
@ -1109,6 +1109,7 @@ static bool ad_convert_xattr(vfs_handle_struct *handle,
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
handle->conn, /* conn */
|
||||
NULL, /* req */
|
||||
&handle->conn->cwd_fsp, /* dirfsp */
|
||||
stream_name, /* fname */
|
||||
FILE_GENERIC_WRITE, /* access_mask */
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */
|
||||
@ -1238,6 +1239,7 @@ static bool ad_convert_finderinfo(vfs_handle_struct *handle,
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
handle->conn, /* conn */
|
||||
NULL, /* req */
|
||||
&handle->conn->cwd_fsp, /* dirfsp */
|
||||
stream_name, /* fname */
|
||||
FILE_GENERIC_WRITE, /* access_mask */
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */
|
||||
@ -1468,6 +1470,7 @@ static bool ad_unconvert_open_ad(TALLOC_CTX *mem_ctx,
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
handle->conn,
|
||||
NULL, /* req */
|
||||
&handle->conn->cwd_fsp, /* dirfsp */
|
||||
adpath,
|
||||
FILE_READ_DATA|FILE_WRITE_DATA,
|
||||
FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
|
||||
@ -1519,6 +1522,7 @@ static bool ad_unconvert_get_streams(struct vfs_handle_struct *handle,
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
handle->conn, /* conn */
|
||||
NULL, /* req */
|
||||
&handle->conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname, /* fname */
|
||||
FILE_READ_ATTRIBUTES, /* access_mask */
|
||||
(FILE_SHARE_READ | FILE_SHARE_WRITE | /* share_access */
|
||||
@ -1618,6 +1622,7 @@ static bool ad_collect_one_stream(struct vfs_handle_struct *handle,
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
handle->conn,
|
||||
NULL, /* req */
|
||||
&handle->conn->cwd_fsp, /* dirfsp */
|
||||
sname,
|
||||
FILE_READ_DATA|DELETE_ACCESS,
|
||||
FILE_SHARE_READ,
|
||||
@ -2079,6 +2084,7 @@ static int ad_open_rsrc(vfs_handle_struct *handle,
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
handle->conn, /* conn */
|
||||
NULL, /* req */
|
||||
&handle->conn->cwd_fsp, /* dirfsp */
|
||||
adp_smb_fname,
|
||||
access_mask,
|
||||
share_access,
|
||||
|
@ -690,6 +690,7 @@ static int vfswrap_open(vfs_handle_struct *handle,
|
||||
|
||||
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,
|
||||
@ -707,7 +708,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,
|
||||
|
@ -898,6 +898,7 @@ static bool readdir_attr_meta_finderi_stream(
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
handle->conn, /* conn */
|
||||
NULL, /* req */
|
||||
&handle->conn->cwd_fsp, /* dirfsp */
|
||||
stream_name, /* fname */
|
||||
FILE_READ_DATA, /* access_mask */
|
||||
(FILE_SHARE_READ | FILE_SHARE_WRITE | /* share_access */
|
||||
@ -3883,6 +3884,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,
|
||||
@ -3937,7 +3939,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,
|
||||
@ -4702,6 +4704,7 @@ static bool fruit_get_bandsize(vfs_handle_struct *handle,
|
||||
status = SMB_VFS_NEXT_CREATE_FILE(
|
||||
handle, /* conn */
|
||||
NULL, /* req */
|
||||
&handle->conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname, /* fname */
|
||||
FILE_GENERIC_READ, /* access_mask */
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */
|
||||
|
@ -1093,6 +1093,7 @@ static int smb_full_audit_open(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,
|
||||
@ -1139,6 +1140,7 @@ static NTSTATUS smb_full_audit_create_file(vfs_handle_struct *handle,
|
||||
result = SMB_VFS_NEXT_CREATE_FILE(
|
||||
handle, /* handle */
|
||||
req, /* req */
|
||||
dirfsp,
|
||||
smb_fname, /* fname */
|
||||
access_mask, /* access_mask */
|
||||
share_access, /* share_access */
|
||||
|
@ -1105,6 +1105,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,
|
||||
@ -1134,6 +1135,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,
|
||||
@ -1172,6 +1174,7 @@ static NTSTATUS mh_create_file(vfs_handle_struct *handle,
|
||||
status = SMB_VFS_NEXT_CREATE_FILE(
|
||||
handle,
|
||||
req,
|
||||
dirfsp,
|
||||
clientFname,
|
||||
access_mask,
|
||||
share_access,
|
||||
|
@ -198,6 +198,7 @@ int vfs_not_implemented_open(vfs_handle_struct *handle,
|
||||
|
||||
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,
|
||||
|
@ -607,6 +607,7 @@ static int smb_time_audit_open(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,
|
||||
@ -632,6 +633,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 */
|
||||
|
@ -826,6 +826,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,
|
||||
@ -853,6 +854,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,
|
||||
@ -887,6 +889,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,
|
||||
|
@ -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,
|
||||
|
@ -843,6 +843,7 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
NULL, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname, /* fname */
|
||||
FILE_GENERIC_READ, /* access_mask */
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */
|
||||
@ -897,6 +898,7 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
NULL, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname, /* fname */
|
||||
FILE_GENERIC_READ, /* access_mask */
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */
|
||||
@ -1100,6 +1102,7 @@ static uint32_t get_correct_cversion(const struct auth_session_info *session_inf
|
||||
nt_status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
NULL, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname, /* fname */
|
||||
FILE_GENERIC_READ, /* access_mask */
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */
|
||||
|
@ -2430,6 +2430,7 @@ WERROR _srvsvc_NetGetFileSecurity(struct pipes_struct *p,
|
||||
nt_status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
NULL, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname, /* fname */
|
||||
FILE_READ_ATTRIBUTES, /* access_mask */
|
||||
FILE_SHARE_READ|FILE_SHARE_WRITE, /* share_access */
|
||||
@ -2565,6 +2566,7 @@ WERROR _srvsvc_NetSetFileSecurity(struct pipes_struct *p,
|
||||
nt_status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
NULL, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname, /* fname */
|
||||
FILE_WRITE_ATTRIBUTES, /* access_mask */
|
||||
FILE_SHARE_READ|FILE_SHARE_WRITE, /* share_access */
|
||||
|
@ -1410,6 +1410,7 @@ static NTSTATUS get_file_handle_for_metadata(connection_struct *conn,
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
NULL, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname_cp, /* fname */
|
||||
FILE_WRITE_ATTRIBUTES, /* access_mask */
|
||||
(FILE_SHARE_READ | FILE_SHARE_WRITE | /* share_access */
|
||||
|
@ -656,6 +656,7 @@ void reply_ntcreate_and_X(struct smb_request *req)
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
req, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname, /* fname */
|
||||
access_mask, /* access_mask */
|
||||
share_access, /* share_access */
|
||||
@ -1338,6 +1339,7 @@ static void call_nt_transact_create(connection_struct *conn,
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
req, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname, /* fname */
|
||||
access_mask, /* access_mask */
|
||||
share_access, /* share_access */
|
||||
@ -1596,6 +1598,7 @@ static NTSTATUS copy_internals(TALLOC_CTX *ctx,
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
req, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname_src, /* fname */
|
||||
FILE_READ_DATA|FILE_READ_ATTRIBUTES|
|
||||
FILE_READ_EA, /* access_mask */
|
||||
@ -1621,6 +1624,7 @@ static NTSTATUS copy_internals(TALLOC_CTX *ctx,
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
req, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname_dst, /* fname */
|
||||
FILE_WRITE_DATA|FILE_WRITE_ATTRIBUTES|
|
||||
FILE_WRITE_EA, /* access_mask */
|
||||
|
@ -4628,6 +4628,7 @@ NTSTATUS create_directory(connection_struct *conn, struct smb_request *req,
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
req, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_dname, /* fname */
|
||||
FILE_READ_ATTRIBUTES, /* access_mask */
|
||||
FILE_SHARE_NONE, /* share_access */
|
||||
@ -4820,6 +4821,7 @@ static NTSTATUS open_streams_for_delete(connection_struct *conn,
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
NULL, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname_cp, /* fname */
|
||||
DELETE_ACCESS, /* access_mask */
|
||||
(FILE_SHARE_READ | /* share_access */
|
||||
@ -5826,6 +5828,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,
|
||||
@ -5848,6 +5851,9 @@ NTSTATUS create_file_default(connection_struct *conn,
|
||||
NTSTATUS status;
|
||||
bool stream_name = false;
|
||||
struct smb2_create_blob *posx = NULL;
|
||||
struct files_struct *dirfsp = *_dirfsp;
|
||||
|
||||
SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp);
|
||||
|
||||
DBG_DEBUG("create_file: access_mask = 0x%x "
|
||||
"file_attributes = 0x%x, share_access = 0x%x, "
|
||||
@ -5855,6 +5861,7 @@ NTSTATUS create_file_default(connection_struct *conn,
|
||||
"oplock_request = 0x%x "
|
||||
"private_flags = 0x%x "
|
||||
"ea_list = %p, sd = %p, "
|
||||
"dirfsp = %s, "
|
||||
"fname = %s\n",
|
||||
(unsigned int)access_mask,
|
||||
(unsigned int)file_attributes,
|
||||
@ -5863,7 +5870,10 @@ NTSTATUS create_file_default(connection_struct *conn,
|
||||
(unsigned int)create_options,
|
||||
(unsigned int)oplock_request,
|
||||
(unsigned int)private_flags,
|
||||
ea_list, sd, smb_fname_str_dbg(smb_fname));
|
||||
ea_list,
|
||||
sd,
|
||||
fsp_str_dbg(dirfsp),
|
||||
smb_fname_str_dbg(smb_fname));
|
||||
|
||||
if (req != NULL) {
|
||||
/*
|
||||
|
@ -751,6 +751,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,
|
||||
|
@ -1899,6 +1899,7 @@ void reply_search(struct smb_request *req)
|
||||
nt_status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
req, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_dname, /* dname */
|
||||
FILE_LIST_DIRECTORY, /* access_mask */
|
||||
FILE_SHARE_READ|
|
||||
@ -2284,6 +2285,7 @@ void reply_open(struct smb_request *req)
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
req, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname, /* fname */
|
||||
access_mask, /* access_mask */
|
||||
share_mode, /* share_access */
|
||||
@ -2474,6 +2476,7 @@ void reply_open_and_X(struct smb_request *req)
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
req, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname, /* fname */
|
||||
access_mask, /* access_mask */
|
||||
share_mode, /* share_access */
|
||||
@ -2905,6 +2908,7 @@ void reply_mknew(struct smb_request *req)
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
req, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname, /* fname */
|
||||
access_mask, /* access_mask */
|
||||
share_mode, /* share_access */
|
||||
@ -3041,6 +3045,7 @@ void reply_ctemp(struct smb_request *req)
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
req, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname, /* fname */
|
||||
FILE_GENERIC_READ | FILE_GENERIC_WRITE, /* access_mask */
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */
|
||||
@ -3285,6 +3290,7 @@ static NTSTATUS do_unlink(connection_struct *conn,
|
||||
status = SMB_VFS_CREATE_FILE
|
||||
(conn, /* conn */
|
||||
req, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname, /* fname */
|
||||
DELETE_ACCESS, /* access_mask */
|
||||
FILE_SHARE_NONE, /* share_access */
|
||||
@ -7208,6 +7214,7 @@ void reply_rmdir(struct smb_request *req)
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
req, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_dname, /* fname */
|
||||
DELETE_ACCESS, /* access_mask */
|
||||
(FILE_SHARE_READ | FILE_SHARE_WRITE | /* share_access */
|
||||
@ -8047,6 +8054,7 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
req, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname_src, /* fname */
|
||||
access_mask, /* access_mask */
|
||||
(FILE_SHARE_READ | /* share_access */
|
||||
@ -8213,6 +8221,7 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
req, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname_src, /* fname */
|
||||
access_mask, /* access_mask */
|
||||
(FILE_SHARE_READ | /* share_access */
|
||||
@ -8521,6 +8530,7 @@ NTSTATUS copy_file(TALLOC_CTX *ctx,
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
NULL, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname_src, /* fname */
|
||||
FILE_GENERIC_READ, /* access_mask */
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */
|
||||
@ -8551,6 +8561,7 @@ NTSTATUS copy_file(TALLOC_CTX *ctx,
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
NULL, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname_dst, /* fname */
|
||||
FILE_GENERIC_WRITE, /* access_mask */
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */
|
||||
|
@ -989,6 +989,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
|
||||
|
||||
status = SMB_VFS_CREATE_FILE(smb1req->conn,
|
||||
smb1req,
|
||||
&smb1req->conn->cwd_fsp,
|
||||
smb_fname,
|
||||
in_desired_access,
|
||||
in_share_access,
|
||||
|
@ -166,6 +166,7 @@ static NTSTATUS get_posix_fsp(connection_struct *conn,
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
req, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname_tmp, /* fname */
|
||||
access_mask, /* access_mask */
|
||||
share_access, /* share_access */
|
||||
@ -1436,6 +1437,7 @@ static void call_trans2open(connection_struct *conn,
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
req, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname, /* fname */
|
||||
access_mask, /* access_mask */
|
||||
share_mode, /* share_access */
|
||||
@ -2971,6 +2973,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 */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_dname, /* dname */
|
||||
FILE_LIST_DIRECTORY, /* access_mask */
|
||||
FILE_SHARE_READ|
|
||||
@ -6737,6 +6740,7 @@ static NTSTATUS smb_set_file_size(connection_struct *conn,
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
req, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname_tmp, /* fname */
|
||||
FILE_WRITE_DATA, /* access_mask */
|
||||
(FILE_SHARE_READ | FILE_SHARE_WRITE | /* share_access */
|
||||
@ -8013,6 +8017,7 @@ static NTSTATUS smb_set_file_allocation_info(connection_struct *conn,
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
req, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname, /* fname */
|
||||
FILE_WRITE_DATA, /* access_mask */
|
||||
(FILE_SHARE_READ | FILE_SHARE_WRITE | /* share_access */
|
||||
@ -8526,6 +8531,7 @@ static NTSTATUS smb_posix_mkdir(connection_struct *conn,
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
req, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname, /* fname */
|
||||
FILE_READ_ATTRIBUTES, /* access_mask */
|
||||
FILE_SHARE_NONE, /* share_access */
|
||||
@ -8767,6 +8773,7 @@ static NTSTATUS smb_posix_open(connection_struct *conn,
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
req, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname, /* fname */
|
||||
access_mask, /* access_mask */
|
||||
(FILE_SHARE_READ | FILE_SHARE_WRITE | /* share_access */
|
||||
@ -8909,6 +8916,7 @@ static NTSTATUS smb_posix_unlink(connection_struct *conn,
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
conn, /* conn */
|
||||
req, /* req */
|
||||
&conn->cwd_fsp, /* dirfsp */
|
||||
smb_fname, /* fname */
|
||||
DELETE_ACCESS, /* access_mask */
|
||||
(FILE_SHARE_READ | FILE_SHARE_WRITE | /* share_access */
|
||||
|
@ -1726,6 +1726,7 @@ int smb_vfs_call_open(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,
|
||||
@ -1745,8 +1746,8 @@ 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, access_mask,
|
||||
share_access, create_disposition, create_options,
|
||||
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);
|
||||
|
@ -244,6 +244,7 @@ static int net_vfs_get_ntacl(struct net_context *net,
|
||||
status = SMB_VFS_CREATE_FILE(
|
||||
state.conn_tos->conn,
|
||||
NULL, /* req */
|
||||
&state.conn_tos->conn->cwd_fsp,
|
||||
smb_fname,
|
||||
FILE_READ_ATTRIBUTES|READ_CONTROL_ACCESS,
|
||||
FILE_SHARE_READ|FILE_SHARE_WRITE,
|
||||
|
Loading…
x
Reference in New Issue
Block a user