From 5a052edf031d2c02b018743f0947a12b4df16c2d Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Wed, 14 Feb 2007 02:37:14 +0000 Subject: r21324: Add linux setlease to the vfs layer. Next round, as Volker points out, it should be abstracted a little higher up so other os'es can have an entry, but it will take a bit more work. Thanks to Chetan Shringarpure and Mathias Dietz. I didn't increment the vfs number again because the kernel change notify stuff hasn't been released yet anyway. (This used to be commit 9463211bf3b46ee408b88dfbf42d498e3839d4cc) --- source3/modules/vfs_full_audit.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source3/modules/vfs_full_audit.c') diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index e632040dc1..6036e49fc1 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -160,6 +160,8 @@ static BOOL smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, in static int smb_full_audit_kernel_flock(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, uint32 share_mode); +static int smb_full_audit_linux_setlease(vfs_handle_struct *handle, files_struct *fsp, + int fd, int leasetype); static BOOL smb_full_audit_getlock(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid); static int smb_full_audit_symlink(vfs_handle_struct *handle, @@ -381,6 +383,8 @@ static vfs_op_tuple audit_op_tuples[] = { SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_kernel_flock), SMB_VFS_OP_KERNEL_FLOCK, SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(smb_full_audit_linux_setlease), SMB_VFS_OP_LINUX_SETLEASE, + SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_getlock), SMB_VFS_OP_GETLOCK, SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_symlink), SMB_VFS_OP_SYMLINK, @@ -549,6 +553,7 @@ static struct { { SMB_VFS_OP_FTRUNCATE, "ftruncate" }, { SMB_VFS_OP_LOCK, "lock" }, { SMB_VFS_OP_KERNEL_FLOCK, "kernel_flock" }, + { SMB_VFS_OP_LINUX_SETLEASE, "linux_setlease" }, { SMB_VFS_OP_GETLOCK, "getlock" }, { SMB_VFS_OP_SYMLINK, "symlink" }, { SMB_VFS_OP_READLINK, "readlink" }, @@ -1313,6 +1318,19 @@ static int smb_full_audit_kernel_flock(struct vfs_handle_struct *handle, return result; } +static int smb_full_audit_linux_setlease(vfs_handle_struct *handle, files_struct *fsp, + int fd, int leasetype) +{ + int result; + + result = SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, fd, leasetype); + + do_log(SMB_VFS_OP_LINUX_SETLEASE, (result >= 0), handle, "%s", + fsp->fsp_name); + + return result; +} + static BOOL smb_full_audit_getlock(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid) { -- cgit