diff options
| author | Ralph Boehme <slow@samba.org> | 2014-11-26 14:30:37 +0100 |
|---|---|---|
| committer | Jeremy Allison <jra@samba.org> | 2014-12-04 22:11:07 +0100 |
| commit | b65e37dc01d7afa007768f7cadfcf3b7c1007664 (patch) | |
| tree | ec45710c1b260aedc21a4f5767f4465ab0817edd /source3/include | |
| parent | 46431e390f8184c4207f48704e0a0bb5dcb38366 (diff) | |
| download | samba-b65e37dc01d7afa007768f7cadfcf3b7c1007664.tar.gz samba-b65e37dc01d7afa007768f7cadfcf3b7c1007664.tar.xz samba-b65e37dc01d7afa007768f7cadfcf3b7c1007664.zip | |
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 <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/include')
| -rw-r--r-- | source3/include/smb.h | 1 | ||||
| -rw-r--r-- | source3/include/vfs.h | 10 | ||||
| -rw-r--r-- | source3/include/vfs_macros.h | 5 |
3 files changed, 16 insertions, 0 deletions
diff --git a/source3/include/smb.h b/source3/include/smb.h index a6589dbac7..46e05c064d 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -152,6 +152,7 @@ struct sys_notify_context { /* Include VFS stuff */ #include "smb_acls.h" +#include "lib/readdir_attr.h" #include "vfs.h" struct current_user { diff --git a/source3/include/vfs.h b/source3/include/vfs.h index e7dc07998d..b10e9a54be 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -159,6 +159,7 @@ /* Bump to version 32 - Samba 4.2 will ship with that. */ /* Version 32 - Add "lease" to CREATE_FILE operation */ /* Version 32 - Add "lease" to struct files_struct */ +/* Version 32 - Add SMB_VFS_READDIR_ATTR() */ #define SMB_VFS_INTERFACE_VERSION 32 @@ -789,6 +790,11 @@ struct vfs_fn_pointers { TALLOC_CTX *mem_ctx, struct files_struct **fsp, DATA_BLOB *new_cookie); + + NTSTATUS (*readdir_attr_fn)(struct vfs_handle_struct *handle, + const struct smb_filename *fname, + TALLOC_CTX *mem_ctx, + struct readdir_attr_data **attr_data); }; /* @@ -1234,6 +1240,10 @@ NTSTATUS smb_vfs_call_durable_reconnect(struct vfs_handle_struct *handle, TALLOC_CTX *mem_ctx, struct files_struct **fsp, DATA_BLOB *new_cookie); +NTSTATUS smb_vfs_call_readdir_attr(struct vfs_handle_struct *handle, + const struct smb_filename *fname, + TALLOC_CTX *mem_ctx, + struct readdir_attr_data **attr_data); NTSTATUS smb_register_vfs(int version, const char *name, const struct vfs_fn_pointers *fns); diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index e2d494dca6..df676adaca 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -565,4 +565,9 @@ (smb1req), (op), (old_cookie), \ (mem_ctx), (fsp), (new_cookie)) +#define SMB_VFS_READDIR_ATTR(conn, fname, mem_ctx, attr_data) \ + smb_vfs_call_readdir_attr((conn)->vfs_handles, (fname), (mem_ctx), (attr_data)) +#define SMB_VFS_NEXT_READDIR_ATTR(conn, fname, mem_ctx, attr_data) \ + smb_vfs_call_readdir_attr((handle)->next, (fname), (mem_ctx), (attr_data)) + #endif /* _VFS_MACROS_H */ |
