From b65e37dc01d7afa007768f7cadfcf3b7c1007664 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Wed, 26 Nov 2014 14:30:37 +0100 Subject: s3:vfs: add SMB_VFS_READDIR_ATTR() SMB_VFS_READDIR_ATTR is a last minute hook to fetch additional metadata for a directory entry when we're already marshalling the SMB reply buffer. This would be used, when there's a need to repurpose some fields in the the reply, like it's done with Apple's SMB2 extension "AAPL". Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- examples/VFS/skel_opaque.c | 9 +++++++++ examples/VFS/skel_transparent.c | 9 +++++++++ 2 files changed, 18 insertions(+) (limited to 'examples') diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index 47b46a4db75..6e15a0675b7 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -633,6 +633,14 @@ static NTSTATUS skel_fsctl(struct vfs_handle_struct *handle, return NT_STATUS_NOT_IMPLEMENTED; } +static NTSTATUS skel_readdir_attr(struct vfs_handle_struct *handle, + const struct smb_filename *fname, + TALLOC_CTX *mem_ctx, + struct readdir_attr_data **pattr_data) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32 security_info, TALLOC_CTX *mem_ctx, @@ -896,6 +904,7 @@ struct vfs_fn_pointers skel_opaque_fns = { .strict_unlock_fn = skel_strict_unlock, .translate_name_fn = skel_translate_name, .fsctl_fn = skel_fsctl, + .readdir_attr_fn = skel_readdir_attr, /* NT ACL operations. */ diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index fbb1323a6ea..b11e29c342a 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -759,6 +759,14 @@ static NTSTATUS skel_fsctl(struct vfs_handle_struct *handle, in_len, _out_data, max_out_len, out_len); } +static NTSTATUS skel_readdir_attr(struct vfs_handle_struct *handle, + const struct smb_filename *fname, + TALLOC_CTX *mem_ctx, + struct readdir_attr_data **pattr_data) +{ + return SMB_VFS_NEXT_READDIR_ATTR(handle, fname, mem_ctx, pattr_data); +} + static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32 security_info, TALLOC_CTX *mem_ctx, @@ -1005,6 +1013,7 @@ struct vfs_fn_pointers skel_transparent_fns = { .strict_unlock_fn = skel_strict_unlock, .translate_name_fn = skel_translate_name, .fsctl_fn = skel_fsctl, + .readdir_attr_fn = skel_readdir_attr, /* NT ACL operations. */ -- cgit v1.2.1