summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_full_audit.c
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2009-01-26 15:39:40 -0800
committerTim Prouty <tprouty@samba.org>2009-01-29 15:29:33 -0800
commitb8f7cdbd79918bba0fea181f97fff5ab0c79192d (patch)
tree6716b36bb6421e0cff45dc224a1705bb396e8dd2 /source3/modules/vfs_full_audit.c
parentaeb23872e25fb720140a10ce01a4211d228b6555 (diff)
downloadsamba-b8f7cdbd79918bba0fea181f97fff5ab0c79192d.tar.gz
samba-b8f7cdbd79918bba0fea181f97fff5ab0c79192d.tar.bz2
samba-b8f7cdbd79918bba0fea181f97fff5ab0c79192d.zip
s3: Add a new SMB_VFS_GET_ALLOC_SIZE vfs operation
This allows module implementors to customize what allocation size is returned to the client.
Diffstat (limited to 'source3/modules/vfs_full_audit.c')
-rw-r--r--source3/modules/vfs_full_audit.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 73758a2d9d..c6d62fdd87 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -155,6 +155,8 @@ static int smb_full_audit_fstat(vfs_handle_struct *handle, files_struct *fsp,
SMB_STRUCT_STAT *sbuf);
static int smb_full_audit_lstat(vfs_handle_struct *handle,
const char *path, SMB_STRUCT_STAT *sbuf);
+static int smb_full_audit_get_alloc_size(vfs_handle_struct *handle,
+ files_struct *fsp, const SMB_STRUCT_STAT *sbuf);
static int smb_full_audit_unlink(vfs_handle_struct *handle,
const char *path);
static int smb_full_audit_chmod(vfs_handle_struct *handle,
@@ -403,6 +405,8 @@ static vfs_op_tuple audit_op_tuples[] = {
SMB_VFS_LAYER_LOGGER},
{SMB_VFS_OP(smb_full_audit_lstat), SMB_VFS_OP_LSTAT,
SMB_VFS_LAYER_LOGGER},
+ {SMB_VFS_OP(smb_full_audit_get_alloc_size), SMB_VFS_OP_GET_ALLOC_SIZE,
+ SMB_VFS_LAYER_LOGGER},
{SMB_VFS_OP(smb_full_audit_unlink), SMB_VFS_OP_UNLINK,
SMB_VFS_LAYER_LOGGER},
{SMB_VFS_OP(smb_full_audit_chmod), SMB_VFS_OP_CHMOD,
@@ -597,6 +601,7 @@ static struct {
{ SMB_VFS_OP_STAT, "stat" },
{ SMB_VFS_OP_FSTAT, "fstat" },
{ SMB_VFS_OP_LSTAT, "lstat" },
+ { SMB_VFS_OP_GET_ALLOC_SIZE, "get_alloc_size" },
{ SMB_VFS_OP_UNLINK, "unlink" },
{ SMB_VFS_OP_CHMOD, "chmod" },
{ SMB_VFS_OP_FCHMOD, "fchmod" },
@@ -1325,6 +1330,18 @@ static int smb_full_audit_lstat(vfs_handle_struct *handle,
return result;
}
+static int smb_full_audit_get_alloc_size(vfs_handle_struct *handle,
+ files_struct *fsp, const SMB_STRUCT_STAT *sbuf)
+{
+ int result;
+
+ result = SMB_VFS_NEXT_GET_ALLOC_SIZE(handle, fsp, sbuf);
+
+ do_log(SMB_VFS_OP_GET_ALLOC_SIZE, (result >= 0), handle, "%d", result);
+
+ return result;
+}
+
static int smb_full_audit_unlink(vfs_handle_struct *handle,
const char *path)
{