Skip to content

Commit

Permalink
s3-smbd: Remove sys_acl_*() VFS wrapper functions
Browse files Browse the repository at this point in the history
We no longer do struct smb_acl_t manipuations via the VFS layer,
which is now reduced to handling the get/set functions.

The only backend that implemented these functions (aside from audit)
was the vfs_default module calling the sys_acl code.  The various ACL
implementation modules either worked on the fully initilaised
smb_acl_t object or on NT ACLs.

This not only makes the operation of the posix ACL code more efficient
(as allocation and free is not put via the VFS), it makes it easier to
test and removes the fantasy that a module could safely redefine this
structure or the behaviour here.

The smb_acls.idl now defines the structure, and it is now allocated
with talloc.

These operations were originally added to the VFS in commit
3bb2191.

Andrew Bartlett
  • Loading branch information
abartlet committed Aug 15, 2012
1 parent a63a2a7 commit e25830d
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 1,271 deletions.
17 changes: 0 additions & 17 deletions docs-xml/manpages-3/vfs_full_audit.8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,28 +95,11 @@
<member>stat</member>
<member>statvfs</member>
<member>symlink</member>
<member>sys_acl_add_perm</member>
<member>sys_acl_clear_perms</member>
<member>sys_acl_create_entry</member>
<member>sys_acl_delete_def_file</member>
<member>sys_acl_free_acl</member>
<member>sys_acl_free_qualifier</member>
<member>sys_acl_free_text</member>
<member>sys_acl_get_entry</member>
<member>sys_acl_get_fd</member>
<member>sys_acl_get_file</member>
<member>sys_acl_get_perm</member>
<member>sys_acl_get_permset</member>
<member>sys_acl_get_qualifier</member>
<member>sys_acl_get_tag_type</member>
<member>sys_acl_init</member>
<member>sys_acl_set_fd</member>
<member>sys_acl_set_file</member>
<member>sys_acl_set_permset</member>
<member>sys_acl_set_qualifier</member>
<member>sys_acl_set_tag_type</member>
<member>sys_acl_to_text</member>
<member>sys_acl_valid</member>
<member>telldir</member>
<member>unlink</member>
<member>utime</member>
Expand Down
119 changes: 0 additions & 119 deletions examples/VFS/skel_opaque.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,30 +574,6 @@ static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, mode_t
return -1;
}

static int skel_sys_acl_get_entry(vfs_handle_struct *handle, SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p)
{
errno = ENOSYS;
return -1;
}

static int skel_sys_acl_get_tag_type(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p)
{
errno = ENOSYS;
return -1;
}

static int skel_sys_acl_get_permset(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p)
{
errno = ENOSYS;
return -1;
}

static void *skel_sys_acl_get_qualifier(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d)
{
errno = ENOSYS;
return NULL;
}

static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle, const char *path_p, SMB_ACL_TYPE_T type)
{
errno = ENOSYS;
Expand All @@ -610,60 +586,6 @@ static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fs
return (SMB_ACL_T)NULL;
}

static int skel_sys_acl_clear_perms(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset)
{
errno = ENOSYS;
return -1;
}

static int skel_sys_acl_add_perm(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm)
{
errno = ENOSYS;
return -1;
}

static char *skel_sys_acl_to_text(vfs_handle_struct *handle, SMB_ACL_T theacl, ssize_t *plen)
{
errno = ENOSYS;
return NULL;
}

static SMB_ACL_T skel_sys_acl_init(vfs_handle_struct *handle, int count)
{
errno = ENOSYS;
return (SMB_ACL_T)NULL;
}

static int skel_sys_acl_create_entry(vfs_handle_struct *handle, SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry)
{
errno = ENOSYS;
return -1;
}

static int skel_sys_acl_set_tag_type(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype)
{
errno = ENOSYS;
return -1;
}

static int skel_sys_acl_set_qualifier(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, void *qual)
{
errno = ENOSYS;
return -1;
}

static int skel_sys_acl_set_permset(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset)
{
errno = ENOSYS;
return -1;
}

static int skel_sys_acl_valid(vfs_handle_struct *handle, SMB_ACL_T theacl )
{
errno = ENOSYS;
return -1;
}

static int skel_sys_acl_set_file(vfs_handle_struct *handle, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
{
errno = ENOSYS;
Expand All @@ -682,30 +604,6 @@ static int skel_sys_acl_delete_def_file(vfs_handle_struct *handle, const char *
return -1;
}

static int skel_sys_acl_get_perm(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm)
{
errno = ENOSYS;
return -1;
}

static int skel_sys_acl_free_text(vfs_handle_struct *handle, char *text)
{
errno = ENOSYS;
return -1;
}

static int skel_sys_acl_free_acl(vfs_handle_struct *handle, SMB_ACL_T posix_acl)
{
errno = ENOSYS;
return -1;
}

static int skel_sys_acl_free_qualifier(vfs_handle_struct *handle, void *qualifier, SMB_ACL_TAG_T tagtype)
{
errno = ENOSYS;
return -1;
}

static ssize_t skel_getxattr(vfs_handle_struct *handle, const char *path, const char *name, void *value, size_t size)
{
errno = ENOSYS;
Expand Down Expand Up @@ -871,28 +769,11 @@ struct vfs_fn_pointers skel_opaque_fns = {
.chmod_acl_fn = skel_chmod_acl,
.fchmod_acl_fn = skel_fchmod_acl,

.sys_acl_get_entry_fn = skel_sys_acl_get_entry,
.sys_acl_get_tag_type_fn = skel_sys_acl_get_tag_type,
.sys_acl_get_permset_fn = skel_sys_acl_get_permset,
.sys_acl_get_qualifier_fn = skel_sys_acl_get_qualifier,
.sys_acl_get_file_fn = skel_sys_acl_get_file,
.sys_acl_get_fd_fn = skel_sys_acl_get_fd,
.sys_acl_clear_perms_fn = skel_sys_acl_clear_perms,
.sys_acl_add_perm_fn = skel_sys_acl_add_perm,
.sys_acl_to_text_fn = skel_sys_acl_to_text,
.sys_acl_init_fn = skel_sys_acl_init,
.sys_acl_create_entry_fn = skel_sys_acl_create_entry,
.sys_acl_set_tag_type_fn = skel_sys_acl_set_tag_type,
.sys_acl_set_qualifier_fn = skel_sys_acl_set_qualifier,
.sys_acl_set_permset_fn = skel_sys_acl_set_permset,
.sys_acl_valid_fn = skel_sys_acl_valid,
.sys_acl_set_file_fn = skel_sys_acl_set_file,
.sys_acl_set_fd_fn = skel_sys_acl_set_fd,
.sys_acl_delete_def_file_fn = skel_sys_acl_delete_def_file,
.sys_acl_get_perm_fn = skel_sys_acl_get_perm,
.sys_acl_free_text_fn = skel_sys_acl_free_text,
.sys_acl_free_acl_fn = skel_sys_acl_free_acl,
.sys_acl_free_qualifier_fn = skel_sys_acl_free_qualifier,

/* EA operations. */
.getxattr_fn = skel_getxattr,
Expand Down
102 changes: 0 additions & 102 deletions examples/VFS/skel_transparent.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,26 +689,6 @@ static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, mode_t
return SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode);
}

static int skel_sys_acl_get_entry(vfs_handle_struct *handle, SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p)
{
return SMB_VFS_NEXT_SYS_ACL_GET_ENTRY(handle, theacl, entry_id, entry_p);
}

static int skel_sys_acl_get_tag_type(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p)
{
return SMB_VFS_NEXT_SYS_ACL_GET_TAG_TYPE(handle, entry_d, tag_type_p);
}

static int skel_sys_acl_get_permset(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p)
{
return SMB_VFS_NEXT_SYS_ACL_GET_PERMSET(handle, entry_d, permset_p);
}

static void *skel_sys_acl_get_qualifier(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d)
{
return SMB_VFS_NEXT_SYS_ACL_GET_QUALIFIER(handle, entry_d);
}

static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle, const char *path_p, SMB_ACL_TYPE_T type)
{
return SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, path_p, type);
Expand All @@ -719,51 +699,6 @@ static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fs
return SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp);
}

static int skel_sys_acl_clear_perms(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset)
{
return SMB_VFS_NEXT_SYS_ACL_CLEAR_PERMS(handle, permset);
}

static int skel_sys_acl_add_perm(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm)
{
return SMB_VFS_NEXT_SYS_ACL_ADD_PERM(handle, permset, perm);
}

static char *skel_sys_acl_to_text(vfs_handle_struct *handle, SMB_ACL_T theacl, ssize_t *plen)
{
return SMB_VFS_NEXT_SYS_ACL_TO_TEXT(handle, theacl, plen);
}

static SMB_ACL_T skel_sys_acl_init(vfs_handle_struct *handle, int count)
{
return SMB_VFS_NEXT_SYS_ACL_INIT(handle, count);
}

static int skel_sys_acl_create_entry(vfs_handle_struct *handle, SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry)
{
return SMB_VFS_NEXT_SYS_ACL_CREATE_ENTRY(handle, pacl, pentry);
}

static int skel_sys_acl_set_tag_type(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype)
{
return SMB_VFS_NEXT_SYS_ACL_SET_TAG_TYPE(handle, entry, tagtype);
}

static int skel_sys_acl_set_qualifier(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, void *qual)
{
return SMB_VFS_NEXT_SYS_ACL_SET_QUALIFIER(handle, entry, qual);
}

static int skel_sys_acl_set_permset(vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset)
{
return SMB_VFS_NEXT_SYS_ACL_SET_PERMSET(handle, entry, permset);
}

static int skel_sys_acl_valid(vfs_handle_struct *handle, SMB_ACL_T theacl )
{
return SMB_VFS_NEXT_SYS_ACL_VALID(handle, theacl);
}

static int skel_sys_acl_set_file(vfs_handle_struct *handle, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
{
return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, acltype, theacl);
Expand All @@ -779,26 +714,6 @@ static int skel_sys_acl_delete_def_file(vfs_handle_struct *handle, const char *
return SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, path);
}

static int skel_sys_acl_get_perm(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm)
{
return SMB_VFS_NEXT_SYS_ACL_GET_PERM(handle, permset, perm);
}

static int skel_sys_acl_free_text(vfs_handle_struct *handle, char *text)
{
return SMB_VFS_NEXT_SYS_ACL_FREE_TEXT(handle, text);
}

static int skel_sys_acl_free_acl(vfs_handle_struct *handle, SMB_ACL_T posix_acl)
{
return SMB_VFS_NEXT_SYS_ACL_FREE_ACL(handle, posix_acl);
}

static int skel_sys_acl_free_qualifier(vfs_handle_struct *handle, void *qualifier, SMB_ACL_TAG_T tagtype)
{
return SMB_VFS_NEXT_SYS_ACL_FREE_QUALIFIER(handle, qualifier, tagtype);
}

static ssize_t skel_getxattr(vfs_handle_struct *handle, const char *path, const char *name, void *value, size_t size)
{
return SMB_VFS_NEXT_GETXATTR(handle, path, name, value, size);
Expand Down Expand Up @@ -952,28 +867,11 @@ struct vfs_fn_pointers skel_transparent_fns = {
.chmod_acl_fn = skel_chmod_acl,
.fchmod_acl_fn = skel_fchmod_acl,

.sys_acl_get_entry_fn = skel_sys_acl_get_entry,
.sys_acl_get_tag_type_fn = skel_sys_acl_get_tag_type,
.sys_acl_get_permset_fn = skel_sys_acl_get_permset,
.sys_acl_get_qualifier_fn = skel_sys_acl_get_qualifier,
.sys_acl_get_file_fn = skel_sys_acl_get_file,
.sys_acl_get_fd_fn = skel_sys_acl_get_fd,
.sys_acl_clear_perms_fn = skel_sys_acl_clear_perms,
.sys_acl_add_perm_fn = skel_sys_acl_add_perm,
.sys_acl_to_text_fn = skel_sys_acl_to_text,
.sys_acl_init_fn = skel_sys_acl_init,
.sys_acl_create_entry_fn = skel_sys_acl_create_entry,
.sys_acl_set_tag_type_fn = skel_sys_acl_set_tag_type,
.sys_acl_set_qualifier_fn = skel_sys_acl_set_qualifier,
.sys_acl_set_permset_fn = skel_sys_acl_set_permset,
.sys_acl_valid_fn = skel_sys_acl_valid,
.sys_acl_set_file_fn = skel_sys_acl_set_file,
.sys_acl_set_fd_fn = skel_sys_acl_set_fd,
.sys_acl_delete_def_file_fn = skel_sys_acl_delete_def_file,
.sys_acl_get_perm_fn = skel_sys_acl_get_perm,
.sys_acl_free_text_fn = skel_sys_acl_free_text,
.sys_acl_free_acl_fn = skel_sys_acl_free_acl,
.sys_acl_free_qualifier_fn = skel_sys_acl_free_qualifier,

/* EA operations. */
.getxattr_fn = skel_getxattr,
Expand Down
Loading

0 comments on commit e25830d

Please sign in to comment.