From e8375ddf2d29b12cfe84ceec7195de957d0a743c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 10 Sep 2012 12:44:01 +1000 Subject: smbd: Add extra VFS hooks to get the posix ACL as a blob This will allow us to hash this, rather than the NT ACL it maps to. This will in turn allow us to know if the NT ACL is valid even if we have to change the mapping code. Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Wed Sep 12 07:06:01 CEST 2012 on sn-devel-104 --- examples/VFS/skel_opaque.c | 15 +++++++++++++++ examples/VFS/skel_transparent.c | 18 ++++++++++++++++++ 2 files changed, 33 insertions(+) (limited to 'examples') diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index edfb772698..a786a234d4 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -586,6 +586,18 @@ 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_blob_get_file(vfs_handle_struct *handle, const char *path_p, SMB_ACL_TYPE_T type, TALLOC_CTX *mem_ctx, char **blob_description, DATA_BLOB *blob) +{ + errno = ENOSYS; + return -1; +} + +static int skel_sys_acl_blob_get_fd(vfs_handle_struct *handle, files_struct *fsp, TALLOC_CTX *mem_ctx, char **blob_description, DATA_BLOB *blob) +{ + 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; @@ -771,10 +783,13 @@ struct vfs_fn_pointers skel_opaque_fns = { .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, .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, + /* EA operations. */ .getxattr_fn = skel_getxattr, .fgetxattr_fn = skel_fgetxattr, diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 711b7fc139..02a994c07f 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -699,6 +699,22 @@ 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_blob_get_file(vfs_handle_struct *handle, const char *path_p, SMB_ACL_TYPE_T type, + TALLOC_CTX *mem_ctx, + char **blob_description, + DATA_BLOB *blob) +{ + return SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, path_p, type, mem_ctx, blob_description, blob); +} + +static int skel_sys_acl_blob_get_fd(vfs_handle_struct *handle, files_struct *fsp, + TALLOC_CTX *mem_ctx, + char **blob_description, + DATA_BLOB *blob) +{ + return SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FD(handle, fsp, mem_ctx, blob_description, blob); +} + 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); @@ -869,6 +885,8 @@ struct vfs_fn_pointers skel_transparent_fns = { .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, .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, -- cgit