summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-09-10 12:44:01 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-09-12 07:06:01 +0200
commite8375ddf2d29b12cfe84ceec7195de957d0a743c (patch)
tree0f25cb893ec23796eeab197889bc251b0bec2db5 /examples
parent6638d1036688f7b0f15a1a18c9a251ab0a7ab626 (diff)
downloadsamba-e8375ddf2d29b12cfe84ceec7195de957d0a743c.tar.gz
samba-e8375ddf2d29b12cfe84ceec7195de957d0a743c.tar.bz2
samba-e8375ddf2d29b12cfe84ceec7195de957d0a743c.zip
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 <abartlet@samba.org> Autobuild-Date(master): Wed Sep 12 07:06:01 CEST 2012 on sn-devel-104
Diffstat (limited to 'examples')
-rw-r--r--examples/VFS/skel_opaque.c15
-rw-r--r--examples/VFS/skel_transparent.c18
2 files changed, 33 insertions, 0 deletions
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,