mirror of
https://github.com/samba-team/samba.git
synced 2025-02-26 21:57:41 +03:00
s3: VFS: RIP SMB_VFS_SYS_ACL_GET_FILE()
(\ _ /) ( \ O / ) (// \\) X / \ /___\ _____/ \\_____ | + || | || | SMB_VFS_SYS_ || | ACL_GET_FILE() || | || | || | || | _ ___ _ || | | \ | | \ || | | | | | | || | |_/ | |_/ || | | \ | | || | | \ | | || | | \. _|_. | . || | || * * | * ** * ** |** ** \)),.,\(/.,(//,,..,,\||(,,.,\\,.((// Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
parent
b828784cae
commit
bb038f2b89
@ -788,15 +788,6 @@ static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
|
||||
return NT_STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle,
|
||||
const struct smb_filename *smb_fname,
|
||||
SMB_ACL_TYPE_T type,
|
||||
TALLOC_CTX *mem_ctx)
|
||||
{
|
||||
errno = ENOSYS;
|
||||
return (SMB_ACL_T) NULL;
|
||||
}
|
||||
|
||||
static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle,
|
||||
files_struct *fsp,
|
||||
SMB_ACL_TYPE_T type,
|
||||
@ -1082,7 +1073,6 @@ static struct vfs_fn_pointers skel_opaque_fns = {
|
||||
|
||||
/* POSIX ACL operations. */
|
||||
|
||||
.sys_acl_get_file_fn = skel_sys_acl_get_file,
|
||||
.sys_acl_get_fd_fn = skel_sys_acl_get_fd,
|
||||
.sys_acl_blob_get_file_fn = skel_sys_acl_blob_get_file,
|
||||
.sys_acl_blob_get_fd_fn = skel_sys_acl_blob_get_fd,
|
||||
|
@ -1051,14 +1051,6 @@ static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
|
||||
return SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd);
|
||||
}
|
||||
|
||||
static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle,
|
||||
const struct smb_filename *smb_fname,
|
||||
SMB_ACL_TYPE_T type,
|
||||
TALLOC_CTX *mem_ctx)
|
||||
{
|
||||
return SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, smb_fname, type, mem_ctx);
|
||||
}
|
||||
|
||||
static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle,
|
||||
files_struct *fsp,
|
||||
SMB_ACL_TYPE_T type,
|
||||
@ -1386,7 +1378,6 @@ static struct vfs_fn_pointers skel_transparent_fns = {
|
||||
|
||||
/* POSIX ACL operations. */
|
||||
|
||||
.sys_acl_get_file_fn = skel_sys_acl_get_file,
|
||||
.sys_acl_get_fd_fn = skel_sys_acl_get_fd,
|
||||
.sys_acl_blob_get_file_fn = skel_sys_acl_blob_get_file,
|
||||
.sys_acl_blob_get_fd_fn = skel_sys_acl_blob_get_fd,
|
||||
|
@ -356,6 +356,7 @@
|
||||
* Version 45 - Remove SMB_VFS_SYS_ACL_DELETE_DEF_FILE
|
||||
* Version 45 - Add SMB_VFS_PARENT_PATHNAME
|
||||
* Version 45 - Remove SMB_VFS_GET_NT_ACL_AT
|
||||
* Version 45 - Remove SYS_ACL_GET_FILE
|
||||
*/
|
||||
|
||||
#define SMB_VFS_INTERFACE_VERSION 45
|
||||
@ -1209,10 +1210,6 @@ struct vfs_fn_pointers {
|
||||
|
||||
/* POSIX ACL operations. */
|
||||
|
||||
SMB_ACL_T (*sys_acl_get_file_fn)(struct vfs_handle_struct *handle,
|
||||
const struct smb_filename *smb_fname,
|
||||
SMB_ACL_TYPE_T type,
|
||||
TALLOC_CTX *mem_ctx);
|
||||
SMB_ACL_T (*sys_acl_get_fd_fn)(struct vfs_handle_struct *handle,
|
||||
struct files_struct *fsp,
|
||||
SMB_ACL_TYPE_T type,
|
||||
@ -1721,10 +1718,6 @@ NTSTATUS smb_vfs_call_audit_file(struct vfs_handle_struct *handle,
|
||||
int smb_vfs_call_chmod_acl(struct vfs_handle_struct *handle,
|
||||
const struct smb_filename *file,
|
||||
mode_t mode);
|
||||
SMB_ACL_T smb_vfs_call_sys_acl_get_file(struct vfs_handle_struct *handle,
|
||||
const struct smb_filename *smb_fname,
|
||||
SMB_ACL_TYPE_T type,
|
||||
TALLOC_CTX *mem_ctx);
|
||||
SMB_ACL_T smb_vfs_call_sys_acl_get_fd(struct vfs_handle_struct *handle,
|
||||
struct files_struct *fsp,
|
||||
SMB_ACL_TYPE_T type,
|
||||
@ -2134,10 +2127,6 @@ NTSTATUS vfs_not_implemented_get_nt_acl_at(vfs_handle_struct *handle,
|
||||
NTSTATUS vfs_not_implemented_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
|
||||
uint32_t security_info_sent,
|
||||
const struct security_descriptor *psd);
|
||||
SMB_ACL_T vfs_not_implemented_sys_acl_get_file(vfs_handle_struct *handle,
|
||||
const struct smb_filename *smb_fname,
|
||||
SMB_ACL_TYPE_T type,
|
||||
TALLOC_CTX *mem_ctx);
|
||||
SMB_ACL_T vfs_not_implemented_sys_acl_get_fd(vfs_handle_struct *handle,
|
||||
files_struct *fsp,
|
||||
SMB_ACL_TYPE_T type,
|
||||
|
@ -484,11 +484,6 @@
|
||||
#define SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd) \
|
||||
smb_vfs_call_fset_nt_acl((handle)->next, (fsp), (security_info_sent), (psd))
|
||||
|
||||
#define SMB_VFS_SYS_ACL_GET_FILE(conn, smb_fname, type, mem_ctx) \
|
||||
smb_vfs_call_sys_acl_get_file((conn)->vfs_handles, (smb_fname), (type), (mem_ctx))
|
||||
#define SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, smb_fname, type, mem_ctx) \
|
||||
smb_vfs_call_sys_acl_get_file((handle)->next, (smb_fname), (type), (mem_ctx))
|
||||
|
||||
#define SMB_VFS_SYS_ACL_GET_FD(fsp, type, mem_ctx) \
|
||||
smb_vfs_call_sys_acl_get_fd((fsp)->conn->vfs_handles, (fsp), (type), (mem_ctx))
|
||||
#define SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp, type, mem_ctx) \
|
||||
|
@ -3220,14 +3220,6 @@ static NTSTATUS vfswrap_audit_file(struct vfs_handle_struct *handle,
|
||||
return NT_STATUS_OK; /* Nothing to do here ... */
|
||||
}
|
||||
|
||||
static SMB_ACL_T vfswrap_sys_acl_get_file(vfs_handle_struct *handle,
|
||||
const struct smb_filename *smb_fname,
|
||||
SMB_ACL_TYPE_T type,
|
||||
TALLOC_CTX *mem_ctx)
|
||||
{
|
||||
return sys_acl_get_file(handle, smb_fname, type, mem_ctx);
|
||||
}
|
||||
|
||||
static SMB_ACL_T vfswrap_sys_acl_get_fd(vfs_handle_struct *handle,
|
||||
files_struct *fsp,
|
||||
SMB_ACL_TYPE_T type,
|
||||
@ -3888,7 +3880,6 @@ static struct vfs_fn_pointers vfs_default_fns = {
|
||||
|
||||
/* POSIX ACL operations. */
|
||||
|
||||
.sys_acl_get_file_fn = vfswrap_sys_acl_get_file,
|
||||
.sys_acl_get_fd_fn = vfswrap_sys_acl_get_fd,
|
||||
.sys_acl_blob_get_file_fn = posix_sys_acl_blob_get_file,
|
||||
.sys_acl_blob_get_fd_fn = posix_sys_acl_blob_get_fd,
|
||||
|
@ -196,7 +196,6 @@ typedef enum _vfs_op_type {
|
||||
|
||||
/* POSIX ACL operations. */
|
||||
|
||||
SMB_VFS_OP_SYS_ACL_GET_FILE,
|
||||
SMB_VFS_OP_SYS_ACL_GET_FD,
|
||||
SMB_VFS_OP_SYS_ACL_BLOB_GET_FILE,
|
||||
SMB_VFS_OP_SYS_ACL_BLOB_GET_FD,
|
||||
@ -327,7 +326,6 @@ static struct {
|
||||
{ SMB_VFS_OP_FGET_NT_ACL, "fget_nt_acl" },
|
||||
{ SMB_VFS_OP_FSET_NT_ACL, "fset_nt_acl" },
|
||||
{ SMB_VFS_OP_AUDIT_FILE, "audit_file" },
|
||||
{ SMB_VFS_OP_SYS_ACL_GET_FILE, "sys_acl_get_file" },
|
||||
{ SMB_VFS_OP_SYS_ACL_GET_FD, "sys_acl_get_fd" },
|
||||
{ SMB_VFS_OP_SYS_ACL_BLOB_GET_FILE, "sys_acl_blob_get_file" },
|
||||
{ SMB_VFS_OP_SYS_ACL_BLOB_GET_FD, "sys_acl_blob_get_fd" },
|
||||
@ -2524,25 +2522,6 @@ static NTSTATUS smb_full_audit_audit_file(struct vfs_handle_struct *handle,
|
||||
return result;
|
||||
}
|
||||
|
||||
static SMB_ACL_T smb_full_audit_sys_acl_get_file(vfs_handle_struct *handle,
|
||||
const struct smb_filename *smb_fname,
|
||||
SMB_ACL_TYPE_T type,
|
||||
TALLOC_CTX *mem_ctx)
|
||||
{
|
||||
SMB_ACL_T result;
|
||||
|
||||
result = SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, smb_fname,
|
||||
type, mem_ctx);
|
||||
|
||||
do_log(SMB_VFS_OP_SYS_ACL_GET_FILE,
|
||||
(result != NULL),
|
||||
handle,
|
||||
"%s",
|
||||
smb_fname_str_do_log(handle->conn, smb_fname));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static SMB_ACL_T smb_full_audit_sys_acl_get_fd(vfs_handle_struct *handle,
|
||||
files_struct *fsp,
|
||||
SMB_ACL_TYPE_T type,
|
||||
@ -3001,7 +2980,6 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
|
||||
.fget_nt_acl_fn = smb_full_audit_fget_nt_acl,
|
||||
.fset_nt_acl_fn = smb_full_audit_fset_nt_acl,
|
||||
.audit_file_fn = smb_full_audit_audit_file,
|
||||
.sys_acl_get_file_fn = smb_full_audit_sys_acl_get_file,
|
||||
.sys_acl_get_fd_fn = smb_full_audit_sys_acl_get_fd,
|
||||
.sys_acl_blob_get_file_fn = smb_full_audit_sys_acl_blob_get_file,
|
||||
.sys_acl_blob_get_fd_fn = smb_full_audit_sys_acl_blob_get_fd,
|
||||
|
@ -792,15 +792,6 @@ NTSTATUS vfs_not_implemented_fset_nt_acl(vfs_handle_struct *handle, files_struct
|
||||
return NT_STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
SMB_ACL_T vfs_not_implemented_sys_acl_get_file(vfs_handle_struct *handle,
|
||||
const struct smb_filename *smb_fname,
|
||||
SMB_ACL_TYPE_T type,
|
||||
TALLOC_CTX *mem_ctx)
|
||||
{
|
||||
errno = ENOSYS;
|
||||
return (SMB_ACL_T) NULL;
|
||||
}
|
||||
|
||||
SMB_ACL_T vfs_not_implemented_sys_acl_get_fd(vfs_handle_struct *handle,
|
||||
files_struct *fsp,
|
||||
SMB_ACL_TYPE_T type,
|
||||
@ -1086,7 +1077,6 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = {
|
||||
|
||||
/* POSIX ACL operations. */
|
||||
|
||||
.sys_acl_get_file_fn = vfs_not_implemented_sys_acl_get_file,
|
||||
.sys_acl_get_fd_fn = vfs_not_implemented_sys_acl_get_fd,
|
||||
.sys_acl_blob_get_file_fn = vfs_not_implemented_sys_acl_blob_get_file,
|
||||
.sys_acl_blob_get_fd_fn = vfs_not_implemented_sys_acl_blob_get_fd,
|
||||
|
@ -2316,29 +2316,6 @@ static NTSTATUS smb_time_audit_audit_file(struct vfs_handle_struct *handle,
|
||||
return result;
|
||||
}
|
||||
|
||||
static SMB_ACL_T smb_time_audit_sys_acl_get_file(vfs_handle_struct *handle,
|
||||
const struct smb_filename *smb_fname,
|
||||
SMB_ACL_TYPE_T type,
|
||||
TALLOC_CTX *mem_ctx)
|
||||
{
|
||||
SMB_ACL_T result;
|
||||
struct timespec ts1,ts2;
|
||||
double timediff;
|
||||
|
||||
clock_gettime_mono(&ts1);
|
||||
result = SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, smb_fname,
|
||||
type, mem_ctx);
|
||||
clock_gettime_mono(&ts2);
|
||||
timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
|
||||
|
||||
if (timediff > audit_timeout) {
|
||||
smb_time_audit_log_fname("sys_acl_get_file", timediff,
|
||||
smb_fname->base_name);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static SMB_ACL_T smb_time_audit_sys_acl_get_fd(vfs_handle_struct *handle,
|
||||
files_struct *fsp,
|
||||
SMB_ACL_TYPE_T type,
|
||||
@ -2829,7 +2806,6 @@ static struct vfs_fn_pointers vfs_time_audit_fns = {
|
||||
.fget_nt_acl_fn = smb_time_audit_fget_nt_acl,
|
||||
.fset_nt_acl_fn = smb_time_audit_fset_nt_acl,
|
||||
.audit_file_fn = smb_time_audit_audit_file,
|
||||
.sys_acl_get_file_fn = smb_time_audit_sys_acl_get_file,
|
||||
.sys_acl_get_fd_fn = smb_time_audit_sys_acl_get_fd,
|
||||
.sys_acl_blob_get_file_fn = smb_time_audit_sys_acl_blob_get_file,
|
||||
.sys_acl_blob_get_fd_fn = smb_time_audit_sys_acl_blob_get_fd,
|
||||
|
@ -4537,26 +4537,12 @@ int posix_sys_acl_blob_get_file(vfs_handle_struct *handle,
|
||||
return -1;
|
||||
}
|
||||
|
||||
acl_wrapper.access_acl
|
||||
= smb_vfs_call_sys_acl_get_file(handle,
|
||||
smb_fname,
|
||||
SMB_ACL_TYPE_ACCESS,
|
||||
frame);
|
||||
|
||||
ret = smb_vfs_call_stat(handle, smb_fname);
|
||||
if (ret == -1) {
|
||||
TALLOC_FREE(frame);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (S_ISDIR(smb_fname->st.st_ex_mode)) {
|
||||
acl_wrapper.default_acl
|
||||
= smb_vfs_call_sys_acl_get_file(handle,
|
||||
smb_fname,
|
||||
SMB_ACL_TYPE_DEFAULT,
|
||||
frame);
|
||||
}
|
||||
|
||||
acl_wrapper.owner = smb_fname->st.st_ex_uid;
|
||||
acl_wrapper.group = smb_fname->st.st_ex_gid;
|
||||
acl_wrapper.mode = smb_fname->st.st_ex_mode;
|
||||
|
@ -2732,15 +2732,6 @@ NTSTATUS smb_vfs_call_audit_file(struct vfs_handle_struct *handle,
|
||||
access_denied);
|
||||
}
|
||||
|
||||
SMB_ACL_T smb_vfs_call_sys_acl_get_file(struct vfs_handle_struct *handle,
|
||||
const struct smb_filename *smb_fname,
|
||||
SMB_ACL_TYPE_T type,
|
||||
TALLOC_CTX *mem_ctx)
|
||||
{
|
||||
VFS_FIND(sys_acl_get_file);
|
||||
return handle->fns->sys_acl_get_file_fn(handle, smb_fname, type, mem_ctx);
|
||||
}
|
||||
|
||||
SMB_ACL_T smb_vfs_call_sys_acl_get_fd(struct vfs_handle_struct *handle,
|
||||
struct files_struct *fsp,
|
||||
SMB_ACL_TYPE_T type,
|
||||
|
Loading…
x
Reference in New Issue
Block a user