mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
vfs3: Pass "lease" through SMB_VFS_CREATE_FILE
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
86f914679f
commit
446de4f680
@ -169,6 +169,7 @@ static NTSTATUS skel_create_file(struct vfs_handle_struct *handle,
|
||||
uint32_t create_options,
|
||||
uint32_t file_attributes,
|
||||
uint32_t oplock_request,
|
||||
struct smb2_lease *lease,
|
||||
uint64_t allocation_size,
|
||||
uint32_t private_flags,
|
||||
struct security_descriptor *sd,
|
||||
|
@ -164,6 +164,7 @@ static NTSTATUS skel_create_file(struct vfs_handle_struct *handle,
|
||||
uint32_t create_options,
|
||||
uint32_t file_attributes,
|
||||
uint32_t oplock_request,
|
||||
struct smb2_lease *lease,
|
||||
uint64_t allocation_size,
|
||||
uint32_t private_flags,
|
||||
struct security_descriptor *sd,
|
||||
@ -180,6 +181,7 @@ static NTSTATUS skel_create_file(struct vfs_handle_struct *handle,
|
||||
create_options,
|
||||
file_attributes,
|
||||
oplock_request,
|
||||
lease,
|
||||
allocation_size,
|
||||
private_flags,
|
||||
sd, ea_list, result, pinfo);
|
||||
|
@ -156,7 +156,10 @@
|
||||
fsp->pending_break_messages array */
|
||||
/* Leave at 31 - not yet released. add SMB_VFS_[GET/SET]_COMPRESSION() */
|
||||
|
||||
#define SMB_VFS_INTERFACE_VERSION 31
|
||||
/* Bump to version 32 - Samba 4.2 will ship with that. */
|
||||
/* Version 32 - Add "lease" to CREATE_FILE operation */
|
||||
|
||||
#define SMB_VFS_INTERFACE_VERSION 32
|
||||
|
||||
/*
|
||||
All intercepted VFS operations must be declared as static functions inside module source
|
||||
@ -535,6 +538,7 @@ struct vfs_fn_pointers {
|
||||
uint32_t create_options,
|
||||
uint32_t file_attributes,
|
||||
uint32_t oplock_request,
|
||||
struct smb2_lease *lease,
|
||||
uint64_t allocation_size,
|
||||
uint32_t private_flags,
|
||||
struct security_descriptor *sd,
|
||||
@ -940,6 +944,7 @@ NTSTATUS smb_vfs_call_create_file(struct vfs_handle_struct *handle,
|
||||
uint32_t create_options,
|
||||
uint32_t file_attributes,
|
||||
uint32_t oplock_request,
|
||||
struct smb2_lease *lease,
|
||||
uint64_t allocation_size,
|
||||
uint32_t private_flags,
|
||||
struct security_descriptor *sd,
|
||||
|
@ -136,13 +136,13 @@
|
||||
smb_vfs_call_open((handle)->next, (fname), (fsp), (flags), (mode))
|
||||
|
||||
#define SMB_VFS_CREATE_FILE(conn, req, root_dir_fid, smb_fname, access_mask, share_access, create_disposition, \
|
||||
create_options, file_attributes, oplock_request, allocation_size, private_flags, sd, ea_list, result, pinfo) \
|
||||
create_options, file_attributes, oplock_request, lease, allocation_size, private_flags, sd, ea_list, result, pinfo) \
|
||||
smb_vfs_call_create_file((conn)->vfs_handles, (req), (root_dir_fid), (smb_fname), (access_mask), (share_access), (create_disposition), \
|
||||
(create_options), (file_attributes), (oplock_request), (allocation_size), (private_flags), (sd), (ea_list), (result), (pinfo))
|
||||
(create_options), (file_attributes), (oplock_request), (lease), (allocation_size), (private_flags), (sd), (ea_list), (result), (pinfo))
|
||||
#define SMB_VFS_NEXT_CREATE_FILE(handle, req, root_dir_fid, smb_fname, access_mask, share_access, create_disposition, \
|
||||
create_options, file_attributes, oplock_request, allocation_size, private_flags, sd, ea_list, result, pinfo) \
|
||||
create_options, file_attributes, oplock_request, lease, allocation_size, private_flags, sd, ea_list, result, pinfo) \
|
||||
smb_vfs_call_create_file((handle)->next, (req), (root_dir_fid), (smb_fname), (access_mask), (share_access), (create_disposition), \
|
||||
(create_options), (file_attributes), (oplock_request), (allocation_size), (private_flags), (sd), (ea_list), (result), (pinfo))
|
||||
(create_options), (file_attributes), (oplock_request), (lease), (allocation_size), (private_flags), (sd), (ea_list), (result), (pinfo))
|
||||
|
||||
#define SMB_VFS_CLOSE(fsp) \
|
||||
smb_vfs_call_close((fsp)->conn->vfs_handles, (fsp))
|
||||
|
@ -517,6 +517,7 @@ static NTSTATUS vfswrap_create_file(vfs_handle_struct *handle,
|
||||
uint32_t create_options,
|
||||
uint32_t file_attributes,
|
||||
uint32_t oplock_request,
|
||||
struct smb2_lease *lease,
|
||||
uint64_t allocation_size,
|
||||
uint32_t private_flags,
|
||||
struct security_descriptor *sd,
|
||||
@ -527,7 +528,7 @@ static NTSTATUS vfswrap_create_file(vfs_handle_struct *handle,
|
||||
return create_file_default(handle->conn, req, root_dir_fid, smb_fname,
|
||||
access_mask, share_access,
|
||||
create_disposition, create_options,
|
||||
file_attributes, oplock_request,
|
||||
file_attributes, oplock_request, lease,
|
||||
allocation_size, private_flags,
|
||||
sd, ea_list, result,
|
||||
pinfo);
|
||||
|
@ -863,6 +863,7 @@ static NTSTATUS smb_full_audit_create_file(vfs_handle_struct *handle,
|
||||
uint32_t create_options,
|
||||
uint32_t file_attributes,
|
||||
uint32_t oplock_request,
|
||||
struct smb2_lease *lease,
|
||||
uint64_t allocation_size,
|
||||
uint32_t private_flags,
|
||||
struct security_descriptor *sd,
|
||||
@ -907,6 +908,7 @@ static NTSTATUS smb_full_audit_create_file(vfs_handle_struct *handle,
|
||||
create_options, /* create_options */
|
||||
file_attributes, /* file_attributes */
|
||||
oplock_request, /* oplock_request */
|
||||
lease, /* lease */
|
||||
allocation_size, /* allocation_size */
|
||||
private_flags,
|
||||
sd, /* sd */
|
||||
|
@ -1207,6 +1207,7 @@ static NTSTATUS mh_create_file(vfs_handle_struct *handle,
|
||||
uint32_t create_options,
|
||||
uint32_t file_attributes,
|
||||
uint32_t oplock_request,
|
||||
struct smb2_lease *lease,
|
||||
uint64_t allocation_size,
|
||||
uint32_t private_flags,
|
||||
struct security_descriptor *sd,
|
||||
@ -1234,6 +1235,7 @@ static NTSTATUS mh_create_file(vfs_handle_struct *handle,
|
||||
create_options,
|
||||
file_attributes,
|
||||
oplock_request,
|
||||
lease,
|
||||
allocation_size,
|
||||
private_flags,
|
||||
sd,
|
||||
@ -1270,6 +1272,7 @@ static NTSTATUS mh_create_file(vfs_handle_struct *handle,
|
||||
create_options,
|
||||
file_attributes,
|
||||
oplock_request,
|
||||
lease,
|
||||
allocation_size,
|
||||
private_flags,
|
||||
sd,
|
||||
|
@ -496,6 +496,7 @@ static NTSTATUS smb_time_audit_create_file(vfs_handle_struct *handle,
|
||||
uint32_t create_options,
|
||||
uint32_t file_attributes,
|
||||
uint32_t oplock_request,
|
||||
struct smb2_lease *lease,
|
||||
uint64_t allocation_size,
|
||||
uint32_t private_flags,
|
||||
struct security_descriptor *sd,
|
||||
@ -519,6 +520,7 @@ static NTSTATUS smb_time_audit_create_file(vfs_handle_struct *handle,
|
||||
create_options, /* create_options */
|
||||
file_attributes, /* file_attributes */
|
||||
oplock_request, /* oplock_request */
|
||||
lease, /* lease */
|
||||
allocation_size, /* allocation_size */
|
||||
private_flags,
|
||||
sd, /* sd */
|
||||
|
@ -32,6 +32,7 @@ static NTSTATUS vfs_worm_create_file(vfs_handle_struct *handle,
|
||||
uint32_t create_options,
|
||||
uint32_t file_attributes,
|
||||
uint32_t oplock_request,
|
||||
struct smb2_lease *lease,
|
||||
uint64_t allocation_size,
|
||||
uint32_t private_flags,
|
||||
struct security_descriptor *sd,
|
||||
@ -62,7 +63,7 @@ static NTSTATUS vfs_worm_create_file(vfs_handle_struct *handle,
|
||||
status = SMB_VFS_NEXT_CREATE_FILE(
|
||||
handle, req, root_dir_fid, smb_fname, access_mask,
|
||||
share_access, create_disposition, create_options,
|
||||
file_attributes, oplock_request, allocation_size,
|
||||
file_attributes, oplock_request, lease, allocation_size,
|
||||
private_flags, sd, ea_list, result, pinfo);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
return status;
|
||||
|
@ -531,6 +531,7 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr
|
||||
0, /* create_options */
|
||||
FILE_ATTRIBUTE_NORMAL, /* file_attributes */
|
||||
INTERNAL_OPEN_ONLY, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
0, /* allocation_size */
|
||||
0, /* private_flags */
|
||||
NULL, /* sd */
|
||||
@ -584,6 +585,7 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr
|
||||
0, /* create_options */
|
||||
FILE_ATTRIBUTE_NORMAL, /* file_attributes */
|
||||
INTERNAL_OPEN_ONLY, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
0, /* allocation_size */
|
||||
0, /* private_flags */
|
||||
NULL, /* sd */
|
||||
@ -762,6 +764,7 @@ static uint32 get_correct_cversion(struct auth_session_info *session_info,
|
||||
0, /* create_options */
|
||||
FILE_ATTRIBUTE_NORMAL, /* file_attributes */
|
||||
INTERNAL_OPEN_ONLY, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
0, /* private_flags */
|
||||
0, /* allocation_size */
|
||||
NULL, /* sd */
|
||||
|
@ -2359,6 +2359,7 @@ WERROR _srvsvc_NetGetFileSecurity(struct pipes_struct *p,
|
||||
0, /* create_options */
|
||||
0, /* file_attributes */
|
||||
INTERNAL_OPEN_ONLY, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
0, /* allocation_size */
|
||||
0, /* private_flags */
|
||||
NULL, /* sd */
|
||||
@ -2506,6 +2507,7 @@ WERROR _srvsvc_NetSetFileSecurity(struct pipes_struct *p,
|
||||
0, /* create_options */
|
||||
0, /* file_attributes */
|
||||
INTERNAL_OPEN_ONLY, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
0, /* allocation_size */
|
||||
0, /* private_flags */
|
||||
NULL, /* sd */
|
||||
|
@ -1128,6 +1128,7 @@ static NTSTATUS get_file_handle_for_metadata(connection_struct *conn,
|
||||
0, /* create_options */
|
||||
0, /* file_attributes */
|
||||
INTERNAL_OPEN_ONLY, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
0, /* allocation_size */
|
||||
0, /* private_flags */
|
||||
NULL, /* sd */
|
||||
|
@ -574,6 +574,7 @@ void reply_ntcreate_and_X(struct smb_request *req)
|
||||
create_options, /* create_options */
|
||||
file_attributes, /* file_attributes */
|
||||
oplock_request, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
allocation_size, /* allocation_size */
|
||||
0, /* private_flags */
|
||||
NULL, /* sd */
|
||||
@ -1180,6 +1181,7 @@ static void call_nt_transact_create(connection_struct *conn,
|
||||
create_options, /* create_options */
|
||||
file_attributes, /* file_attributes */
|
||||
oplock_request, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
allocation_size, /* allocation_size */
|
||||
0, /* private_flags */
|
||||
sd, /* sd */
|
||||
@ -1423,6 +1425,7 @@ static NTSTATUS copy_internals(TALLOC_CTX *ctx,
|
||||
0, /* create_options */
|
||||
FILE_ATTRIBUTE_NORMAL, /* file_attributes */
|
||||
NO_OPLOCK, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
0, /* allocation_size */
|
||||
0, /* private_flags */
|
||||
NULL, /* sd */
|
||||
@ -1447,6 +1450,7 @@ static NTSTATUS copy_internals(TALLOC_CTX *ctx,
|
||||
0, /* create_options */
|
||||
fattr, /* file_attributes */
|
||||
NO_OPLOCK, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
0, /* allocation_size */
|
||||
0, /* private_flags */
|
||||
NULL, /* sd */
|
||||
|
@ -3352,6 +3352,7 @@ NTSTATUS create_directory(connection_struct *conn, struct smb_request *req,
|
||||
FILE_DIRECTORY_FILE, /* create_options */
|
||||
FILE_ATTRIBUTE_DIRECTORY, /* file_attributes */
|
||||
0, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
0, /* allocation_size */
|
||||
0, /* private_flags */
|
||||
NULL, /* sd */
|
||||
@ -3530,6 +3531,7 @@ NTSTATUS open_streams_for_delete(connection_struct *conn,
|
||||
0, /* create_options */
|
||||
FILE_ATTRIBUTE_NORMAL, /* file_attributes */
|
||||
0, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
0, /* allocation_size */
|
||||
NTCREATEX_OPTIONS_PRIVATE_STREAM_DELETE, /* private_flags */
|
||||
NULL, /* sd */
|
||||
@ -4284,6 +4286,7 @@ NTSTATUS create_file_default(connection_struct *conn,
|
||||
uint32_t create_options,
|
||||
uint32_t file_attributes,
|
||||
uint32_t oplock_request,
|
||||
struct smb2_lease *lease,
|
||||
uint64_t allocation_size,
|
||||
uint32_t private_flags,
|
||||
struct security_descriptor *sd,
|
||||
|
@ -639,6 +639,7 @@ NTSTATUS create_file_default(connection_struct *conn,
|
||||
uint32_t create_options,
|
||||
uint32_t file_attributes,
|
||||
uint32_t oplock_request,
|
||||
struct smb2_lease *lease,
|
||||
uint64_t allocation_size,
|
||||
uint32_t private_flags,
|
||||
struct security_descriptor *sd,
|
||||
|
@ -1948,6 +1948,7 @@ void reply_open(struct smb_request *req)
|
||||
create_options, /* create_options */
|
||||
dos_attr, /* file_attributes */
|
||||
oplock_request, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
0, /* allocation_size */
|
||||
private_flags,
|
||||
NULL, /* sd */
|
||||
@ -2116,6 +2117,7 @@ void reply_open_and_X(struct smb_request *req)
|
||||
create_options, /* create_options */
|
||||
smb_attr, /* file_attributes */
|
||||
oplock_request, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
0, /* allocation_size */
|
||||
private_flags,
|
||||
NULL, /* sd */
|
||||
@ -2363,6 +2365,7 @@ void reply_mknew(struct smb_request *req)
|
||||
create_options, /* create_options */
|
||||
fattr, /* file_attributes */
|
||||
oplock_request, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
0, /* allocation_size */
|
||||
0, /* private_flags */
|
||||
NULL, /* sd */
|
||||
@ -2490,6 +2493,7 @@ void reply_ctemp(struct smb_request *req)
|
||||
0, /* create_options */
|
||||
fattr, /* file_attributes */
|
||||
oplock_request, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
0, /* allocation_size */
|
||||
0, /* private_flags */
|
||||
NULL, /* sd */
|
||||
@ -2707,6 +2711,7 @@ static NTSTATUS do_unlink(connection_struct *conn,
|
||||
posix_paths ? FILE_FLAG_POSIX_SEMANTICS|0777 :
|
||||
FILE_ATTRIBUTE_NORMAL,
|
||||
0, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
0, /* allocation_size */
|
||||
0, /* private_flags */
|
||||
NULL, /* sd */
|
||||
@ -5968,6 +5973,7 @@ void reply_rmdir(struct smb_request *req)
|
||||
FILE_DIRECTORY_FILE, /* create_options */
|
||||
FILE_ATTRIBUTE_DIRECTORY, /* file_attributes */
|
||||
0, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
0, /* allocation_size */
|
||||
0, /* private_flags */
|
||||
NULL, /* sd */
|
||||
@ -6735,6 +6741,7 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
|
||||
create_options, /* create_options */
|
||||
posix_pathnames ? FILE_FLAG_POSIX_SEMANTICS|0777 : 0, /* file_attributes */
|
||||
0, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
0, /* allocation_size */
|
||||
0, /* private_flags */
|
||||
NULL, /* sd */
|
||||
@ -6881,6 +6888,7 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
|
||||
create_options, /* create_options */
|
||||
posix_pathnames ? FILE_FLAG_POSIX_SEMANTICS|0777 : 0, /* file_attributes */
|
||||
0, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
0, /* allocation_size */
|
||||
0, /* private_flags */
|
||||
NULL, /* sd */
|
||||
@ -7150,6 +7158,7 @@ NTSTATUS copy_file(TALLOC_CTX *ctx,
|
||||
0, /* create_options */
|
||||
FILE_ATTRIBUTE_NORMAL, /* file_attributes */
|
||||
INTERNAL_OPEN_ONLY, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
0, /* allocation_size */
|
||||
0, /* private_flags */
|
||||
NULL, /* sd */
|
||||
@ -7179,6 +7188,7 @@ NTSTATUS copy_file(TALLOC_CTX *ctx,
|
||||
0, /* create_options */
|
||||
dosattrs, /* file_attributes */
|
||||
INTERNAL_OPEN_ONLY, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
0, /* allocation_size */
|
||||
0, /* private_flags */
|
||||
NULL, /* sd */
|
||||
|
@ -948,6 +948,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
|
||||
in_create_options,
|
||||
in_file_attributes,
|
||||
map_smb2_oplock_levels_to_samba(requested_oplock_level),
|
||||
NULL,
|
||||
allocation_size,
|
||||
0, /* private_flags */
|
||||
sec_desc,
|
||||
|
@ -1222,6 +1222,7 @@ static void call_trans2open(connection_struct *conn,
|
||||
create_options, /* create_options */
|
||||
open_attr, /* file_attributes */
|
||||
oplock_request, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
open_size, /* allocation_size */
|
||||
private_flags,
|
||||
NULL, /* sd */
|
||||
@ -5889,6 +5890,7 @@ static NTSTATUS smb_set_file_size(connection_struct *conn,
|
||||
0, /* create_options */
|
||||
FILE_ATTRIBUTE_NORMAL, /* file_attributes */
|
||||
0, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
0, /* allocation_size */
|
||||
0, /* private_flags */
|
||||
NULL, /* sd */
|
||||
@ -6874,6 +6876,7 @@ static NTSTATUS smb_set_file_allocation_info(connection_struct *conn,
|
||||
0, /* create_options */
|
||||
FILE_ATTRIBUTE_NORMAL, /* file_attributes */
|
||||
0, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
0, /* allocation_size */
|
||||
0, /* private_flags */
|
||||
NULL, /* sd */
|
||||
@ -7389,6 +7392,7 @@ static NTSTATUS smb_posix_mkdir(connection_struct *conn,
|
||||
FILE_DIRECTORY_FILE, /* create_options */
|
||||
mod_unixmode, /* file_attributes */
|
||||
0, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
0, /* allocation_size */
|
||||
0, /* private_flags */
|
||||
NULL, /* sd */
|
||||
@ -7621,6 +7625,7 @@ static NTSTATUS smb_posix_open(connection_struct *conn,
|
||||
create_options, /* create_options */
|
||||
mod_unixmode, /* file_attributes */
|
||||
oplock_request, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
0, /* allocation_size */
|
||||
0, /* private_flags */
|
||||
NULL, /* sd */
|
||||
@ -7751,6 +7756,7 @@ static NTSTATUS smb_posix_unlink(connection_struct *conn,
|
||||
create_options, /* create_options */
|
||||
FILE_FLAG_POSIX_SEMANTICS|0777, /* file_attributes */
|
||||
0, /* oplock_request */
|
||||
NULL, /* lease */
|
||||
0, /* allocation_size */
|
||||
0, /* private_flags */
|
||||
NULL, /* sd */
|
||||
|
@ -1542,6 +1542,7 @@ NTSTATUS smb_vfs_call_create_file(struct vfs_handle_struct *handle,
|
||||
uint32_t create_options,
|
||||
uint32_t file_attributes,
|
||||
uint32_t oplock_request,
|
||||
struct smb2_lease *lease,
|
||||
uint64_t allocation_size,
|
||||
uint32_t private_flags,
|
||||
struct security_descriptor *sd,
|
||||
@ -1553,7 +1554,7 @@ NTSTATUS smb_vfs_call_create_file(struct vfs_handle_struct *handle,
|
||||
return handle->fns->create_file_fn(
|
||||
handle, req, root_dir_fid, smb_fname, access_mask,
|
||||
share_access, create_disposition, create_options,
|
||||
file_attributes, oplock_request, allocation_size,
|
||||
file_attributes, oplock_request, lease, allocation_size,
|
||||
private_flags, sd, ea_list,
|
||||
result, pinfo);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user