From 9e7dcbdbb76f76d310420734045f70828f60a63b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 29 Apr 2004 12:11:59 +0000 Subject: r404: Revert the change 378 to vfs_extd_audit.c, the parseable auditing Implement vfs_full_audit.c that can log every vfs.h operation. So if you change vfs.h, from now on you also have to change full_audit :-) Volker (This used to be commit 9cb9c5f7c97fe8f76735a77b321c9500d28b55b2) --- source3/modules/vfs_full_audit.c | 1758 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 1758 insertions(+) create mode 100644 source3/modules/vfs_full_audit.c (limited to 'source3/modules/vfs_full_audit.c') diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c new file mode 100644 index 0000000000..2371c40636 --- /dev/null +++ b/source3/modules/vfs_full_audit.c @@ -0,0 +1,1758 @@ +/* + * Auditing VFS module for samba. Log selected file operations to syslog + * facility. + * + * Copyright (C) Tim Potter, 1999-2000 + * Copyright (C) Alexander Bokovoy, 2002 + * Copyright (C) John H Terpstra, 2003 + * Copyright (C) Stefan (metze) Metzmacher, 2003 + * Copyright (C) Volker Lendecke, 2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#include "includes.h" + +extern struct current_user current_user; + +static int vfs_full_audit_debug_level = DBGC_VFS; + +#undef DBGC_CLASS +#define DBGC_CLASS vfs_full_audit_debug_level + +/* Function prototypes */ + +static int audit_connect(vfs_handle_struct *handle, connection_struct *conn, + const char *svc, const char *user); +static void audit_disconnect(vfs_handle_struct *handle, + connection_struct *conn); +static SMB_BIG_UINT audit_disk_free(vfs_handle_struct *handle, + connection_struct *conn, const char *path, + BOOL small_query, SMB_BIG_UINT *bsize, + SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize); +static int audit_get_quota(struct vfs_handle_struct *handle, + struct connection_struct *conn, + enum SMB_QUOTA_TYPE qtype, unid_t id, + SMB_DISK_QUOTA *qt); +static int audit_set_quota(struct vfs_handle_struct *handle, + struct connection_struct *conn, + enum SMB_QUOTA_TYPE qtype, unid_t id, + SMB_DISK_QUOTA *qt); +static DIR *audit_opendir(vfs_handle_struct *handle, connection_struct *conn, + const char *fname); +static struct dirent *audit_readdir(vfs_handle_struct *handle, + connection_struct *conn, DIR *dirp); +static int audit_mkdir(vfs_handle_struct *handle, connection_struct *conn, + const char *path, mode_t mode); +static int audit_rmdir(vfs_handle_struct *handle, connection_struct *conn, + const char *path); +static int audit_closedir(vfs_handle_struct *handle, connection_struct *conn, + DIR *dirp); +static int audit_open(vfs_handle_struct *handle, connection_struct *conn, + const char *fname, int flags, mode_t mode); +static int audit_close(vfs_handle_struct *handle, files_struct *fsp, int fd); +static ssize_t audit_read(vfs_handle_struct *handle, files_struct *fsp, + int fd, void *data, size_t n); +static ssize_t audit_pread(vfs_handle_struct *handle, files_struct *fsp, + int fd, void *data, size_t n, SMB_OFF_T offset); +static ssize_t audit_write(vfs_handle_struct *handle, files_struct *fsp, + int fd, const void *data, size_t n); +static ssize_t audit_pwrite(vfs_handle_struct *handle, files_struct *fsp, + int fd, const void *data, size_t n, + SMB_OFF_T offset); +static SMB_OFF_T audit_lseek(vfs_handle_struct *handle, files_struct *fsp, + int filedes, SMB_OFF_T offset, int whence); +static ssize_t audit_sendfile(vfs_handle_struct *handle, int tofd, + files_struct *fsp, int fromfd, + const DATA_BLOB *hdr, SMB_OFF_T offset, + size_t n); +static int audit_rename(vfs_handle_struct *handle, connection_struct *conn, + const char *old, const char *new); +static int audit_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd); +static int audit_stat(vfs_handle_struct *handle, connection_struct *conn, + const char *fname, SMB_STRUCT_STAT *sbuf); +static int audit_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd, + SMB_STRUCT_STAT *sbuf); +static int audit_lstat(vfs_handle_struct *handle, connection_struct *conn, + const char *path, SMB_STRUCT_STAT *sbuf); +static int audit_unlink(vfs_handle_struct *handle, connection_struct *conn, + const char *path); +static int audit_chmod(vfs_handle_struct *handle, connection_struct *conn, + const char *path, mode_t mode); +static int audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, + mode_t mode); +static int audit_chown(vfs_handle_struct *handle, connection_struct *conn, + const char *path, uid_t uid, gid_t gid); +static int audit_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd, + uid_t uid, gid_t gid); +static int audit_chdir(vfs_handle_struct *handle, connection_struct *conn, + const char *path); +static char *audit_getwd(vfs_handle_struct *handle, connection_struct *conn, + char *path); +static int audit_utime(vfs_handle_struct *handle, connection_struct *conn, + const char *path, struct utimbuf *times); +static int audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp, + int fd, SMB_OFF_T len); +static BOOL audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, + int op, SMB_OFF_T offset, SMB_OFF_T count, int type); +static int audit_symlink(vfs_handle_struct *handle, connection_struct *conn, + const char *oldpath, const char *newpath); +static int audit_readlink(vfs_handle_struct *handle, connection_struct *conn, + const char *path, char *buf, size_t bufsiz); +static int audit_link(vfs_handle_struct *handle, connection_struct *conn, + const char *oldpath, const char *newpath); +static int audit_mknod(vfs_handle_struct *handle, connection_struct *conn, + const char *pathname, mode_t mode, SMB_DEV_T dev); +static char *audit_realpath(vfs_handle_struct *handle, connection_struct *conn, + const char *path, char *resolved_path); +static size_t audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, + int fd, uint32 security_info, + SEC_DESC **ppdesc); +static size_t audit_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, + const char *name, uint32 security_info, + SEC_DESC **ppdesc); +static BOOL audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, + int fd, uint32 security_info_sent, + SEC_DESC *psd); +static BOOL audit_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, + const char *name, uint32 security_info_sent, + SEC_DESC *psd); +static int audit_chmod_acl(vfs_handle_struct *handle, connection_struct *conn, + const char *path, mode_t mode); +static int audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, + int fd, mode_t mode); +static int audit_sys_acl_get_entry(vfs_handle_struct *handle, + connection_struct *conn, + SMB_ACL_T theacl, int entry_id, + SMB_ACL_ENTRY_T *entry_p); +static int audit_sys_acl_get_tag_type(vfs_handle_struct *handle, + connection_struct *conn, + SMB_ACL_ENTRY_T entry_d, + SMB_ACL_TAG_T *tag_type_p); +static int audit_sys_acl_get_permset(vfs_handle_struct *handle, + connection_struct *conn, + SMB_ACL_ENTRY_T entry_d, + SMB_ACL_PERMSET_T *permset_p); +static void * audit_sys_acl_get_qualifier(vfs_handle_struct *handle, + connection_struct *conn, + SMB_ACL_ENTRY_T entry_d); +static SMB_ACL_T audit_sys_acl_get_file(vfs_handle_struct *handle, + connection_struct *conn, + const char *path_p, + SMB_ACL_TYPE_T type); +static SMB_ACL_T audit_sys_acl_get_fd(vfs_handle_struct *handle, + files_struct *fsp, + int fd); +static int audit_sys_acl_clear_perms(vfs_handle_struct *handle, + connection_struct *conn, + SMB_ACL_PERMSET_T permset); +static int audit_sys_acl_add_perm(vfs_handle_struct *handle, + connection_struct *conn, + SMB_ACL_PERMSET_T permset, + SMB_ACL_PERM_T perm); +static char * audit_sys_acl_to_text(vfs_handle_struct *handle, + connection_struct *conn, SMB_ACL_T theacl, + ssize_t *plen); +static SMB_ACL_T audit_sys_acl_init(vfs_handle_struct *handle, + connection_struct *conn, + int count); +static int audit_sys_acl_create_entry(vfs_handle_struct *handle, + connection_struct *conn, SMB_ACL_T *pacl, + SMB_ACL_ENTRY_T *pentry); +static int audit_sys_acl_set_tag_type(vfs_handle_struct *handle, + connection_struct *conn, + SMB_ACL_ENTRY_T entry, + SMB_ACL_TAG_T tagtype); +static int audit_sys_acl_set_qualifier(vfs_handle_struct *handle, + connection_struct *conn, + SMB_ACL_ENTRY_T entry, + void *qual); +static int audit_sys_acl_set_permset(vfs_handle_struct *handle, + connection_struct *conn, + SMB_ACL_ENTRY_T entry, + SMB_ACL_PERMSET_T permset); +static int audit_sys_acl_valid(vfs_handle_struct *handle, + connection_struct *conn, + SMB_ACL_T theacl ); +static int audit_sys_acl_set_file(vfs_handle_struct *handle, + connection_struct *conn, + const char *name, SMB_ACL_TYPE_T acltype, + SMB_ACL_T theacl); +static int audit_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, + int fd, SMB_ACL_T theacl); +static int audit_sys_acl_delete_def_file(vfs_handle_struct *handle, + connection_struct *conn, + const char *path); +static int audit_sys_acl_get_perm(vfs_handle_struct *handle, + connection_struct *conn, + SMB_ACL_PERMSET_T permset, + SMB_ACL_PERM_T perm); +static int audit_sys_acl_free_text(vfs_handle_struct *handle, + connection_struct *conn, + char *text); +static int audit_sys_acl_free_acl(vfs_handle_struct *handle, + connection_struct *conn, + SMB_ACL_T posix_acl); +static int audit_sys_acl_free_qualifier(vfs_handle_struct *handle, + connection_struct *conn, + void *qualifier, + SMB_ACL_TAG_T tagtype); +static ssize_t audit_getxattr(struct vfs_handle_struct *handle, + struct connection_struct *conn, const char *path, + const char *name, void *value, size_t size); +static ssize_t audit_lgetxattr(struct vfs_handle_struct *handle, + struct connection_struct *conn, + const char *path, const char *name, + void *value, size_t size); +static ssize_t audit_fgetxattr(struct vfs_handle_struct *handle, + struct files_struct *fsp, int fd, + const char *name, void *value, size_t size); +static ssize_t audit_listxattr(struct vfs_handle_struct *handle, + struct connection_struct *conn, + const char *path, char *list, size_t size); +static ssize_t audit_llistxattr(struct vfs_handle_struct *handle, + struct connection_struct *conn, + const char *path, char *list, size_t size); +static ssize_t audit_flistxattr(struct vfs_handle_struct *handle, + struct files_struct *fsp, int fd, char *list, + size_t size); +static int audit_removexattr(struct vfs_handle_struct *handle, + struct connection_struct *conn, const char *path, + const char *name); +static int audit_lremovexattr(struct vfs_handle_struct *handle, + struct connection_struct *conn, const char *path, + const char *name); +static int audit_fremovexattr(struct vfs_handle_struct *handle, + struct files_struct *fsp, int fd, + const char *name); +static int audit_setxattr(struct vfs_handle_struct *handle, + struct connection_struct *conn, const char *path, + const char *name, const void *value, size_t size, + int flags); +static int audit_lsetxattr(struct vfs_handle_struct *handle, + struct connection_struct *conn, const char *path, + const char *name, const void *value, size_t size, + int flags); +static int audit_fsetxattr(struct vfs_handle_struct *handle, + struct files_struct *fsp, int fd, const char *name, + const void *value, size_t size, int flags); + +/* VFS operations */ + +static vfs_op_tuple audit_op_tuples[] = { + + /* Disk operations */ + + {SMB_VFS_OP(audit_connect), SMB_VFS_OP_CONNECT, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_disconnect), SMB_VFS_OP_DISCONNECT, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_disk_free), SMB_VFS_OP_DISK_FREE, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_get_quota), SMB_VFS_OP_GET_QUOTA, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_set_quota), SMB_VFS_OP_SET_QUOTA, + SMB_VFS_LAYER_LOGGER}, + + /* Directory operations */ + + {SMB_VFS_OP(audit_opendir), SMB_VFS_OP_OPENDIR, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_readdir), SMB_VFS_OP_READDIR, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_mkdir), SMB_VFS_OP_MKDIR, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_rmdir), SMB_VFS_OP_RMDIR, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_closedir), SMB_VFS_OP_CLOSEDIR, + SMB_VFS_LAYER_LOGGER}, + + /* File operations */ + + {SMB_VFS_OP(audit_open), SMB_VFS_OP_OPEN, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_close), SMB_VFS_OP_CLOSE, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_read), SMB_VFS_OP_READ, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_pread), SMB_VFS_OP_PREAD, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_write), SMB_VFS_OP_WRITE, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_pwrite), SMB_VFS_OP_PWRITE, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_lseek), SMB_VFS_OP_LSEEK, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_sendfile), SMB_VFS_OP_SENDFILE, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_rename), SMB_VFS_OP_RENAME, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_fsync), SMB_VFS_OP_FSYNC, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_stat), SMB_VFS_OP_STAT, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_fstat), SMB_VFS_OP_FSTAT, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_lstat), SMB_VFS_OP_LSTAT, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_unlink), SMB_VFS_OP_UNLINK, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_chmod), SMB_VFS_OP_CHMOD, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_fchmod), SMB_VFS_OP_FCHMOD, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_chown), SMB_VFS_OP_CHOWN, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_fchown), SMB_VFS_OP_FCHOWN, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_chdir), SMB_VFS_OP_CHDIR, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_getwd), SMB_VFS_OP_GETWD, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_utime), SMB_VFS_OP_UTIME, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_ftruncate), SMB_VFS_OP_FTRUNCATE, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_lock), SMB_VFS_OP_LOCK, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_symlink), SMB_VFS_OP_SYMLINK, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_readlink), SMB_VFS_OP_READLINK, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_link), SMB_VFS_OP_LINK, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_mknod), SMB_VFS_OP_MKNOD, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_realpath), SMB_VFS_OP_REALPATH, + SMB_VFS_LAYER_LOGGER}, + + /* NT ACL operations. */ + + {SMB_VFS_OP(audit_fget_nt_acl), SMB_VFS_OP_FGET_NT_ACL, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_get_nt_acl), SMB_VFS_OP_GET_NT_ACL, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_fset_nt_acl), SMB_VFS_OP_FSET_NT_ACL, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_set_nt_acl), SMB_VFS_OP_SET_NT_ACL, + SMB_VFS_LAYER_LOGGER}, + + /* POSIX ACL operations. */ + + {SMB_VFS_OP(audit_chmod_acl), SMB_VFS_OP_CHMOD, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_fchmod_acl), SMB_VFS_OP_FCHMOD, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_sys_acl_get_entry), SMB_VFS_OP_SYS_ACL_GET_ENTRY, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_sys_acl_get_tag_type), SMB_VFS_OP_SYS_ACL_GET_TAG_TYPE, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_sys_acl_get_permset), SMB_VFS_OP_SYS_ACL_GET_PERMSET, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_sys_acl_get_qualifier), SMB_VFS_OP_SYS_ACL_GET_QUALIFIER, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_sys_acl_get_file), SMB_VFS_OP_SYS_ACL_GET_FILE, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_sys_acl_get_fd), SMB_VFS_OP_SYS_ACL_GET_FD, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_sys_acl_clear_perms), SMB_VFS_OP_SYS_ACL_CLEAR_PERMS, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_sys_acl_add_perm), SMB_VFS_OP_SYS_ACL_ADD_PERM, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_sys_acl_to_text), SMB_VFS_OP_SYS_ACL_TO_TEXT, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_sys_acl_init), SMB_VFS_OP_SYS_ACL_INIT, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_sys_acl_create_entry), SMB_VFS_OP_SYS_ACL_CREATE_ENTRY, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_sys_acl_set_tag_type), SMB_VFS_OP_SYS_ACL_SET_TAG_TYPE, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_sys_acl_set_qualifier), SMB_VFS_OP_SYS_ACL_SET_QUALIFIER, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_sys_acl_set_permset), SMB_VFS_OP_SYS_ACL_SET_PERMSET, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_sys_acl_valid), SMB_VFS_OP_SYS_ACL_VALID, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_sys_acl_set_file), SMB_VFS_OP_SYS_ACL_SET_FILE, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_sys_acl_set_fd), SMB_VFS_OP_SYS_ACL_SET_FD, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_sys_acl_delete_def_file), SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_sys_acl_get_perm), SMB_VFS_OP_SYS_ACL_GET_PERM, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_sys_acl_free_text), SMB_VFS_OP_SYS_ACL_FREE_TEXT, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_sys_acl_free_acl), SMB_VFS_OP_SYS_ACL_FREE_ACL, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_sys_acl_free_qualifier), SMB_VFS_OP_SYS_ACL_FREE_QUALIFIER, + SMB_VFS_LAYER_LOGGER}, + + /* EA operations. */ + + {SMB_VFS_OP(audit_getxattr), SMB_VFS_OP_GETXATTR, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_lgetxattr), SMB_VFS_OP_LGETXATTR, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_fgetxattr), SMB_VFS_OP_FGETXATTR, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_listxattr), SMB_VFS_OP_LISTXATTR, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_llistxattr), SMB_VFS_OP_LLISTXATTR, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_flistxattr), SMB_VFS_OP_FLISTXATTR, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_removexattr), SMB_VFS_OP_REMOVEXATTR, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_lremovexattr), SMB_VFS_OP_LREMOVEXATTR, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_fremovexattr), SMB_VFS_OP_FREMOVEXATTR, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_setxattr), SMB_VFS_OP_SETXATTR, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_lsetxattr), SMB_VFS_OP_LSETXATTR, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(audit_fsetxattr), SMB_VFS_OP_FSETXATTR, + SMB_VFS_LAYER_LOGGER}, + + /* Finish VFS operations definition */ + + {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, + SMB_VFS_LAYER_NOOP} +}; + +/* The following array *must* be in the same order as defined in vfs.h */ + +static struct { + vfs_op_type type; + const char *name; +} vfs_op_names[] = { + { SMB_VFS_OP_CONNECT, "connect" }, + { SMB_VFS_OP_DISCONNECT, "disconnect" }, + { SMB_VFS_OP_DISK_FREE, "disk_free" }, + { SMB_VFS_OP_GET_QUOTA, "get_quota" }, + { SMB_VFS_OP_SET_QUOTA, "set_quota" }, + { SMB_VFS_OP_GET_SHADOW_COPY_DATA, "get_shadow_copy_data" }, + { SMB_VFS_OP_OPENDIR, "opendir" }, + { SMB_VFS_OP_READDIR, "readdir" }, + { SMB_VFS_OP_MKDIR, "mkdir" }, + { SMB_VFS_OP_RMDIR, "rmdir" }, + { SMB_VFS_OP_CLOSEDIR, "closedir" }, + { SMB_VFS_OP_OPEN, "open" }, + { SMB_VFS_OP_CLOSE, "close" }, + { SMB_VFS_OP_READ, "read" }, + { SMB_VFS_OP_PREAD, "pread" }, + { SMB_VFS_OP_WRITE, "write" }, + { SMB_VFS_OP_PWRITE, "pwrite" }, + { SMB_VFS_OP_LSEEK, "lseek" }, + { SMB_VFS_OP_SENDFILE, "sendfile" }, + { SMB_VFS_OP_RENAME, "rename" }, + { SMB_VFS_OP_FSYNC, "fsync" }, + { SMB_VFS_OP_STAT, "stat" }, + { SMB_VFS_OP_FSTAT, "fstat" }, + { SMB_VFS_OP_LSTAT, "lstat" }, + { SMB_VFS_OP_UNLINK, "unlink" }, + { SMB_VFS_OP_CHMOD, "chmod" }, + { SMB_VFS_OP_FCHMOD, "fchmod" }, + { SMB_VFS_OP_CHOWN, "chown" }, + { SMB_VFS_OP_FCHOWN, "fchown" }, + { SMB_VFS_OP_CHDIR, "chdir" }, + { SMB_VFS_OP_GETWD, "getwd" }, + { SMB_VFS_OP_UTIME, "utime" }, + { SMB_VFS_OP_FTRUNCATE, "ftruncate" }, + { SMB_VFS_OP_LOCK, "lock" }, + { SMB_VFS_OP_SYMLINK, "symlink" }, + { SMB_VFS_OP_READLINK, "readlink" }, + { SMB_VFS_OP_LINK, "link" }, + { SMB_VFS_OP_MKNOD, "mknod" }, + { SMB_VFS_OP_REALPATH, "realpath" }, + { SMB_VFS_OP_FGET_NT_ACL, "fget_nt_acl" }, + { SMB_VFS_OP_GET_NT_ACL, "get_nt_acl" }, + { SMB_VFS_OP_FSET_NT_ACL, "fset_nt_acl" }, + { SMB_VFS_OP_SET_NT_ACL, "set_nt_acl" }, + { SMB_VFS_OP_CHMOD_ACL, "chmod_acl" }, + { SMB_VFS_OP_FCHMOD_ACL, "fchmod_acl" }, + { SMB_VFS_OP_SYS_ACL_GET_ENTRY, "sys_acl_get_entry" }, + { SMB_VFS_OP_SYS_ACL_GET_TAG_TYPE, "sys_acl_get_tag_type" }, + { SMB_VFS_OP_SYS_ACL_GET_PERMSET, "sys_acl_get_permset" }, + { SMB_VFS_OP_SYS_ACL_GET_QUALIFIER, "sys_acl_get_qualifier" }, + { SMB_VFS_OP_SYS_ACL_GET_FILE, "sys_acl_get_file" }, + { SMB_VFS_OP_SYS_ACL_GET_FD, "sys_acl_get_fd" }, + { SMB_VFS_OP_SYS_ACL_CLEAR_PERMS, "sys_acl_clear_perms" }, + { SMB_VFS_OP_SYS_ACL_ADD_PERM, "sys_acl_add_perm" }, + { SMB_VFS_OP_SYS_ACL_TO_TEXT, "sys_acl_to_text" }, + { SMB_VFS_OP_SYS_ACL_INIT, "sys_acl_init" }, + { SMB_VFS_OP_SYS_ACL_CREATE_ENTRY, "sys_acl_create_entry" }, + { SMB_VFS_OP_SYS_ACL_SET_TAG_TYPE, "sys_acl_set_tag_type" }, + { SMB_VFS_OP_SYS_ACL_SET_QUALIFIER, "sys_acl_set_qualifier" }, + { SMB_VFS_OP_SYS_ACL_SET_PERMSET, "sys_acl_set_permset" }, + { SMB_VFS_OP_SYS_ACL_VALID, "sys_acl_valid" }, + { SMB_VFS_OP_SYS_ACL_SET_FILE, "sys_acl_set_file" }, + { SMB_VFS_OP_SYS_ACL_SET_FD, "sys_acl_set_fd" }, + { SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE, "sys_acl_delete_def_file" }, + { SMB_VFS_OP_SYS_ACL_GET_PERM, "sys_acl_get_perm" }, + { SMB_VFS_OP_SYS_ACL_FREE_TEXT, "sys_acl_free_text" }, + { SMB_VFS_OP_SYS_ACL_FREE_ACL, "sys_acl_free_acl" }, + { SMB_VFS_OP_SYS_ACL_FREE_QUALIFIER, "sys_acl_free_qualifier" }, + { SMB_VFS_OP_GETXATTR, "getxattr" }, + { SMB_VFS_OP_LGETXATTR, "lgetxattr" }, + { SMB_VFS_OP_FGETXATTR, "fgetxattr" }, + { SMB_VFS_OP_LISTXATTR, "listxattr" }, + { SMB_VFS_OP_LLISTXATTR, "llistxattr" }, + { SMB_VFS_OP_FLISTXATTR, "flistxattr" }, + { SMB_VFS_OP_REMOVEXATTR, "removexattr" }, + { SMB_VFS_OP_LREMOVEXATTR, "lremovexattr" }, + { SMB_VFS_OP_FREMOVEXATTR, "fremovexattr" }, + { SMB_VFS_OP_SETXATTR, "setxattr" }, + { SMB_VFS_OP_LSETXATTR, "lsetxattr" }, + { SMB_VFS_OP_FSETXATTR, "fsetxattr" }, + { SMB_VFS_OP_LAST, NULL } +}; + +static int audit_syslog_facility(vfs_handle_struct *handle) +{ + /* fix me: let this be configurable by: + * lp_param_enum(SNUM(handle->conn), + * (handle->param?handle->param:"full_audit"), + * "syslog facility", + * audit_enum_facility,LOG_USER); + */ + return LOG_USER; +} + +static int audit_syslog_priority(vfs_handle_struct *handle) +{ + /* fix me: let this be configurable by: + * lp_param_enum(SNUM(handle->conn), + * (handle->param?handle->param:"full_audit"), + * "syslog priority", + * audit_enum_priority,LOG_NOTICE); + */ + return LOG_NOTICE; +} + +static char *audit_prefix(connection_struct *conn) +{ + static pstring prefix; + + pstrcpy(prefix, lp_parm_const_string(SNUM(conn), "full_audit", + "prefix", "%u|%I")); + standard_sub_snum(SNUM(conn), prefix, sizeof(prefix)-1); + return prefix; +} + +static struct bitmap *success_ops = NULL; + +static BOOL log_success(vfs_op_type op) +{ + if (success_ops == NULL) + return True; + + return bitmap_query(success_ops, op); +} + +static struct bitmap *failure_ops = NULL; + +static BOOL log_failure(vfs_op_type op) +{ + if (failure_ops == NULL) + return True; + + return bitmap_query(failure_ops, op); +} + +static void init_bitmap(struct bitmap **bm, const char **ops) +{ + BOOL log_all = False; + + if (*bm != NULL) + return; + + *bm = bitmap_allocate(SMB_VFS_OP_LAST); + + if (*bm == NULL) { + DEBUG(0, ("Could not alloc bitmap -- " + "defaulting to logging everything\n")); + return; + } + + while (*ops != NULL) { + int i; + BOOL found = False; + + if (strequal(*ops, "all")) { + log_all = True; + break; + } + + for (i=0; i= SMB_VFS_OP_LAST) + return "INVALID VFS OP"; + return vfs_op_names[op].name; +} + +static void do_log(vfs_op_type op, BOOL success, vfs_handle_struct *handle, + const char *format, ...) +{ + fstring err_msg; + pstring op_msg; + va_list ap; + + if (success && (!log_success(op))) + return; + + if (!success && (!log_failure(op))) + return; + + if (success) + fstrcpy(err_msg, "ok"); + else + fstr_sprintf(err_msg, "fail (%s)", strerror(errno)); + + va_start(ap, format); + vsnprintf(op_msg, sizeof(op_msg), format, ap); + va_end(ap); + + syslog(audit_syslog_priority(handle), "%s|%s|%s|%s\n", + audit_prefix(handle->conn), audit_opname(op), err_msg, op_msg); + + return; +} + +/* Implementation of vfs_ops. Pass everything on to the default + operation but log event first. */ + +static int audit_connect(vfs_handle_struct *handle, connection_struct *conn, + const char *svc, const char *user) +{ + int result; + const char *none[] = { NULL }; + const char *all [] = { "all" }; + + openlog("smbd_audit", 0, audit_syslog_facility(handle)); + + init_bitmap(&success_ops, + lp_parm_string_list(SNUM(conn), "full_audit", "success", + none)); + init_bitmap(&failure_ops, + lp_parm_string_list(SNUM(conn), "full_audit", "failure", + all)); + + result = SMB_VFS_NEXT_CONNECT(handle, conn, svc, user); + + do_log(SMB_VFS_OP_CONNECT, True, handle, + "%s", svc); + + return result; +} + +static void audit_disconnect(vfs_handle_struct *handle, + connection_struct *conn) +{ + SMB_VFS_NEXT_DISCONNECT(handle, conn); + + do_log(SMB_VFS_OP_DISCONNECT, True, handle, + "%s", lp_servicename(SNUM(conn))); + + bitmap_free(success_ops); + success_ops = NULL; + + bitmap_free(failure_ops); + failure_ops = NULL; + + return; +} + +static SMB_BIG_UINT audit_disk_free(vfs_handle_struct *handle, + connection_struct *conn, const char *path, + BOOL small_query, SMB_BIG_UINT *bsize, + SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize) +{ + SMB_BIG_UINT result; + + result = SMB_VFS_NEXT_DISK_FREE(handle, conn, path, small_query, bsize, + dfree, dsize); + + /* Don't have a reasonable notion of failure here */ + + do_log(SMB_VFS_OP_DISK_FREE, True, handle, "%s", path); + + return result; +} + +static int audit_get_quota(struct vfs_handle_struct *handle, + struct connection_struct *conn, + enum SMB_QUOTA_TYPE qtype, unid_t id, + SMB_DISK_QUOTA *qt) +{ + int result; + + result = SMB_VFS_NEXT_GET_QUOTA(handle, conn, qtype, id, qt); + + do_log(SMB_VFS_OP_GET_QUOTA, (result >= 0), handle, ""); + + return result; +} + + +static int audit_set_quota(struct vfs_handle_struct *handle, + struct connection_struct *conn, + enum SMB_QUOTA_TYPE qtype, unid_t id, + SMB_DISK_QUOTA *qt) +{ + int result; + + result = SMB_VFS_NEXT_SET_QUOTA(handle, conn, qtype, id, qt); + + do_log(SMB_VFS_OP_SET_QUOTA, (result >= 0), handle, ""); + + return result; +} + +static DIR *audit_opendir(vfs_handle_struct *handle, connection_struct *conn, + const char *fname) +{ + DIR *result; + + result = SMB_VFS_NEXT_OPENDIR(handle, conn, fname); + + do_log(SMB_VFS_OP_OPENDIR, (result != NULL), handle, "%s", fname); + + return result; +} + +static struct dirent *audit_readdir(vfs_handle_struct *handle, + connection_struct *conn, DIR *dirp) +{ + struct dirent *result; + + result = SMB_VFS_NEXT_READDIR(handle, conn, dirp); + + /* This operation has no reasonable error condition + * (End of dir is also failure), so always succeed. + */ + do_log(SMB_VFS_OP_READDIR, True, handle, ""); + + return result; +} + +static int audit_mkdir(vfs_handle_struct *handle, connection_struct *conn, + const char *path, mode_t mode) +{ + int result; + + result = SMB_VFS_NEXT_MKDIR(handle, conn, path, mode); + + do_log(SMB_VFS_OP_MKDIR, (result >= 0), handle, "%s", path); + + return result; +} + +static int audit_rmdir(vfs_handle_struct *handle, connection_struct *conn, + const char *path) +{ + int result; + + result = SMB_VFS_NEXT_RMDIR(handle, conn, path); + + do_log(SMB_VFS_OP_RMDIR, (result >= 0), handle, "%s", path); + + return result; +} + +static int audit_closedir(vfs_handle_struct *handle, connection_struct *conn, + DIR *dirp) +{ + int result; + + result = SMB_VFS_NEXT_CLOSEDIR(handle, conn, dirp); + + do_log(SMB_VFS_OP_CLOSEDIR, (result >= 0), handle, ""); + + return result; +} + +static int audit_open(vfs_handle_struct *handle, connection_struct *conn, + const char *fname, int flags, mode_t mode) +{ + int result; + + result = SMB_VFS_NEXT_OPEN(handle, conn, fname, flags, mode); + + do_log(SMB_VFS_OP_OPEN, (result >= 0), handle, "%s|%s", + ((flags & O_WRONLY) || (flags & O_RDWR))?"w":"r", + fname); + + return result; +} + +static int audit_close(vfs_handle_struct *handle, files_struct *fsp, int fd) +{ + int result; + + result = SMB_VFS_NEXT_CLOSE(handle, fsp, fd); + + do_log(SMB_VFS_OP_CLOSE, (result >= 0), handle, "%s", fsp->fsp_name); + + return result; +} + +static ssize_t audit_read(vfs_handle_struct *handle, files_struct *fsp, + int fd, void *data, size_t n) +{ + ssize_t result; + + result = SMB_VFS_NEXT_READ(handle, fsp, fd, data, n); + + do_log(SMB_VFS_OP_READ, (result >= 0), handle, "%s", fsp->fsp_name); + + return result; +} + +static ssize_t audit_pread(vfs_handle_struct *handle, files_struct *fsp, + int fd, void *data, size_t n, SMB_OFF_T offset) +{ + ssize_t result; + + result = SMB_VFS_NEXT_PREAD(handle, fsp, fd, data, n, offset); + + do_log(SMB_VFS_OP_PREAD, (result >= 0), handle, "%s", fsp->fsp_name); + + return result; +} + +static ssize_t audit_write(vfs_handle_struct *handle, files_struct *fsp, + int fd, const void *data, size_t n) +{ + ssize_t result; + + result = SMB_VFS_NEXT_WRITE(handle, fsp, fd, data, n); + + do_log(SMB_VFS_OP_WRITE, (result >= 0), handle, "%s", fsp->fsp_name); + + return result; +} + +static ssize_t audit_pwrite(vfs_handle_struct *handle, files_struct *fsp, + int fd, const void *data, size_t n, + SMB_OFF_T offset) +{ + ssize_t result; + + result = SMB_VFS_NEXT_PWRITE(handle, fsp, fd, data, n, offset); + + do_log(SMB_VFS_OP_PWRITE, (result >= 0), handle, "%s", fsp->fsp_name); + + return result; +} + +static SMB_OFF_T audit_lseek(vfs_handle_struct *handle, files_struct *fsp, + int filedes, SMB_OFF_T offset, int whence) +{ + ssize_t result; + + result = SMB_VFS_NEXT_LSEEK(handle, fsp, filedes, offset, whence); + + do_log(SMB_VFS_OP_LSEEK, (result != (ssize_t)-1), handle, + "%s", fsp->fsp_name); + + return result; +} + +static ssize_t audit_sendfile(vfs_handle_struct *handle, int tofd, + files_struct *fsp, int fromfd, + const DATA_BLOB *hdr, SMB_OFF_T offset, + size_t n) +{ + ssize_t result; + + result = SMB_VFS_NEXT_SENDFILE(handle, tofd, fsp, fromfd, hdr, + offset, n); + + do_log(SMB_VFS_OP_SENDFILE, (result >= 0), handle, + "%s", fsp->fsp_name); + + return result; +} + +static int audit_rename(vfs_handle_struct *handle, connection_struct *conn, + const char *old, const char *new) +{ + int result; + + result = SMB_VFS_NEXT_RENAME(handle, conn, old, new); + + do_log(SMB_VFS_OP_RENAME, (result >= 0), handle, "%s|%s", old, new); + + return result; +} + +static int audit_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd) +{ + int result; + + result = SMB_VFS_NEXT_FSYNC(handle, fsp, fd); + + do_log(SMB_VFS_OP_FSYNC, (result >= 0), handle, "%s", fsp->fsp_name); + + return result; +} + +static int audit_stat(vfs_handle_struct *handle, connection_struct *conn, + const char *fname, SMB_STRUCT_STAT *sbuf) +{ + int result; + + result = SMB_VFS_NEXT_STAT(handle, conn, fname, sbuf); + + do_log(SMB_VFS_OP_STAT, (result >= 0), handle, "%s", fname); + + return result; +} + +static int audit_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd, + SMB_STRUCT_STAT *sbuf) +{ + int result; + + result = SMB_VFS_NEXT_FSTAT(handle, fsp, fd, sbuf); + + do_log(SMB_VFS_OP_FSTAT, (result >= 0), handle, "%s", fsp->fsp_name); + + return result; +} + +static int audit_lstat(vfs_handle_struct *handle, connection_struct *conn, + const char *path, SMB_STRUCT_STAT *sbuf) +{ + int result; + + result = SMB_VFS_NEXT_LSTAT(handle, conn, path, sbuf); + + do_log(SMB_VFS_OP_LSTAT, (result >= 0), handle, "%s", path); + + return result; +} + +static int audit_unlink(vfs_handle_struct *handle, connection_struct *conn, + const char *path) +{ + int result; + + result = SMB_VFS_NEXT_UNLINK(handle, conn, path); + + do_log(SMB_VFS_OP_UNLINK, (result >= 0), handle, "%s", path); + + return result; +} + +static int audit_chmod(vfs_handle_struct *handle, connection_struct *conn, + const char *path, mode_t mode) +{ + int result; + + result = SMB_VFS_NEXT_CHMOD(handle, conn, path, mode); + + do_log(SMB_VFS_OP_CHMOD, (result >= 0), handle, "%s|%o", path, mode); + + return result; +} + +static int audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, + mode_t mode) +{ + int result; + + result = SMB_VFS_NEXT_FCHMOD(handle, fsp, fd, mode); + + do_log(SMB_VFS_OP_FCHMOD, (result >= 0), handle, + "%s|%o", fsp->fsp_name, mode); + + return result; +} + +static int audit_chown(vfs_handle_struct *handle, connection_struct *conn, + const char *path, uid_t uid, gid_t gid) +{ + int result; + + result = SMB_VFS_NEXT_CHOWN(handle, conn, path, uid, gid); + + do_log(SMB_VFS_OP_CHOWN, (result >= 0), handle, "%s|%ld|%ld", + path, (long int)uid, (long int)gid); + + return result; +} + +static int audit_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd, + uid_t uid, gid_t gid) +{ + int result; + + result = SMB_VFS_NEXT_FCHOWN(handle, fsp, fd, uid, gid); + + do_log(SMB_VFS_OP_FCHOWN, (result >= 0), handle, "%s|%ld|%ld", + fsp->fsp_name, (long int)uid, (long int)gid); + + return result; +} + +static int audit_chdir(vfs_handle_struct *handle, connection_struct *conn, + const char *path) +{ + int result; + + result = SMB_VFS_NEXT_CHDIR(handle, conn, path); + + do_log(SMB_VFS_OP_CHDIR, (result >= 0), handle, "chdir|%s", path); + + return result; +} + +static char *audit_getwd(vfs_handle_struct *handle, connection_struct *conn, + char *path) +{ + char *result; + + result = SMB_VFS_NEXT_GETWD(handle, conn, path); + + do_log(SMB_VFS_OP_GETWD, (result != NULL), handle, "%s", path); + + return result; +} + +static int audit_utime(vfs_handle_struct *handle, connection_struct *conn, + const char *path, struct utimbuf *times) +{ + int result; + + result = SMB_VFS_NEXT_UTIME(handle, conn, path, times); + + do_log(SMB_VFS_OP_UTIME, (result >= 0), handle, "%s", path); + + return result; +} + +static int audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp, + int fd, SMB_OFF_T len) +{ + int result; + + result = SMB_VFS_NEXT_FTRUNCATE(handle, fsp, fd, len); + + do_log(SMB_VFS_OP_FTRUNCATE, (result >= 0), handle, + "%s", fsp->fsp_name); + + return result; +} + +static BOOL audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, + int op, SMB_OFF_T offset, SMB_OFF_T count, int type) +{ + BOOL result; + + result = SMB_VFS_NEXT_LOCK(handle, fsp, fd, op, offset, count, type); + + do_log(SMB_VFS_OP_LOCK, (result >= 0), handle, "%s", fsp->fsp_name); + + return result; +} + +static int audit_symlink(vfs_handle_struct *handle, connection_struct *conn, + const char *oldpath, const char *newpath) +{ + int result; + + result = SMB_VFS_NEXT_SYMLINK(handle, conn, oldpath, newpath); + + do_log(SMB_VFS_OP_SYMLINK, (result >= 0), handle, + "%s|%s", oldpath, newpath); + + return result; +} + +static int audit_readlink(vfs_handle_struct *handle, connection_struct *conn, + const char *path, char *buf, size_t bufsiz) +{ + int result; + + result = SMB_VFS_NEXT_READLINK(handle, conn, path, buf, bufsiz); + + do_log(SMB_VFS_OP_READLINK, (result >= 0), handle, "%s", path); + + return result; +} + +static int audit_link(vfs_handle_struct *handle, connection_struct *conn, + const char *oldpath, const char *newpath) +{ + int result; + + result = SMB_VFS_NEXT_LINK(handle, conn, oldpath, newpath); + + do_log(SMB_VFS_OP_LINK, (result >= 0), handle, + "%s|%s", oldpath, newpath); + + return result; +} + +static int audit_mknod(vfs_handle_struct *handle, connection_struct *conn, + const char *pathname, mode_t mode, SMB_DEV_T dev) +{ + int result; + + result = SMB_VFS_NEXT_MKNOD(handle, conn, pathname, mode, dev); + + do_log(SMB_VFS_OP_MKNOD, (result >= 0), handle, "%s", pathname); + + return result; +} + +static char *audit_realpath(vfs_handle_struct *handle, connection_struct *conn, + const char *path, char *resolved_path) +{ + char *result; + + result = SMB_VFS_NEXT_REALPATH(handle, conn, path, resolved_path); + + do_log(SMB_VFS_OP_REALPATH, (result != NULL), handle, "%s", path); + + return result; +} + +static size_t audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, + int fd, uint32 security_info, + SEC_DESC **ppdesc) +{ + size_t result; + + result = SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, fd, security_info, + ppdesc); + + do_log(SMB_VFS_OP_FGET_NT_ACL, (result > 0), handle, + "%s", fsp->fsp_name); + + return result; +} + +static size_t audit_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, + const char *name, uint32 security_info, + SEC_DESC **ppdesc) +{ + size_t result; + + result = SMB_VFS_NEXT_GET_NT_ACL(handle, fsp, name, security_info, + ppdesc); + + do_log(SMB_VFS_OP_GET_NT_ACL, (result > 0), handle, + "%s", fsp->fsp_name); + + return result; +} + +static BOOL audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, + int fd, uint32 security_info_sent, + SEC_DESC *psd) +{ + BOOL result; + + result = SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, fd, security_info_sent, + psd); + + do_log(SMB_VFS_OP_FSET_NT_ACL, result, handle, "%s", fsp->fsp_name); + + return result; +} + +static BOOL audit_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, + const char *name, uint32 security_info_sent, + SEC_DESC *psd) +{ + BOOL result; + + result = SMB_VFS_NEXT_SET_NT_ACL(handle, fsp, name, security_info_sent, + psd); + + do_log(SMB_VFS_OP_SET_NT_ACL, result, handle, "%s", fsp->fsp_name); + + return result; +} + +static int audit_chmod_acl(vfs_handle_struct *handle, connection_struct *conn, + const char *path, mode_t mode) +{ + int result; + + result = SMB_VFS_NEXT_CHMOD_ACL(handle, conn, path, mode); + + do_log(SMB_VFS_OP_CHMOD_ACL, (result >= 0), handle, + "%s|%o", path, mode); + + return result; +} + +static int audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, + int fd, mode_t mode) +{ + int result; + + result = SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, fd, mode); + + do_log(SMB_VFS_OP_FCHMOD_ACL, (result >= 0), handle, + "%s|%o", fsp->fsp_name, mode); + + return result; +} + +static int audit_sys_acl_get_entry(vfs_handle_struct *handle, + connection_struct *conn, + SMB_ACL_T theacl, int entry_id, + SMB_ACL_ENTRY_T *entry_p) +{ + int result; + + result = SMB_VFS_NEXT_SYS_ACL_GET_ENTRY(handle, conn, theacl, entry_id, + entry_p); + + do_log(SMB_VFS_OP_SYS_ACL_GET_ENTRY, (result >= 0), handle, + ""); + + return result; +} + +static int audit_sys_acl_get_tag_type(vfs_handle_struct *handle, + connection_struct *conn, + SMB_ACL_ENTRY_T entry_d, + SMB_ACL_TAG_T *tag_type_p) +{ + int result; + + result = SMB_VFS_NEXT_SYS_ACL_GET_TAG_TYPE(handle, conn, entry_d, + tag_type_p); + + do_log(SMB_VFS_OP_SYS_ACL_GET_TAG_TYPE, (result >= 0), handle, + ""); + + return result; +} + +static int audit_sys_acl_get_permset(vfs_handle_struct *handle, + connection_struct *conn, + SMB_ACL_ENTRY_T entry_d, + SMB_ACL_PERMSET_T *permset_p) +{ + int result; + + result = SMB_VFS_NEXT_SYS_ACL_GET_PERMSET(handle, conn, entry_d, + permset_p); + + do_log(SMB_VFS_OP_SYS_ACL_GET_PERMSET, (result >= 0), handle, + ""); + + return result; +} + +static void * audit_sys_acl_get_qualifier(vfs_handle_struct *handle, + connection_struct *conn, + SMB_ACL_ENTRY_T entry_d) +{ + void *result; + + result = SMB_VFS_NEXT_SYS_ACL_GET_QUALIFIER(handle, conn, entry_d); + + do_log(SMB_VFS_OP_SYS_ACL_GET_QUALIFIER, (result != NULL), handle, + ""); + + return result; +} + +static SMB_ACL_T audit_sys_acl_get_file(vfs_handle_struct *handle, + connection_struct *conn, + const char *path_p, + SMB_ACL_TYPE_T type) +{ + SMB_ACL_T result; + + result = SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, conn, path_p, type); + + do_log(SMB_VFS_OP_SYS_ACL_GET_FILE, (result != NULL), handle, + "%s", path_p); + + return result; +} + +static SMB_ACL_T audit_sys_acl_get_fd(vfs_handle_struct *handle, + files_struct *fsp, int fd) +{ + SMB_ACL_T result; + + result = SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp, fd); + + do_log(SMB_VFS_OP_SYS_ACL_GET_FD, (result != NULL), handle, + "%s", fsp->fsp_name); + + return result; +} + +static int audit_sys_acl_clear_perms(vfs_handle_struct *handle, + connection_struct *conn, + SMB_ACL_PERMSET_T permset) +{ + int result; + + result = SMB_VFS_NEXT_SYS_ACL_CLEAR_PERMS(handle, conn, permset); + + do_log(SMB_VFS_OP_SYS_ACL_CLEAR_PERMS, (result >= 0), handle, + ""); + + return result; +} + +static int audit_sys_acl_add_perm(vfs_handle_struct *handle, + connection_struct *conn, + SMB_ACL_PERMSET_T permset, + SMB_ACL_PERM_T perm) +{ + int result; + + result = SMB_VFS_NEXT_SYS_ACL_ADD_PERM(handle, conn, permset, perm); + + do_log(SMB_VFS_OP_SYS_ACL_ADD_PERM, (result >= 0), handle, + ""); + + return result; +} + +static char * audit_sys_acl_to_text(vfs_handle_struct *handle, + connection_struct *conn, SMB_ACL_T theacl, + ssize_t *plen) +{ + char * result; + + result = SMB_VFS_NEXT_SYS_ACL_TO_TEXT(handle, conn, theacl, plen); + + do_log(SMB_VFS_OP_SYS_ACL_TO_TEXT, (result != NULL), handle, + ""); + + return result; +} + +static SMB_ACL_T audit_sys_acl_init(vfs_handle_struct *handle, + connection_struct *conn, + int count) +{ + SMB_ACL_T result; + + result = SMB_VFS_NEXT_SYS_ACL_INIT(handle, conn, count); + + do_log(SMB_VFS_OP_SYS_ACL_INIT, (result != NULL), handle, + ""); + + return result; +} + +static int audit_sys_acl_create_entry(vfs_handle_struct *handle, + connection_struct *conn, SMB_ACL_T *pacl, + SMB_ACL_ENTRY_T *pentry) +{ + int result; + + result = SMB_VFS_NEXT_SYS_ACL_CREATE_ENTRY(handle, conn, pacl, pentry); + + do_log(SMB_VFS_OP_SYS_ACL_CREATE_ENTRY, (result >= 0), handle, + ""); + + return result; +} + +static int audit_sys_acl_set_tag_type(vfs_handle_struct *handle, + connection_struct *conn, + SMB_ACL_ENTRY_T entry, + SMB_ACL_TAG_T tagtype) +{ + int result; + + result = SMB_VFS_NEXT_SYS_ACL_SET_TAG_TYPE(handle, conn, entry, + tagtype); + + do_log(SMB_VFS_OP_SYS_ACL_SET_TAG_TYPE, (result >= 0), handle, + ""); + + return result; +} + +static int audit_sys_acl_set_qualifier(vfs_handle_struct *handle, + connection_struct *conn, + SMB_ACL_ENTRY_T entry, + void *qual) +{ + int result; + + result = SMB_VFS_NEXT_SYS_ACL_SET_QUALIFIER(handle, conn, entry, qual); + + do_log(SMB_VFS_OP_SYS_ACL_SET_QUALIFIER, (result >= 0), handle, + ""); + + return result; +} + +static int audit_sys_acl_set_permset(vfs_handle_struct *handle, + connection_struct *conn, + SMB_ACL_ENTRY_T entry, + SMB_ACL_PERMSET_T permset) +{ + int result; + + result = SMB_VFS_NEXT_SYS_ACL_SET_PERMSET(handle, conn, entry, permset); + + do_log(SMB_VFS_OP_SYS_ACL_SET_PERMSET, (result >= 0), handle, + ""); + + return result; +} + +static int audit_sys_acl_valid(vfs_handle_struct *handle, + connection_struct *conn, + SMB_ACL_T theacl ) +{ + int result; + + result = SMB_VFS_NEXT_SYS_ACL_VALID(handle, conn, theacl); + + do_log(SMB_VFS_OP_SYS_ACL_VALID, (result >= 0), handle, + ""); + + return result; +} + +static int audit_sys_acl_set_file(vfs_handle_struct *handle, + connection_struct *conn, + const char *name, SMB_ACL_TYPE_T acltype, + SMB_ACL_T theacl) +{ + int result; + + result = SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, conn, name, acltype, + theacl); + + do_log(SMB_VFS_OP_SYS_ACL_SET_FILE, (result >= 0), handle, + "%s", name); + + return result; +} + +static int audit_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, + int fd, SMB_ACL_T theacl) +{ + int result; + + result = SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, fd, theacl); + + do_log(SMB_VFS_OP_SYS_ACL_SET_FD, (result >= 0), handle, + "%s", fsp->fsp_name); + + return result; +} + +static int audit_sys_acl_delete_def_file(vfs_handle_struct *handle, + connection_struct *conn, + const char *path) +{ + int result; + + result = SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, conn, path); + + do_log(SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE, (result >= 0), handle, + "%s", path); + + return result; +} + +static int audit_sys_acl_get_perm(vfs_handle_struct *handle, + connection_struct *conn, + SMB_ACL_PERMSET_T permset, + SMB_ACL_PERM_T perm) +{ + int result; + + result = SMB_VFS_NEXT_SYS_ACL_GET_PERM(handle, conn, permset, perm); + + do_log(SMB_VFS_OP_SYS_ACL_GET_PERM, (result >= 0), handle, + ""); + + return result; +} + +static int audit_sys_acl_free_text(vfs_handle_struct *handle, + connection_struct *conn, + char *text) +{ + int result; + + result = SMB_VFS_NEXT_SYS_ACL_FREE_TEXT(handle, conn, text); + + do_log(SMB_VFS_OP_SYS_ACL_FREE_TEXT, (result >= 0), handle, + ""); + + return result; +} + +static int audit_sys_acl_free_acl(vfs_handle_struct *handle, + connection_struct *conn, + SMB_ACL_T posix_acl) +{ + int result; + + result = SMB_VFS_NEXT_SYS_ACL_FREE_ACL(handle, conn, posix_acl); + + do_log(SMB_VFS_OP_SYS_ACL_FREE_ACL, (result >= 0), handle, + ""); + + return result; +} + +static int audit_sys_acl_free_qualifier(vfs_handle_struct *handle, + connection_struct *conn, + void *qualifier, + SMB_ACL_TAG_T tagtype) +{ + int result; + + result = SMB_VFS_NEXT_SYS_ACL_FREE_QUALIFIER(handle, conn, qualifier, + tagtype); + + do_log(SMB_VFS_OP_SYS_ACL_FREE_QUALIFIER, (result >= 0), handle, + ""); + + return result; +} + +static ssize_t audit_getxattr(struct vfs_handle_struct *handle, + struct connection_struct *conn, const char *path, + const char *name, void *value, size_t size) +{ + ssize_t result; + + result = SMB_VFS_NEXT_GETXATTR(handle, conn, path, name, value, size); + + do_log(SMB_VFS_OP_GETXATTR, (result >= 0), handle, + "%s|%s", path, name); + + return result; +} + +static ssize_t audit_lgetxattr(struct vfs_handle_struct *handle, + struct connection_struct *conn, + const char *path, const char *name, + void *value, size_t size) +{ + ssize_t result; + + result = SMB_VFS_NEXT_LGETXATTR(handle, conn, path, name, value, size); + + do_log(SMB_VFS_OP_LGETXATTR, (result >= 0), handle, + "%s|%s", path, name); + + return result; +} + +static ssize_t audit_fgetxattr(struct vfs_handle_struct *handle, + struct files_struct *fsp, int fd, + const char *name, void *value, size_t size) +{ + ssize_t result; + + result = SMB_VFS_NEXT_FGETXATTR(handle, fsp, fd, name, value, size); + + do_log(SMB_VFS_OP_FGETXATTR, (result >= 0), handle, + "%s|%s", fsp->fsp_name, name); + + return result; +} + +static ssize_t audit_listxattr(struct vfs_handle_struct *handle, + struct connection_struct *conn, + const char *path, char *list, size_t size) +{ + ssize_t result; + + result = SMB_VFS_NEXT_LISTXATTR(handle, conn, path, list, size); + + do_log(SMB_VFS_OP_LISTXATTR, (result >= 0), handle, "%s", path); + + return result; +} + +static ssize_t audit_llistxattr(struct vfs_handle_struct *handle, + struct connection_struct *conn, + const char *path, char *list, size_t size) +{ + ssize_t result; + + result = SMB_VFS_NEXT_LLISTXATTR(handle, conn, path, list, size); + + do_log(SMB_VFS_OP_LLISTXATTR, (result >= 0), handle, "%s", path); + + return result; +} + +static ssize_t audit_flistxattr(struct vfs_handle_struct *handle, + struct files_struct *fsp, int fd, char *list, + size_t size) +{ + ssize_t result; + + result = SMB_VFS_NEXT_FLISTXATTR(handle, fsp, fd, list, size); + + do_log(SMB_VFS_OP_FLISTXATTR, (result >= 0), handle, + "%s", fsp->fsp_name); + + return result; +} + +static int audit_removexattr(struct vfs_handle_struct *handle, + struct connection_struct *conn, const char *path, + const char *name) +{ + int result; + + result = SMB_VFS_NEXT_REMOVEXATTR(handle, conn, path, name); + + do_log(SMB_VFS_OP_REMOVEXATTR, (result >= 0), handle, + "%s|%s", path, name); + + return result; +} + +static int audit_lremovexattr(struct vfs_handle_struct *handle, + struct connection_struct *conn, const char *path, + const char *name) +{ + int result; + + result = SMB_VFS_NEXT_LREMOVEXATTR(handle, conn, path, name); + + do_log(SMB_VFS_OP_LREMOVEXATTR, (result >= 0), handle, + "%s|%s", path, name); + + return result; +} + +static int audit_fremovexattr(struct vfs_handle_struct *handle, + struct files_struct *fsp, int fd, + const char *name) +{ + int result; + + result = SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, fd, name); + + do_log(SMB_VFS_OP_FREMOVEXATTR, (result >= 0), handle, + "%s|%s", fsp->fsp_name, name); + + return result; +} + +static int audit_setxattr(struct vfs_handle_struct *handle, + struct connection_struct *conn, const char *path, + const char *name, const void *value, size_t size, + int flags) +{ + int result; + + result = SMB_VFS_NEXT_SETXATTR(handle, conn, path, name, value, size, + flags); + + do_log(SMB_VFS_OP_SETXATTR, (result >= 0), handle, + "%s|%s", path, name); + + return result; +} + +static int audit_lsetxattr(struct vfs_handle_struct *handle, + struct connection_struct *conn, const char *path, + const char *name, const void *value, size_t size, + int flags) +{ + int result; + + result = SMB_VFS_NEXT_LSETXATTR(handle, conn, path, name, value, size, + flags); + + do_log(SMB_VFS_OP_LSETXATTR, (result >= 0), handle, + "%s|%s", path, name); + + return result; +} + +static int audit_fsetxattr(struct vfs_handle_struct *handle, + struct files_struct *fsp, int fd, const char *name, + const void *value, size_t size, int flags) +{ + int result; + + result = SMB_VFS_NEXT_FSETXATTR(handle, fsp, fd, name, value, size, + flags); + + do_log(SMB_VFS_OP_FSETXATTR, (result >= 0), handle, + "%s|%s", fsp->fsp_name, name); + + return result; +} + +NTSTATUS vfs_full_audit_init(void) +{ + NTSTATUS ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION, + "full_audit", audit_op_tuples); + + if (!NT_STATUS_IS_OK(ret)) + return ret; + + vfs_full_audit_debug_level = debug_add_class("full_audit"); + if (vfs_full_audit_debug_level == -1) { + vfs_full_audit_debug_level = DBGC_VFS; + DEBUG(0, ("vfs_full_audit: Couldn't register custom debugging " + "class!\n")); + } else { + DEBUG(10, ("vfs_full_audit: Debug class number of " + "'full_audit': %d\n", vfs_full_audit_debug_level)); + } + + return ret; +} + -- cgit From 3250a8ab0aa70b1658dbc187af56d20de5c32cc8 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 29 Apr 2004 13:07:34 +0000 Subject: r405: Some docs of vfs_full_audit.c as comment :-) (This used to be commit 567f79237727a446c0e8427f18c74f00eca45c8e) --- source3/modules/vfs_full_audit.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 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 2371c40636..993a8ee4cb 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -23,6 +23,37 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +/* + * This module implements parseable logging for all Samba VFS operations. + * + * You use it as follows: + * + * [tmp] + * path = /tmp + * vfs objects = full_audit + * full_audit:prefix = %u|%I + * full_audit:success = open opendir + * full_audit:failure = all + * + * This leads to syslog entries of the form: + * smbd_audit: nobody|192.168.234.1|opendir|ok|. + * smbd_audit: nobody|192.168.234.1|open|fail (File not found)|r|x.txt + * + * where "nobody" is the connected username and "192.168.234.1" is the + * client's IP address. + * + * Options: + * + * prefix: A macro expansion template prepended to the syslog entry. + * + * success: A list of VFS operations for which a successful completion should + * be logged. Defaults to no logging at all. The special operation "all" logs + * - you guessed it - everything. + * + * failure: A list of VFS operations for which failure to complete should be + * logged. Defaults to logging everything. + */ + #include "includes.h" -- cgit From 278f9467f2079044497e3fd4c5358c280f179e41 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 31 Aug 2004 15:11:41 +0000 Subject: r2133: Several fixes: * BUG 1627: fix for NIS compiles on HPUX 11.00, AIX 4.3 and 5.1 patch from Olaf Flebbe . Will need to watch this one in the build farm. * Fix bug found by rwf@loonybin.net where the PRINT_ATTRIBUTE_PUBLISHED was getting reset by attempts to sanitize the defined attributes (PRINTER_ATTRIBUTE_SAMBA) * Resolve name conflict on DEC OSF-5.1 (inspired by patch from Adharsh Praveen ) * Work around parsing error in the print change notify code (not that the alignment bug is still there but reording the entries in the array works around it). * remove duplicate declaration of getprintprocdir from rpcclient. (This used to be commit 7474c6a446037f3ca2546cb6984d800bfc524029) --- source3/modules/vfs_full_audit.c | 468 +++++++++++++++++++-------------------- 1 file changed, 234 insertions(+), 234 deletions(-) (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 993a8ee4cb..b27c916a2a 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -66,218 +66,218 @@ static int vfs_full_audit_debug_level = DBGC_VFS; /* Function prototypes */ -static int audit_connect(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_connect(vfs_handle_struct *handle, connection_struct *conn, const char *svc, const char *user); -static void audit_disconnect(vfs_handle_struct *handle, +static void smb_full_audit_disconnect(vfs_handle_struct *handle, connection_struct *conn); -static SMB_BIG_UINT audit_disk_free(vfs_handle_struct *handle, +static SMB_BIG_UINT smb_full_audit_disk_free(vfs_handle_struct *handle, connection_struct *conn, const char *path, BOOL small_query, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize); -static int audit_get_quota(struct vfs_handle_struct *handle, +static int smb_full_audit_get_quota(struct vfs_handle_struct *handle, struct connection_struct *conn, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt); -static int audit_set_quota(struct vfs_handle_struct *handle, +static int smb_full_audit_set_quota(struct vfs_handle_struct *handle, struct connection_struct *conn, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt); -static DIR *audit_opendir(vfs_handle_struct *handle, connection_struct *conn, +static DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname); -static struct dirent *audit_readdir(vfs_handle_struct *handle, +static struct dirent *smb_full_audit_readdir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp); -static int audit_mkdir(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_mkdir(vfs_handle_struct *handle, connection_struct *conn, const char *path, mode_t mode); -static int audit_rmdir(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_rmdir(vfs_handle_struct *handle, connection_struct *conn, const char *path); -static int audit_closedir(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_closedir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp); -static int audit_open(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_open(vfs_handle_struct *handle, connection_struct *conn, const char *fname, int flags, mode_t mode); -static int audit_close(vfs_handle_struct *handle, files_struct *fsp, int fd); -static ssize_t audit_read(vfs_handle_struct *handle, files_struct *fsp, +static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp, int fd); +static ssize_t smb_full_audit_read(vfs_handle_struct *handle, files_struct *fsp, int fd, void *data, size_t n); -static ssize_t audit_pread(vfs_handle_struct *handle, files_struct *fsp, +static ssize_t smb_full_audit_pread(vfs_handle_struct *handle, files_struct *fsp, int fd, void *data, size_t n, SMB_OFF_T offset); -static ssize_t audit_write(vfs_handle_struct *handle, files_struct *fsp, +static ssize_t smb_full_audit_write(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data, size_t n); -static ssize_t audit_pwrite(vfs_handle_struct *handle, files_struct *fsp, +static ssize_t smb_full_audit_pwrite(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data, size_t n, SMB_OFF_T offset); -static SMB_OFF_T audit_lseek(vfs_handle_struct *handle, files_struct *fsp, +static SMB_OFF_T smb_full_audit_lseek(vfs_handle_struct *handle, files_struct *fsp, int filedes, SMB_OFF_T offset, int whence); -static ssize_t audit_sendfile(vfs_handle_struct *handle, int tofd, +static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fsp, int fromfd, const DATA_BLOB *hdr, SMB_OFF_T offset, size_t n); -static int audit_rename(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_rename(vfs_handle_struct *handle, connection_struct *conn, const char *old, const char *new); -static int audit_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd); -static int audit_stat(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd); +static int smb_full_audit_stat(vfs_handle_struct *handle, connection_struct *conn, const char *fname, SMB_STRUCT_STAT *sbuf); -static int audit_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd, +static int smb_full_audit_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_STRUCT_STAT *sbuf); -static int audit_lstat(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_lstat(vfs_handle_struct *handle, connection_struct *conn, const char *path, SMB_STRUCT_STAT *sbuf); -static int audit_unlink(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_unlink(vfs_handle_struct *handle, connection_struct *conn, const char *path); -static int audit_chmod(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_chmod(vfs_handle_struct *handle, connection_struct *conn, const char *path, mode_t mode); -static int audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, +static int smb_full_audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode); -static int audit_chown(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_chown(vfs_handle_struct *handle, connection_struct *conn, const char *path, uid_t uid, gid_t gid); -static int audit_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd, +static int smb_full_audit_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd, uid_t uid, gid_t gid); -static int audit_chdir(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_chdir(vfs_handle_struct *handle, connection_struct *conn, const char *path); -static char *audit_getwd(vfs_handle_struct *handle, connection_struct *conn, +static char *smb_full_audit_getwd(vfs_handle_struct *handle, connection_struct *conn, char *path); -static int audit_utime(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_utime(vfs_handle_struct *handle, connection_struct *conn, const char *path, struct utimbuf *times); -static int audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp, +static int smb_full_audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T len); -static BOOL audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, +static BOOL smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type); -static int audit_symlink(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_symlink(vfs_handle_struct *handle, connection_struct *conn, const char *oldpath, const char *newpath); -static int audit_readlink(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_readlink(vfs_handle_struct *handle, connection_struct *conn, const char *path, char *buf, size_t bufsiz); -static int audit_link(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_link(vfs_handle_struct *handle, connection_struct *conn, const char *oldpath, const char *newpath); -static int audit_mknod(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_mknod(vfs_handle_struct *handle, connection_struct *conn, const char *pathname, mode_t mode, SMB_DEV_T dev); -static char *audit_realpath(vfs_handle_struct *handle, connection_struct *conn, +static char *smb_full_audit_realpath(vfs_handle_struct *handle, connection_struct *conn, const char *path, char *resolved_path); -static size_t audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, +static size_t smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info, SEC_DESC **ppdesc); -static size_t audit_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, +static size_t smb_full_audit_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info, SEC_DESC **ppdesc); -static BOOL audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, +static BOOL smb_full_audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info_sent, SEC_DESC *psd); -static BOOL audit_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, +static BOOL smb_full_audit_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info_sent, SEC_DESC *psd); -static int audit_chmod_acl(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_chmod_acl(vfs_handle_struct *handle, connection_struct *conn, const char *path, mode_t mode); -static int audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, +static int smb_full_audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode); -static int audit_sys_acl_get_entry(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_get_entry(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p); -static int audit_sys_acl_get_tag_type(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_get_tag_type(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p); -static int audit_sys_acl_get_permset(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_get_permset(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p); -static void * audit_sys_acl_get_qualifier(vfs_handle_struct *handle, +static void * smb_full_audit_sys_acl_get_qualifier(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry_d); -static SMB_ACL_T audit_sys_acl_get_file(vfs_handle_struct *handle, +static SMB_ACL_T smb_full_audit_sys_acl_get_file(vfs_handle_struct *handle, connection_struct *conn, const char *path_p, SMB_ACL_TYPE_T type); -static SMB_ACL_T audit_sys_acl_get_fd(vfs_handle_struct *handle, +static SMB_ACL_T smb_full_audit_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp, int fd); -static int audit_sys_acl_clear_perms(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_clear_perms(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_PERMSET_T permset); -static int audit_sys_acl_add_perm(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_add_perm(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm); -static char * audit_sys_acl_to_text(vfs_handle_struct *handle, +static char * smb_full_audit_sys_acl_to_text(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_T theacl, ssize_t *plen); -static SMB_ACL_T audit_sys_acl_init(vfs_handle_struct *handle, +static SMB_ACL_T smb_full_audit_sys_acl_init(vfs_handle_struct *handle, connection_struct *conn, int count); -static int audit_sys_acl_create_entry(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_create_entry(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry); -static int audit_sys_acl_set_tag_type(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_set_tag_type(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype); -static int audit_sys_acl_set_qualifier(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_set_qualifier(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry, void *qual); -static int audit_sys_acl_set_permset(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_set_permset(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset); -static int audit_sys_acl_valid(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_valid(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_T theacl ); -static int audit_sys_acl_set_file(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_set_file(vfs_handle_struct *handle, connection_struct *conn, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl); -static int audit_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, +static int smb_full_audit_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_ACL_T theacl); -static int audit_sys_acl_delete_def_file(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_delete_def_file(vfs_handle_struct *handle, connection_struct *conn, const char *path); -static int audit_sys_acl_get_perm(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_get_perm(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm); -static int audit_sys_acl_free_text(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_free_text(vfs_handle_struct *handle, connection_struct *conn, char *text); -static int audit_sys_acl_free_acl(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_free_acl(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_T posix_acl); -static int audit_sys_acl_free_qualifier(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_free_qualifier(vfs_handle_struct *handle, connection_struct *conn, void *qualifier, SMB_ACL_TAG_T tagtype); -static ssize_t audit_getxattr(struct vfs_handle_struct *handle, +static ssize_t smb_full_audit_getxattr(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, const char *name, void *value, size_t size); -static ssize_t audit_lgetxattr(struct vfs_handle_struct *handle, +static ssize_t smb_full_audit_lgetxattr(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, const char *name, void *value, size_t size); -static ssize_t audit_fgetxattr(struct vfs_handle_struct *handle, +static ssize_t smb_full_audit_fgetxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, const char *name, void *value, size_t size); -static ssize_t audit_listxattr(struct vfs_handle_struct *handle, +static ssize_t smb_full_audit_listxattr(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, char *list, size_t size); -static ssize_t audit_llistxattr(struct vfs_handle_struct *handle, +static ssize_t smb_full_audit_llistxattr(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, char *list, size_t size); -static ssize_t audit_flistxattr(struct vfs_handle_struct *handle, +static ssize_t smb_full_audit_flistxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, char *list, size_t size); -static int audit_removexattr(struct vfs_handle_struct *handle, +static int smb_full_audit_removexattr(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, const char *name); -static int audit_lremovexattr(struct vfs_handle_struct *handle, +static int smb_full_audit_lremovexattr(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, const char *name); -static int audit_fremovexattr(struct vfs_handle_struct *handle, +static int smb_full_audit_fremovexattr(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, const char *name); -static int audit_setxattr(struct vfs_handle_struct *handle, +static int smb_full_audit_setxattr(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, const char *name, const void *value, size_t size, int flags); -static int audit_lsetxattr(struct vfs_handle_struct *handle, +static int smb_full_audit_lsetxattr(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, const char *name, const void *value, size_t size, int flags); -static int audit_fsetxattr(struct vfs_handle_struct *handle, +static int smb_full_audit_fsetxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, const char *name, const void *value, size_t size, int flags); @@ -287,176 +287,176 @@ static vfs_op_tuple audit_op_tuples[] = { /* Disk operations */ - {SMB_VFS_OP(audit_connect), SMB_VFS_OP_CONNECT, + {SMB_VFS_OP(smb_full_audit_connect), SMB_VFS_OP_CONNECT, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_disconnect), SMB_VFS_OP_DISCONNECT, + {SMB_VFS_OP(smb_full_audit_disconnect), SMB_VFS_OP_DISCONNECT, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_disk_free), SMB_VFS_OP_DISK_FREE, + {SMB_VFS_OP(smb_full_audit_disk_free), SMB_VFS_OP_DISK_FREE, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_get_quota), SMB_VFS_OP_GET_QUOTA, + {SMB_VFS_OP(smb_full_audit_get_quota), SMB_VFS_OP_GET_QUOTA, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_set_quota), SMB_VFS_OP_SET_QUOTA, + {SMB_VFS_OP(smb_full_audit_set_quota), SMB_VFS_OP_SET_QUOTA, SMB_VFS_LAYER_LOGGER}, /* Directory operations */ - {SMB_VFS_OP(audit_opendir), SMB_VFS_OP_OPENDIR, + {SMB_VFS_OP(smb_full_audit_opendir), SMB_VFS_OP_OPENDIR, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_readdir), SMB_VFS_OP_READDIR, + {SMB_VFS_OP(smb_full_audit_readdir), SMB_VFS_OP_READDIR, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_mkdir), SMB_VFS_OP_MKDIR, + {SMB_VFS_OP(smb_full_audit_mkdir), SMB_VFS_OP_MKDIR, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_rmdir), SMB_VFS_OP_RMDIR, + {SMB_VFS_OP(smb_full_audit_rmdir), SMB_VFS_OP_RMDIR, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_closedir), SMB_VFS_OP_CLOSEDIR, + {SMB_VFS_OP(smb_full_audit_closedir), SMB_VFS_OP_CLOSEDIR, SMB_VFS_LAYER_LOGGER}, /* File operations */ - {SMB_VFS_OP(audit_open), SMB_VFS_OP_OPEN, + {SMB_VFS_OP(smb_full_audit_open), SMB_VFS_OP_OPEN, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_close), SMB_VFS_OP_CLOSE, + {SMB_VFS_OP(smb_full_audit_close), SMB_VFS_OP_CLOSE, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_read), SMB_VFS_OP_READ, + {SMB_VFS_OP(smb_full_audit_read), SMB_VFS_OP_READ, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_pread), SMB_VFS_OP_PREAD, + {SMB_VFS_OP(smb_full_audit_pread), SMB_VFS_OP_PREAD, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_write), SMB_VFS_OP_WRITE, + {SMB_VFS_OP(smb_full_audit_write), SMB_VFS_OP_WRITE, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_pwrite), SMB_VFS_OP_PWRITE, + {SMB_VFS_OP(smb_full_audit_pwrite), SMB_VFS_OP_PWRITE, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_lseek), SMB_VFS_OP_LSEEK, + {SMB_VFS_OP(smb_full_audit_lseek), SMB_VFS_OP_LSEEK, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_sendfile), SMB_VFS_OP_SENDFILE, + {SMB_VFS_OP(smb_full_audit_sendfile), SMB_VFS_OP_SENDFILE, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_rename), SMB_VFS_OP_RENAME, + {SMB_VFS_OP(smb_full_audit_rename), SMB_VFS_OP_RENAME, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_fsync), SMB_VFS_OP_FSYNC, + {SMB_VFS_OP(smb_full_audit_fsync), SMB_VFS_OP_FSYNC, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_stat), SMB_VFS_OP_STAT, + {SMB_VFS_OP(smb_full_audit_stat), SMB_VFS_OP_STAT, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_fstat), SMB_VFS_OP_FSTAT, + {SMB_VFS_OP(smb_full_audit_fstat), SMB_VFS_OP_FSTAT, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_lstat), SMB_VFS_OP_LSTAT, + {SMB_VFS_OP(smb_full_audit_lstat), SMB_VFS_OP_LSTAT, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_unlink), SMB_VFS_OP_UNLINK, + {SMB_VFS_OP(smb_full_audit_unlink), SMB_VFS_OP_UNLINK, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_chmod), SMB_VFS_OP_CHMOD, + {SMB_VFS_OP(smb_full_audit_chmod), SMB_VFS_OP_CHMOD, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_fchmod), SMB_VFS_OP_FCHMOD, + {SMB_VFS_OP(smb_full_audit_fchmod), SMB_VFS_OP_FCHMOD, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_chown), SMB_VFS_OP_CHOWN, + {SMB_VFS_OP(smb_full_audit_chown), SMB_VFS_OP_CHOWN, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_fchown), SMB_VFS_OP_FCHOWN, + {SMB_VFS_OP(smb_full_audit_fchown), SMB_VFS_OP_FCHOWN, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_chdir), SMB_VFS_OP_CHDIR, + {SMB_VFS_OP(smb_full_audit_chdir), SMB_VFS_OP_CHDIR, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_getwd), SMB_VFS_OP_GETWD, + {SMB_VFS_OP(smb_full_audit_getwd), SMB_VFS_OP_GETWD, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_utime), SMB_VFS_OP_UTIME, + {SMB_VFS_OP(smb_full_audit_utime), SMB_VFS_OP_UTIME, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_ftruncate), SMB_VFS_OP_FTRUNCATE, + {SMB_VFS_OP(smb_full_audit_ftruncate), SMB_VFS_OP_FTRUNCATE, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_lock), SMB_VFS_OP_LOCK, + {SMB_VFS_OP(smb_full_audit_lock), SMB_VFS_OP_LOCK, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_symlink), SMB_VFS_OP_SYMLINK, + {SMB_VFS_OP(smb_full_audit_symlink), SMB_VFS_OP_SYMLINK, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_readlink), SMB_VFS_OP_READLINK, + {SMB_VFS_OP(smb_full_audit_readlink), SMB_VFS_OP_READLINK, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_link), SMB_VFS_OP_LINK, + {SMB_VFS_OP(smb_full_audit_link), SMB_VFS_OP_LINK, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_mknod), SMB_VFS_OP_MKNOD, + {SMB_VFS_OP(smb_full_audit_mknod), SMB_VFS_OP_MKNOD, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_realpath), SMB_VFS_OP_REALPATH, + {SMB_VFS_OP(smb_full_audit_realpath), SMB_VFS_OP_REALPATH, SMB_VFS_LAYER_LOGGER}, /* NT ACL operations. */ - {SMB_VFS_OP(audit_fget_nt_acl), SMB_VFS_OP_FGET_NT_ACL, + {SMB_VFS_OP(smb_full_audit_fget_nt_acl), SMB_VFS_OP_FGET_NT_ACL, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_get_nt_acl), SMB_VFS_OP_GET_NT_ACL, + {SMB_VFS_OP(smb_full_audit_get_nt_acl), SMB_VFS_OP_GET_NT_ACL, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_fset_nt_acl), SMB_VFS_OP_FSET_NT_ACL, + {SMB_VFS_OP(smb_full_audit_fset_nt_acl), SMB_VFS_OP_FSET_NT_ACL, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_set_nt_acl), SMB_VFS_OP_SET_NT_ACL, + {SMB_VFS_OP(smb_full_audit_set_nt_acl), SMB_VFS_OP_SET_NT_ACL, SMB_VFS_LAYER_LOGGER}, /* POSIX ACL operations. */ - {SMB_VFS_OP(audit_chmod_acl), SMB_VFS_OP_CHMOD, + {SMB_VFS_OP(smb_full_audit_chmod_acl), SMB_VFS_OP_CHMOD, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_fchmod_acl), SMB_VFS_OP_FCHMOD, + {SMB_VFS_OP(smb_full_audit_fchmod_acl), SMB_VFS_OP_FCHMOD, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_sys_acl_get_entry), SMB_VFS_OP_SYS_ACL_GET_ENTRY, + {SMB_VFS_OP(smb_full_audit_sys_acl_get_entry), SMB_VFS_OP_SYS_ACL_GET_ENTRY, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_sys_acl_get_tag_type), SMB_VFS_OP_SYS_ACL_GET_TAG_TYPE, + {SMB_VFS_OP(smb_full_audit_sys_acl_get_tag_type), SMB_VFS_OP_SYS_ACL_GET_TAG_TYPE, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_sys_acl_get_permset), SMB_VFS_OP_SYS_ACL_GET_PERMSET, + {SMB_VFS_OP(smb_full_audit_sys_acl_get_permset), SMB_VFS_OP_SYS_ACL_GET_PERMSET, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_sys_acl_get_qualifier), SMB_VFS_OP_SYS_ACL_GET_QUALIFIER, + {SMB_VFS_OP(smb_full_audit_sys_acl_get_qualifier), SMB_VFS_OP_SYS_ACL_GET_QUALIFIER, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_sys_acl_get_file), SMB_VFS_OP_SYS_ACL_GET_FILE, + {SMB_VFS_OP(smb_full_audit_sys_acl_get_file), SMB_VFS_OP_SYS_ACL_GET_FILE, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_sys_acl_get_fd), SMB_VFS_OP_SYS_ACL_GET_FD, + {SMB_VFS_OP(smb_full_audit_sys_acl_get_fd), SMB_VFS_OP_SYS_ACL_GET_FD, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_sys_acl_clear_perms), SMB_VFS_OP_SYS_ACL_CLEAR_PERMS, + {SMB_VFS_OP(smb_full_audit_sys_acl_clear_perms), SMB_VFS_OP_SYS_ACL_CLEAR_PERMS, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_sys_acl_add_perm), SMB_VFS_OP_SYS_ACL_ADD_PERM, + {SMB_VFS_OP(smb_full_audit_sys_acl_add_perm), SMB_VFS_OP_SYS_ACL_ADD_PERM, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_sys_acl_to_text), SMB_VFS_OP_SYS_ACL_TO_TEXT, + {SMB_VFS_OP(smb_full_audit_sys_acl_to_text), SMB_VFS_OP_SYS_ACL_TO_TEXT, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_sys_acl_init), SMB_VFS_OP_SYS_ACL_INIT, + {SMB_VFS_OP(smb_full_audit_sys_acl_init), SMB_VFS_OP_SYS_ACL_INIT, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_sys_acl_create_entry), SMB_VFS_OP_SYS_ACL_CREATE_ENTRY, + {SMB_VFS_OP(smb_full_audit_sys_acl_create_entry), SMB_VFS_OP_SYS_ACL_CREATE_ENTRY, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_sys_acl_set_tag_type), SMB_VFS_OP_SYS_ACL_SET_TAG_TYPE, + {SMB_VFS_OP(smb_full_audit_sys_acl_set_tag_type), SMB_VFS_OP_SYS_ACL_SET_TAG_TYPE, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_sys_acl_set_qualifier), SMB_VFS_OP_SYS_ACL_SET_QUALIFIER, + {SMB_VFS_OP(smb_full_audit_sys_acl_set_qualifier), SMB_VFS_OP_SYS_ACL_SET_QUALIFIER, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_sys_acl_set_permset), SMB_VFS_OP_SYS_ACL_SET_PERMSET, + {SMB_VFS_OP(smb_full_audit_sys_acl_set_permset), SMB_VFS_OP_SYS_ACL_SET_PERMSET, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_sys_acl_valid), SMB_VFS_OP_SYS_ACL_VALID, + {SMB_VFS_OP(smb_full_audit_sys_acl_valid), SMB_VFS_OP_SYS_ACL_VALID, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_sys_acl_set_file), SMB_VFS_OP_SYS_ACL_SET_FILE, + {SMB_VFS_OP(smb_full_audit_sys_acl_set_file), SMB_VFS_OP_SYS_ACL_SET_FILE, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_sys_acl_set_fd), SMB_VFS_OP_SYS_ACL_SET_FD, + {SMB_VFS_OP(smb_full_audit_sys_acl_set_fd), SMB_VFS_OP_SYS_ACL_SET_FD, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_sys_acl_delete_def_file), SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE, + {SMB_VFS_OP(smb_full_audit_sys_acl_delete_def_file), SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_sys_acl_get_perm), SMB_VFS_OP_SYS_ACL_GET_PERM, + {SMB_VFS_OP(smb_full_audit_sys_acl_get_perm), SMB_VFS_OP_SYS_ACL_GET_PERM, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_sys_acl_free_text), SMB_VFS_OP_SYS_ACL_FREE_TEXT, + {SMB_VFS_OP(smb_full_audit_sys_acl_free_text), SMB_VFS_OP_SYS_ACL_FREE_TEXT, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_sys_acl_free_acl), SMB_VFS_OP_SYS_ACL_FREE_ACL, + {SMB_VFS_OP(smb_full_audit_sys_acl_free_acl), SMB_VFS_OP_SYS_ACL_FREE_ACL, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_sys_acl_free_qualifier), SMB_VFS_OP_SYS_ACL_FREE_QUALIFIER, + {SMB_VFS_OP(smb_full_audit_sys_acl_free_qualifier), SMB_VFS_OP_SYS_ACL_FREE_QUALIFIER, SMB_VFS_LAYER_LOGGER}, /* EA operations. */ - {SMB_VFS_OP(audit_getxattr), SMB_VFS_OP_GETXATTR, + {SMB_VFS_OP(smb_full_audit_getxattr), SMB_VFS_OP_GETXATTR, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_lgetxattr), SMB_VFS_OP_LGETXATTR, + {SMB_VFS_OP(smb_full_audit_lgetxattr), SMB_VFS_OP_LGETXATTR, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_fgetxattr), SMB_VFS_OP_FGETXATTR, + {SMB_VFS_OP(smb_full_audit_fgetxattr), SMB_VFS_OP_FGETXATTR, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_listxattr), SMB_VFS_OP_LISTXATTR, + {SMB_VFS_OP(smb_full_audit_listxattr), SMB_VFS_OP_LISTXATTR, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_llistxattr), SMB_VFS_OP_LLISTXATTR, + {SMB_VFS_OP(smb_full_audit_llistxattr), SMB_VFS_OP_LLISTXATTR, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_flistxattr), SMB_VFS_OP_FLISTXATTR, + {SMB_VFS_OP(smb_full_audit_flistxattr), SMB_VFS_OP_FLISTXATTR, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_removexattr), SMB_VFS_OP_REMOVEXATTR, + {SMB_VFS_OP(smb_full_audit_removexattr), SMB_VFS_OP_REMOVEXATTR, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_lremovexattr), SMB_VFS_OP_LREMOVEXATTR, + {SMB_VFS_OP(smb_full_audit_lremovexattr), SMB_VFS_OP_LREMOVEXATTR, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_fremovexattr), SMB_VFS_OP_FREMOVEXATTR, + {SMB_VFS_OP(smb_full_audit_fremovexattr), SMB_VFS_OP_FREMOVEXATTR, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_setxattr), SMB_VFS_OP_SETXATTR, + {SMB_VFS_OP(smb_full_audit_setxattr), SMB_VFS_OP_SETXATTR, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_lsetxattr), SMB_VFS_OP_LSETXATTR, + {SMB_VFS_OP(smb_full_audit_lsetxattr), SMB_VFS_OP_LSETXATTR, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(audit_fsetxattr), SMB_VFS_OP_FSETXATTR, + {SMB_VFS_OP(smb_full_audit_fsetxattr), SMB_VFS_OP_FSETXATTR, SMB_VFS_LAYER_LOGGER}, /* Finish VFS operations definition */ @@ -689,7 +689,7 @@ static void do_log(vfs_op_type op, BOOL success, vfs_handle_struct *handle, /* Implementation of vfs_ops. Pass everything on to the default operation but log event first. */ -static int audit_connect(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_connect(vfs_handle_struct *handle, connection_struct *conn, const char *svc, const char *user) { int result; @@ -713,7 +713,7 @@ static int audit_connect(vfs_handle_struct *handle, connection_struct *conn, return result; } -static void audit_disconnect(vfs_handle_struct *handle, +static void smb_full_audit_disconnect(vfs_handle_struct *handle, connection_struct *conn) { SMB_VFS_NEXT_DISCONNECT(handle, conn); @@ -730,7 +730,7 @@ static void audit_disconnect(vfs_handle_struct *handle, return; } -static SMB_BIG_UINT audit_disk_free(vfs_handle_struct *handle, +static SMB_BIG_UINT smb_full_audit_disk_free(vfs_handle_struct *handle, connection_struct *conn, const char *path, BOOL small_query, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize) @@ -747,7 +747,7 @@ static SMB_BIG_UINT audit_disk_free(vfs_handle_struct *handle, return result; } -static int audit_get_quota(struct vfs_handle_struct *handle, +static int smb_full_audit_get_quota(struct vfs_handle_struct *handle, struct connection_struct *conn, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt) @@ -762,7 +762,7 @@ static int audit_get_quota(struct vfs_handle_struct *handle, } -static int audit_set_quota(struct vfs_handle_struct *handle, +static int smb_full_audit_set_quota(struct vfs_handle_struct *handle, struct connection_struct *conn, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt) @@ -776,7 +776,7 @@ static int audit_set_quota(struct vfs_handle_struct *handle, return result; } -static DIR *audit_opendir(vfs_handle_struct *handle, connection_struct *conn, +static DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname) { DIR *result; @@ -788,7 +788,7 @@ static DIR *audit_opendir(vfs_handle_struct *handle, connection_struct *conn, return result; } -static struct dirent *audit_readdir(vfs_handle_struct *handle, +static struct dirent *smb_full_audit_readdir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp) { struct dirent *result; @@ -803,7 +803,7 @@ static struct dirent *audit_readdir(vfs_handle_struct *handle, return result; } -static int audit_mkdir(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_mkdir(vfs_handle_struct *handle, connection_struct *conn, const char *path, mode_t mode) { int result; @@ -815,7 +815,7 @@ static int audit_mkdir(vfs_handle_struct *handle, connection_struct *conn, return result; } -static int audit_rmdir(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_rmdir(vfs_handle_struct *handle, connection_struct *conn, const char *path) { int result; @@ -827,7 +827,7 @@ static int audit_rmdir(vfs_handle_struct *handle, connection_struct *conn, return result; } -static int audit_closedir(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_closedir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp) { int result; @@ -839,7 +839,7 @@ static int audit_closedir(vfs_handle_struct *handle, connection_struct *conn, return result; } -static int audit_open(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_open(vfs_handle_struct *handle, connection_struct *conn, const char *fname, int flags, mode_t mode) { int result; @@ -853,7 +853,7 @@ static int audit_open(vfs_handle_struct *handle, connection_struct *conn, return result; } -static int audit_close(vfs_handle_struct *handle, files_struct *fsp, int fd) +static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp, int fd) { int result; @@ -864,7 +864,7 @@ static int audit_close(vfs_handle_struct *handle, files_struct *fsp, int fd) return result; } -static ssize_t audit_read(vfs_handle_struct *handle, files_struct *fsp, +static ssize_t smb_full_audit_read(vfs_handle_struct *handle, files_struct *fsp, int fd, void *data, size_t n) { ssize_t result; @@ -876,7 +876,7 @@ static ssize_t audit_read(vfs_handle_struct *handle, files_struct *fsp, return result; } -static ssize_t audit_pread(vfs_handle_struct *handle, files_struct *fsp, +static ssize_t smb_full_audit_pread(vfs_handle_struct *handle, files_struct *fsp, int fd, void *data, size_t n, SMB_OFF_T offset) { ssize_t result; @@ -888,7 +888,7 @@ static ssize_t audit_pread(vfs_handle_struct *handle, files_struct *fsp, return result; } -static ssize_t audit_write(vfs_handle_struct *handle, files_struct *fsp, +static ssize_t smb_full_audit_write(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data, size_t n) { ssize_t result; @@ -900,7 +900,7 @@ static ssize_t audit_write(vfs_handle_struct *handle, files_struct *fsp, return result; } -static ssize_t audit_pwrite(vfs_handle_struct *handle, files_struct *fsp, +static ssize_t smb_full_audit_pwrite(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data, size_t n, SMB_OFF_T offset) { @@ -913,7 +913,7 @@ static ssize_t audit_pwrite(vfs_handle_struct *handle, files_struct *fsp, return result; } -static SMB_OFF_T audit_lseek(vfs_handle_struct *handle, files_struct *fsp, +static SMB_OFF_T smb_full_audit_lseek(vfs_handle_struct *handle, files_struct *fsp, int filedes, SMB_OFF_T offset, int whence) { ssize_t result; @@ -926,7 +926,7 @@ static SMB_OFF_T audit_lseek(vfs_handle_struct *handle, files_struct *fsp, return result; } -static ssize_t audit_sendfile(vfs_handle_struct *handle, int tofd, +static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fsp, int fromfd, const DATA_BLOB *hdr, SMB_OFF_T offset, size_t n) @@ -942,7 +942,7 @@ static ssize_t audit_sendfile(vfs_handle_struct *handle, int tofd, return result; } -static int audit_rename(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_rename(vfs_handle_struct *handle, connection_struct *conn, const char *old, const char *new) { int result; @@ -954,7 +954,7 @@ static int audit_rename(vfs_handle_struct *handle, connection_struct *conn, return result; } -static int audit_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd) +static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd) { int result; @@ -965,7 +965,7 @@ static int audit_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd) return result; } -static int audit_stat(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_stat(vfs_handle_struct *handle, connection_struct *conn, const char *fname, SMB_STRUCT_STAT *sbuf) { int result; @@ -977,7 +977,7 @@ static int audit_stat(vfs_handle_struct *handle, connection_struct *conn, return result; } -static int audit_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd, +static int smb_full_audit_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_STRUCT_STAT *sbuf) { int result; @@ -989,7 +989,7 @@ static int audit_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd, return result; } -static int audit_lstat(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_lstat(vfs_handle_struct *handle, connection_struct *conn, const char *path, SMB_STRUCT_STAT *sbuf) { int result; @@ -1001,7 +1001,7 @@ static int audit_lstat(vfs_handle_struct *handle, connection_struct *conn, return result; } -static int audit_unlink(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_unlink(vfs_handle_struct *handle, connection_struct *conn, const char *path) { int result; @@ -1013,7 +1013,7 @@ static int audit_unlink(vfs_handle_struct *handle, connection_struct *conn, return result; } -static int audit_chmod(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_chmod(vfs_handle_struct *handle, connection_struct *conn, const char *path, mode_t mode) { int result; @@ -1025,7 +1025,7 @@ static int audit_chmod(vfs_handle_struct *handle, connection_struct *conn, return result; } -static int audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, +static int smb_full_audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode) { int result; @@ -1038,7 +1038,7 @@ static int audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, return result; } -static int audit_chown(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_chown(vfs_handle_struct *handle, connection_struct *conn, const char *path, uid_t uid, gid_t gid) { int result; @@ -1051,7 +1051,7 @@ static int audit_chown(vfs_handle_struct *handle, connection_struct *conn, return result; } -static int audit_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd, +static int smb_full_audit_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd, uid_t uid, gid_t gid) { int result; @@ -1064,7 +1064,7 @@ static int audit_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd, return result; } -static int audit_chdir(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_chdir(vfs_handle_struct *handle, connection_struct *conn, const char *path) { int result; @@ -1076,7 +1076,7 @@ static int audit_chdir(vfs_handle_struct *handle, connection_struct *conn, return result; } -static char *audit_getwd(vfs_handle_struct *handle, connection_struct *conn, +static char *smb_full_audit_getwd(vfs_handle_struct *handle, connection_struct *conn, char *path) { char *result; @@ -1088,7 +1088,7 @@ static char *audit_getwd(vfs_handle_struct *handle, connection_struct *conn, return result; } -static int audit_utime(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_utime(vfs_handle_struct *handle, connection_struct *conn, const char *path, struct utimbuf *times) { int result; @@ -1100,7 +1100,7 @@ static int audit_utime(vfs_handle_struct *handle, connection_struct *conn, return result; } -static int audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp, +static int smb_full_audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T len) { int result; @@ -1113,7 +1113,7 @@ static int audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp, return result; } -static BOOL audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, +static BOOL smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type) { BOOL result; @@ -1125,7 +1125,7 @@ static BOOL audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, return result; } -static int audit_symlink(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_symlink(vfs_handle_struct *handle, connection_struct *conn, const char *oldpath, const char *newpath) { int result; @@ -1138,7 +1138,7 @@ static int audit_symlink(vfs_handle_struct *handle, connection_struct *conn, return result; } -static int audit_readlink(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_readlink(vfs_handle_struct *handle, connection_struct *conn, const char *path, char *buf, size_t bufsiz) { int result; @@ -1150,7 +1150,7 @@ static int audit_readlink(vfs_handle_struct *handle, connection_struct *conn, return result; } -static int audit_link(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_link(vfs_handle_struct *handle, connection_struct *conn, const char *oldpath, const char *newpath) { int result; @@ -1163,7 +1163,7 @@ static int audit_link(vfs_handle_struct *handle, connection_struct *conn, return result; } -static int audit_mknod(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_mknod(vfs_handle_struct *handle, connection_struct *conn, const char *pathname, mode_t mode, SMB_DEV_T dev) { int result; @@ -1175,7 +1175,7 @@ static int audit_mknod(vfs_handle_struct *handle, connection_struct *conn, return result; } -static char *audit_realpath(vfs_handle_struct *handle, connection_struct *conn, +static char *smb_full_audit_realpath(vfs_handle_struct *handle, connection_struct *conn, const char *path, char *resolved_path) { char *result; @@ -1187,7 +1187,7 @@ static char *audit_realpath(vfs_handle_struct *handle, connection_struct *conn, return result; } -static size_t audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, +static size_t smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info, SEC_DESC **ppdesc) { @@ -1202,7 +1202,7 @@ static size_t audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, return result; } -static size_t audit_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, +static size_t smb_full_audit_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info, SEC_DESC **ppdesc) { @@ -1217,7 +1217,7 @@ static size_t audit_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, return result; } -static BOOL audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, +static BOOL smb_full_audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info_sent, SEC_DESC *psd) { @@ -1231,7 +1231,7 @@ static BOOL audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, return result; } -static BOOL audit_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, +static BOOL smb_full_audit_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info_sent, SEC_DESC *psd) { @@ -1245,7 +1245,7 @@ static BOOL audit_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, return result; } -static int audit_chmod_acl(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_chmod_acl(vfs_handle_struct *handle, connection_struct *conn, const char *path, mode_t mode) { int result; @@ -1258,7 +1258,7 @@ static int audit_chmod_acl(vfs_handle_struct *handle, connection_struct *conn, return result; } -static int audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, +static int smb_full_audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode) { int result; @@ -1271,7 +1271,7 @@ static int audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, return result; } -static int audit_sys_acl_get_entry(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_get_entry(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p) @@ -1287,7 +1287,7 @@ static int audit_sys_acl_get_entry(vfs_handle_struct *handle, return result; } -static int audit_sys_acl_get_tag_type(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_get_tag_type(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p) @@ -1303,7 +1303,7 @@ static int audit_sys_acl_get_tag_type(vfs_handle_struct *handle, return result; } -static int audit_sys_acl_get_permset(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_get_permset(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p) @@ -1319,7 +1319,7 @@ static int audit_sys_acl_get_permset(vfs_handle_struct *handle, return result; } -static void * audit_sys_acl_get_qualifier(vfs_handle_struct *handle, +static void * smb_full_audit_sys_acl_get_qualifier(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry_d) { @@ -1333,7 +1333,7 @@ static void * audit_sys_acl_get_qualifier(vfs_handle_struct *handle, return result; } -static SMB_ACL_T audit_sys_acl_get_file(vfs_handle_struct *handle, +static SMB_ACL_T smb_full_audit_sys_acl_get_file(vfs_handle_struct *handle, connection_struct *conn, const char *path_p, SMB_ACL_TYPE_T type) @@ -1348,7 +1348,7 @@ static SMB_ACL_T audit_sys_acl_get_file(vfs_handle_struct *handle, return result; } -static SMB_ACL_T audit_sys_acl_get_fd(vfs_handle_struct *handle, +static SMB_ACL_T smb_full_audit_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp, int fd) { SMB_ACL_T result; @@ -1361,7 +1361,7 @@ static SMB_ACL_T audit_sys_acl_get_fd(vfs_handle_struct *handle, return result; } -static int audit_sys_acl_clear_perms(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_clear_perms(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_PERMSET_T permset) { @@ -1375,7 +1375,7 @@ static int audit_sys_acl_clear_perms(vfs_handle_struct *handle, return result; } -static int audit_sys_acl_add_perm(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_add_perm(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm) @@ -1390,7 +1390,7 @@ static int audit_sys_acl_add_perm(vfs_handle_struct *handle, return result; } -static char * audit_sys_acl_to_text(vfs_handle_struct *handle, +static char * smb_full_audit_sys_acl_to_text(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_T theacl, ssize_t *plen) { @@ -1404,7 +1404,7 @@ static char * audit_sys_acl_to_text(vfs_handle_struct *handle, return result; } -static SMB_ACL_T audit_sys_acl_init(vfs_handle_struct *handle, +static SMB_ACL_T smb_full_audit_sys_acl_init(vfs_handle_struct *handle, connection_struct *conn, int count) { @@ -1418,7 +1418,7 @@ static SMB_ACL_T audit_sys_acl_init(vfs_handle_struct *handle, return result; } -static int audit_sys_acl_create_entry(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_create_entry(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry) { @@ -1432,7 +1432,7 @@ static int audit_sys_acl_create_entry(vfs_handle_struct *handle, return result; } -static int audit_sys_acl_set_tag_type(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_set_tag_type(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype) @@ -1448,7 +1448,7 @@ static int audit_sys_acl_set_tag_type(vfs_handle_struct *handle, return result; } -static int audit_sys_acl_set_qualifier(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_set_qualifier(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry, void *qual) @@ -1463,7 +1463,7 @@ static int audit_sys_acl_set_qualifier(vfs_handle_struct *handle, return result; } -static int audit_sys_acl_set_permset(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_set_permset(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset) @@ -1478,7 +1478,7 @@ static int audit_sys_acl_set_permset(vfs_handle_struct *handle, return result; } -static int audit_sys_acl_valid(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_valid(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_T theacl ) { @@ -1492,7 +1492,7 @@ static int audit_sys_acl_valid(vfs_handle_struct *handle, return result; } -static int audit_sys_acl_set_file(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_set_file(vfs_handle_struct *handle, connection_struct *conn, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl) @@ -1508,7 +1508,7 @@ static int audit_sys_acl_set_file(vfs_handle_struct *handle, return result; } -static int audit_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, +static int smb_full_audit_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_ACL_T theacl) { int result; @@ -1521,7 +1521,7 @@ static int audit_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, return result; } -static int audit_sys_acl_delete_def_file(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_delete_def_file(vfs_handle_struct *handle, connection_struct *conn, const char *path) { @@ -1535,7 +1535,7 @@ static int audit_sys_acl_delete_def_file(vfs_handle_struct *handle, return result; } -static int audit_sys_acl_get_perm(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_get_perm(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm) @@ -1550,7 +1550,7 @@ static int audit_sys_acl_get_perm(vfs_handle_struct *handle, return result; } -static int audit_sys_acl_free_text(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_free_text(vfs_handle_struct *handle, connection_struct *conn, char *text) { @@ -1564,7 +1564,7 @@ static int audit_sys_acl_free_text(vfs_handle_struct *handle, return result; } -static int audit_sys_acl_free_acl(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_free_acl(vfs_handle_struct *handle, connection_struct *conn, SMB_ACL_T posix_acl) { @@ -1578,7 +1578,7 @@ static int audit_sys_acl_free_acl(vfs_handle_struct *handle, return result; } -static int audit_sys_acl_free_qualifier(vfs_handle_struct *handle, +static int smb_full_audit_sys_acl_free_qualifier(vfs_handle_struct *handle, connection_struct *conn, void *qualifier, SMB_ACL_TAG_T tagtype) @@ -1594,7 +1594,7 @@ static int audit_sys_acl_free_qualifier(vfs_handle_struct *handle, return result; } -static ssize_t audit_getxattr(struct vfs_handle_struct *handle, +static ssize_t smb_full_audit_getxattr(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, const char *name, void *value, size_t size) { @@ -1608,7 +1608,7 @@ static ssize_t audit_getxattr(struct vfs_handle_struct *handle, return result; } -static ssize_t audit_lgetxattr(struct vfs_handle_struct *handle, +static ssize_t smb_full_audit_lgetxattr(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, const char *name, void *value, size_t size) @@ -1623,7 +1623,7 @@ static ssize_t audit_lgetxattr(struct vfs_handle_struct *handle, return result; } -static ssize_t audit_fgetxattr(struct vfs_handle_struct *handle, +static ssize_t smb_full_audit_fgetxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, const char *name, void *value, size_t size) { @@ -1637,7 +1637,7 @@ static ssize_t audit_fgetxattr(struct vfs_handle_struct *handle, return result; } -static ssize_t audit_listxattr(struct vfs_handle_struct *handle, +static ssize_t smb_full_audit_listxattr(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, char *list, size_t size) { @@ -1650,7 +1650,7 @@ static ssize_t audit_listxattr(struct vfs_handle_struct *handle, return result; } -static ssize_t audit_llistxattr(struct vfs_handle_struct *handle, +static ssize_t smb_full_audit_llistxattr(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, char *list, size_t size) { @@ -1663,7 +1663,7 @@ static ssize_t audit_llistxattr(struct vfs_handle_struct *handle, return result; } -static ssize_t audit_flistxattr(struct vfs_handle_struct *handle, +static ssize_t smb_full_audit_flistxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, char *list, size_t size) { @@ -1677,7 +1677,7 @@ static ssize_t audit_flistxattr(struct vfs_handle_struct *handle, return result; } -static int audit_removexattr(struct vfs_handle_struct *handle, +static int smb_full_audit_removexattr(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, const char *name) { @@ -1691,7 +1691,7 @@ static int audit_removexattr(struct vfs_handle_struct *handle, return result; } -static int audit_lremovexattr(struct vfs_handle_struct *handle, +static int smb_full_audit_lremovexattr(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, const char *name) { @@ -1705,7 +1705,7 @@ static int audit_lremovexattr(struct vfs_handle_struct *handle, return result; } -static int audit_fremovexattr(struct vfs_handle_struct *handle, +static int smb_full_audit_fremovexattr(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, const char *name) { @@ -1719,7 +1719,7 @@ static int audit_fremovexattr(struct vfs_handle_struct *handle, return result; } -static int audit_setxattr(struct vfs_handle_struct *handle, +static int smb_full_audit_setxattr(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, const char *name, const void *value, size_t size, int flags) @@ -1735,7 +1735,7 @@ static int audit_setxattr(struct vfs_handle_struct *handle, return result; } -static int audit_lsetxattr(struct vfs_handle_struct *handle, +static int smb_full_audit_lsetxattr(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, const char *name, const void *value, size_t size, int flags) @@ -1751,7 +1751,7 @@ static int audit_lsetxattr(struct vfs_handle_struct *handle, return result; } -static int audit_fsetxattr(struct vfs_handle_struct *handle, +static int smb_full_audit_fsetxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, const char *name, const void *value, size_t size, int flags) { -- cgit From 314a601274ab6d1c2c8b064a413d9c463095b65a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 10 Nov 2004 19:34:13 +0000 Subject: r3662: Fix dirent return. Jeremy. (This used to be commit da4117841db731da8f1b7fe7c2524e9d4d60f09a) --- source3/modules/vfs_full_audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 b27c916a2a..e91c1813a8 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -84,7 +84,7 @@ static int smb_full_audit_set_quota(struct vfs_handle_struct *handle, SMB_DISK_QUOTA *qt); static DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname); -static struct dirent *smb_full_audit_readdir(vfs_handle_struct *handle, +static SMB_STRUCT_DIRENT *smb_full_audit_readdir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp); static int smb_full_audit_mkdir(vfs_handle_struct *handle, connection_struct *conn, const char *path, mode_t mode); -- cgit From e87470fa3fa557c3fbf0f59f4c3a91d9a468fa0e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 10 Nov 2004 23:02:48 +0000 Subject: r3670: Warning fixes from Rob Foehl . Jeremy. (This used to be commit 54da75ca4cc27dfb0012fd17047702ec2f39cae9) --- source3/modules/vfs_full_audit.c | 46 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) (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 e91c1813a8..09215d1e8d 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -86,6 +86,12 @@ static DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct const char *fname); static SMB_STRUCT_DIRENT *smb_full_audit_readdir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp); +static void smb_full_audit_seekdir(vfs_handle_struct *handle, connection_struct *conn, + DIR *dirp, long offset); +static long smb_full_audit_telldir(vfs_handle_struct *handle, connection_struct *conn, + DIR *dirp); +static void smb_full_audit_rewinddir(vfs_handle_struct *handle, connection_struct *conn, + DIR *dirp); static int smb_full_audit_mkdir(vfs_handle_struct *handle, connection_struct *conn, const char *path, mode_t mode); static int smb_full_audit_rmdir(vfs_handle_struct *handle, connection_struct *conn, @@ -304,6 +310,12 @@ static vfs_op_tuple audit_op_tuples[] = { SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_readdir), SMB_VFS_OP_READDIR, SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(smb_full_audit_seekdir), SMB_VFS_OP_SEEKDIR, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(smb_full_audit_telldir), SMB_VFS_OP_TELLDIR, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(smb_full_audit_rewinddir), SMB_VFS_OP_REWINDDIR, + SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_mkdir), SMB_VFS_OP_MKDIR, SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_rmdir), SMB_VFS_OP_RMDIR, @@ -788,10 +800,10 @@ static DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct return result; } -static struct dirent *smb_full_audit_readdir(vfs_handle_struct *handle, +static SMB_STRUCT_DIRENT *smb_full_audit_readdir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp) { - struct dirent *result; + SMB_STRUCT_DIRENT *result; result = SMB_VFS_NEXT_READDIR(handle, conn, dirp); @@ -803,6 +815,36 @@ static struct dirent *smb_full_audit_readdir(vfs_handle_struct *handle, return result; } +static void smb_full_audit_seekdir(vfs_handle_struct *handle, connection_struct *conn, + DIR *dirp, long offset) +{ + SMB_VFS_NEXT_SEEKDIR(handle, conn, dirp, offset); + + do_log(SMB_VFS_OP_SEEKDIR, True, handle, ""); + return; +} + +static long smb_full_audit_telldir(vfs_handle_struct *handle, connection_struct *conn, + DIR *dirp) +{ + long result; + + result = SMB_VFS_NEXT_TELLDIR(handle, conn, dirp); + + do_log(SMB_VFS_OP_OPENDIR, True, handle, ""); + + return result; +} + +static void smb_full_audit_rewinddir(vfs_handle_struct *handle, connection_struct *conn, + DIR *dirp) +{ + SMB_VFS_NEXT_REWINDDIR(handle, conn, dirp); + + do_log(SMB_VFS_OP_REWINDDIR, True, handle, ""); + return; +} + static int smb_full_audit_mkdir(vfs_handle_struct *handle, connection_struct *conn, const char *path, mode_t mode) { -- cgit From 99db77b2b2ce078c1097aaca2631aeee35544f5a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 16 Mar 2005 00:40:28 +0000 Subject: r5820: Fix bug #2451 - missing functions in full audit vfs module. Jeremy. (This used to be commit dc6fbc0268b79c5d53319d77e14a59f158cfd55d) --- source3/modules/vfs_full_audit.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (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 09215d1e8d..430ec8278a 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -82,6 +82,10 @@ static int smb_full_audit_set_quota(struct vfs_handle_struct *handle, struct connection_struct *conn, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt); +static int smb_full_audit_get_shadow_copy_data(struct vfs_handle_struct *handle, + struct files_struct *fsp, + SHADOW_COPY_DATA *shadow_copy_data, BOOL labels); + static DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname); static SMB_STRUCT_DIRENT *smb_full_audit_readdir(vfs_handle_struct *handle, @@ -303,6 +307,8 @@ static vfs_op_tuple audit_op_tuples[] = { SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_set_quota), SMB_VFS_OP_SET_QUOTA, SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(smb_full_audit_get_shadow_copy_data), SMB_VFS_OP_GET_SHADOW_COPY_DATA, + SMB_VFS_LAYER_LOGGER}, /* Directory operations */ @@ -395,9 +401,9 @@ static vfs_op_tuple audit_op_tuples[] = { /* POSIX ACL operations. */ - {SMB_VFS_OP(smb_full_audit_chmod_acl), SMB_VFS_OP_CHMOD, + {SMB_VFS_OP(smb_full_audit_chmod_acl), SMB_VFS_OP_CHMOD_ACL, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_fchmod_acl), SMB_VFS_OP_FCHMOD, + {SMB_VFS_OP(smb_full_audit_fchmod_acl), SMB_VFS_OP_FCHMOD_ACL, SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_sys_acl_get_entry), SMB_VFS_OP_SYS_ACL_GET_ENTRY, SMB_VFS_LAYER_LOGGER}, @@ -788,6 +794,19 @@ static int smb_full_audit_set_quota(struct vfs_handle_struct *handle, return result; } +static int smb_full_audit_get_shadow_copy_data(struct vfs_handle_struct *handle, + struct files_struct *fsp, + SHADOW_COPY_DATA *shadow_copy_data, BOOL labels) +{ + int result; + + result = SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle, fsp, shadow_copy_data, labels); + + do_log(SMB_VFS_OP_GET_SHADOW_COPY_DATA, (result >= 0), handle, ""); + + return result; +} + static DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname) { -- cgit From 67e03ce4663378e6c40b6bb134a5a820ac6bc8d0 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 13 May 2005 12:05:14 +0000 Subject: r6777: Fix vfs_full_audit.c after jra's change. Volker (This used to be commit 16af4645822f1b3cf39c6dffbbb8ef6b1c9d7751) --- source3/modules/vfs_full_audit.c | 8 ++++++++ 1 file changed, 8 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 430ec8278a..3c0098408e 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -497,6 +497,9 @@ static struct { { SMB_VFS_OP_GET_SHADOW_COPY_DATA, "get_shadow_copy_data" }, { SMB_VFS_OP_OPENDIR, "opendir" }, { SMB_VFS_OP_READDIR, "readdir" }, + { SMB_VFS_OP_SEEKDIR, "seekdir" }, + { SMB_VFS_OP_TELLDIR, "telldir" }, + { SMB_VFS_OP_REWINDDIR, "rewinddir" }, { SMB_VFS_OP_MKDIR, "mkdir" }, { SMB_VFS_OP_RMDIR, "rmdir" }, { SMB_VFS_OP_CLOSEDIR, "closedir" }, @@ -648,6 +651,11 @@ static void init_bitmap(struct bitmap **bm, const char **ops) } for (i=0; i Date: Fri, 24 Jun 2005 20:25:18 +0000 Subject: r7882: Looks like a large patch - but what it actually does is make Samba safe for using our headers and linking with C++ modules. Stops us from using C++ reserved keywords in our code. Jeremy (This used to be commit 9506b8e145982b1160a2f0aee5c9b7a54980940a) --- source3/modules/vfs_full_audit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (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 3c0098408e..d2ac9b7c16 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -121,7 +121,7 @@ static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd, const DATA_BLOB *hdr, SMB_OFF_T offset, size_t n); static int smb_full_audit_rename(vfs_handle_struct *handle, connection_struct *conn, - const char *old, const char *new); + const char *oldname, const char *newname); static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd); static int smb_full_audit_stat(vfs_handle_struct *handle, connection_struct *conn, const char *fname, SMB_STRUCT_STAT *sbuf); @@ -1012,13 +1012,13 @@ static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd, } static int smb_full_audit_rename(vfs_handle_struct *handle, connection_struct *conn, - const char *old, const char *new) + const char *oldname, const char *newname) { int result; - result = SMB_VFS_NEXT_RENAME(handle, conn, old, new); + result = SMB_VFS_NEXT_RENAME(handle, conn, oldname, newname); - do_log(SMB_VFS_OP_RENAME, (result >= 0), handle, "%s|%s", old, new); + do_log(SMB_VFS_OP_RENAME, (result >= 0), handle, "%s|%s", oldname, newname); return result; } -- cgit From ff7e5c26733c933d0ed71616c39e2d931ad1e597 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 25 Jun 2005 03:03:44 +0000 Subject: r7893: Add in the extra parameters to opendir() to fix the large directory/insane app problem. Rev vfs version. Doesn't change the normal codepath. Jeremy. (This used to be commit 0f03a6bdcdbdf60da81e0aeffa84ac6e48fc6a04) --- source3/modules/vfs_full_audit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (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 d2ac9b7c16..abb77bcbf4 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -87,7 +87,7 @@ static int smb_full_audit_get_shadow_copy_data(struct vfs_handle_struct *handle, SHADOW_COPY_DATA *shadow_copy_data, BOOL labels); static DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct *conn, - const char *fname); + const char *fname, const char *mask, uint32 attr); static SMB_STRUCT_DIRENT *smb_full_audit_readdir(vfs_handle_struct *handle, connection_struct *conn, DIR *dirp); static void smb_full_audit_seekdir(vfs_handle_struct *handle, connection_struct *conn, @@ -816,11 +816,11 @@ static int smb_full_audit_get_shadow_copy_data(struct vfs_handle_struct *handle, } static DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct *conn, - const char *fname) + const char *fname, const char *mask, uint32 attr) { DIR *result; - result = SMB_VFS_NEXT_OPENDIR(handle, conn, fname); + result = SMB_VFS_NEXT_OPENDIR(handle, conn, fname, mask, attr); do_log(SMB_VFS_OP_OPENDIR, (result != NULL), handle, "%s", fname); -- cgit From f2f55d703d0dd549a83809d3e5cc5151569b48d6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 27 Jun 2005 22:53:56 +0000 Subject: r7963: Add aio support to 3.0. Jeremy. (This used to be commit 1de27da47051af08790317f5b48b02719d6b9934) --- source3/modules/vfs_full_audit.c | 108 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 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 abb77bcbf4..aa9e047f0a 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -291,6 +291,14 @@ static int smb_full_audit_fsetxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, const char *name, const void *value, size_t size, int flags); +static int smb_full_audit_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); +static int smb_full_audit_aio_write(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); +static ssize_t smb_full_audit_aio_return(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); +static int smb_full_audit_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_STRUCT_AIOCB *aiocb); +static int smb_full_audit_aio_error(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); +static int smb_full_audit_aio_fsync(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb); +static int smb_full_audit_aio_suspend(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_AIOCB * const aiocb[], int n, const struct timespec *ts); + /* VFS operations */ static vfs_op_tuple audit_op_tuples[] = { @@ -477,6 +485,21 @@ static vfs_op_tuple audit_op_tuples[] = { {SMB_VFS_OP(smb_full_audit_fsetxattr), SMB_VFS_OP_FSETXATTR, SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(smb_full_audit_aio_read), SMB_VFS_OP_AIO_READ, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(smb_full_audit_aio_write), SMB_VFS_OP_AIO_WRITE, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(smb_full_audit_aio_return), SMB_VFS_OP_AIO_RETURN, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(smb_full_audit_aio_cancel), SMB_VFS_OP_AIO_CANCEL, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(smb_full_audit_aio_error), SMB_VFS_OP_AIO_ERROR, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(smb_full_audit_aio_fsync), SMB_VFS_OP_AIO_FSYNC, + SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(smb_full_audit_aio_suspend),SMB_VFS_OP_AIO_SUSPEND, + SMB_VFS_LAYER_LOGGER}, + /* Finish VFS operations definition */ {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, @@ -571,6 +594,13 @@ static struct { { SMB_VFS_OP_SETXATTR, "setxattr" }, { SMB_VFS_OP_LSETXATTR, "lsetxattr" }, { SMB_VFS_OP_FSETXATTR, "fsetxattr" }, + { SMB_VFS_OP_AIO_READ, "aio_read" }, + { SMB_VFS_OP_AIO_WRITE, "aio_write" }, + { SMB_VFS_OP_AIO_RETURN,"aio_return" }, + { SMB_VFS_OP_AIO_CANCEL,"aio_cancel" }, + { SMB_VFS_OP_AIO_ERROR, "aio_error" }, + { SMB_VFS_OP_AIO_FSYNC, "aio_fsync" }, + { SMB_VFS_OP_AIO_SUSPEND,"aio_suspend" }, { SMB_VFS_OP_LAST, NULL } }; @@ -1835,6 +1865,84 @@ static int smb_full_audit_fsetxattr(struct vfs_handle_struct *handle, return result; } +static int smb_full_audit_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) +{ + int result; + + result = SMB_VFS_NEXT_AIO_READ(handle, fsp, aiocb); + do_log(SMB_VFS_OP_AIO_READ, (result >= 0), handle, + "%s", fsp->fsp_name); + + return result; +} + +static int smb_full_audit_aio_write(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) +{ + int result; + + result = SMB_VFS_NEXT_AIO_WRITE(handle, fsp, aiocb); + do_log(SMB_VFS_OP_AIO_WRITE, (result >= 0), handle, + "%s", fsp->fsp_name); + + return result; +} + +static ssize_t smb_full_audit_aio_return(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) +{ + int result; + + result = SMB_VFS_NEXT_AIO_RETURN(handle, fsp, aiocb); + do_log(SMB_VFS_OP_AIO_RETURN, (result >= 0), handle, + "%s", fsp->fsp_name); + + return result; +} + +static int smb_full_audit_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_STRUCT_AIOCB *aiocb) +{ + int result; + + result = SMB_VFS_NEXT_AIO_CANCEL(handle, fsp, fd, aiocb); + do_log(SMB_VFS_OP_AIO_CANCEL, (result >= 0), handle, + "%s", fsp->fsp_name); + + return result; +} + +static int smb_full_audit_aio_error(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) +{ + int result; + + result = SMB_VFS_NEXT_AIO_ERROR(handle, fsp, aiocb); + do_log(SMB_VFS_OP_AIO_ERROR, (result >= 0), handle, + "%s", fsp->fsp_name); + + return result; +} + +static int smb_full_audit_aio_fsync(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb) +{ + int result; + + result = SMB_VFS_NEXT_AIO_FSYNC(handle, fsp, op, aiocb); + do_log(SMB_VFS_OP_AIO_FSYNC, (result >= 0), handle, + "%s", fsp->fsp_name); + + return result; +} + +static int smb_full_audit_aio_suspend(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_AIOCB * const aiocb[], int n, const struct timespec *ts) +{ + int result; + + result = SMB_VFS_NEXT_AIO_SUSPEND(handle, fsp, aiocb, n, ts); + do_log(SMB_VFS_OP_AIO_SUSPEND, (result >= 0), handle, + "%s", fsp->fsp_name); + + return result; +} + + NTSTATUS vfs_full_audit_init(void) { NTSTATUS ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION, -- cgit From f98f86394a654722fa13ef1dc3c4dea82d452442 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 22 Aug 2005 18:03:08 +0000 Subject: r9483: Changed DIR to SMB_STRUCT_DIR because of the amazing stupidity of a UNIX vendor not understanding abstract data types :-(. Jeremy. (This used to be commit be5b4e2fa3ed30b0ff01b47d2354e5f782a12e25) --- source3/modules/vfs_full_audit.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (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 aa9e047f0a..d79e2e8f1c 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -86,22 +86,22 @@ static int smb_full_audit_get_shadow_copy_data(struct vfs_handle_struct *handle, struct files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, BOOL labels); -static DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct *conn, +static SMB_STRUCT_DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr); static SMB_STRUCT_DIRENT *smb_full_audit_readdir(vfs_handle_struct *handle, - connection_struct *conn, DIR *dirp); + connection_struct *conn, SMB_STRUCT_DIR *dirp); static void smb_full_audit_seekdir(vfs_handle_struct *handle, connection_struct *conn, - DIR *dirp, long offset); + SMB_STRUCT_DIR *dirp, long offset); static long smb_full_audit_telldir(vfs_handle_struct *handle, connection_struct *conn, - DIR *dirp); + SMB_STRUCT_DIR *dirp); static void smb_full_audit_rewinddir(vfs_handle_struct *handle, connection_struct *conn, - DIR *dirp); + SMB_STRUCT_DIR *dirp); static int smb_full_audit_mkdir(vfs_handle_struct *handle, connection_struct *conn, const char *path, mode_t mode); static int smb_full_audit_rmdir(vfs_handle_struct *handle, connection_struct *conn, const char *path); static int smb_full_audit_closedir(vfs_handle_struct *handle, connection_struct *conn, - DIR *dirp); + SMB_STRUCT_DIR *dirp); static int smb_full_audit_open(vfs_handle_struct *handle, connection_struct *conn, const char *fname, int flags, mode_t mode); static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp, int fd); @@ -845,10 +845,10 @@ static int smb_full_audit_get_shadow_copy_data(struct vfs_handle_struct *handle, return result; } -static DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct *conn, +static SMB_STRUCT_DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr) { - DIR *result; + SMB_STRUCT_DIR *result; result = SMB_VFS_NEXT_OPENDIR(handle, conn, fname, mask, attr); @@ -858,7 +858,7 @@ static DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct } static SMB_STRUCT_DIRENT *smb_full_audit_readdir(vfs_handle_struct *handle, - connection_struct *conn, DIR *dirp) + connection_struct *conn, SMB_STRUCT_DIR *dirp) { SMB_STRUCT_DIRENT *result; @@ -873,7 +873,7 @@ static SMB_STRUCT_DIRENT *smb_full_audit_readdir(vfs_handle_struct *handle, } static void smb_full_audit_seekdir(vfs_handle_struct *handle, connection_struct *conn, - DIR *dirp, long offset) + SMB_STRUCT_DIR *dirp, long offset) { SMB_VFS_NEXT_SEEKDIR(handle, conn, dirp, offset); @@ -882,7 +882,7 @@ static void smb_full_audit_seekdir(vfs_handle_struct *handle, connection_struct } static long smb_full_audit_telldir(vfs_handle_struct *handle, connection_struct *conn, - DIR *dirp) + SMB_STRUCT_DIR *dirp) { long result; @@ -894,7 +894,7 @@ static long smb_full_audit_telldir(vfs_handle_struct *handle, connection_struct } static void smb_full_audit_rewinddir(vfs_handle_struct *handle, connection_struct *conn, - DIR *dirp) + SMB_STRUCT_DIR *dirp) { SMB_VFS_NEXT_REWINDDIR(handle, conn, dirp); @@ -927,7 +927,7 @@ static int smb_full_audit_rmdir(vfs_handle_struct *handle, connection_struct *co } static int smb_full_audit_closedir(vfs_handle_struct *handle, connection_struct *conn, - DIR *dirp) + SMB_STRUCT_DIR *dirp) { int result; -- cgit From 0c0bea0b5865918bfa3abb45ef6b16e30e163559 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 15 Sep 2005 11:02:03 +0000 Subject: r10239: Fix cut&paste error (This used to be commit e076453cf38b17cae07a1292713cd93d35890fbd) --- source3/modules/vfs_full_audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 d79e2e8f1c..175dda7a69 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -888,7 +888,7 @@ static long smb_full_audit_telldir(vfs_handle_struct *handle, connection_struct result = SMB_VFS_NEXT_TELLDIR(handle, conn, dirp); - do_log(SMB_VFS_OP_OPENDIR, True, handle, ""); + do_log(SMB_VFS_OP_TELLDIR, True, handle, ""); return result; } -- cgit From 435295f1840aa8bd4c04f20a2348c6d701c6b7dc Mon Sep 17 00:00:00 2001 From: Deryck Hodge Date: Thu, 29 Sep 2005 15:57:21 +0000 Subject: r10619: Allow syslog facility and priority to be set via smb.conf for audit modules. Facility may be set to USER or LOCAL0-LOCAL7. Any of the syslog priority settings may be used. smb.conf will look like: audit:facility = LOCAL5 audit:priority = INFO (Or full_audit:facility, or whatever audit module is used.) deryck (This used to be commit c619ee38f0aee43de571524c8ef3bf6b27b30e74) --- source3/modules/vfs_full_audit.c | 47 ++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 14 deletions(-) (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 175dda7a69..99d5244482 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -606,24 +606,43 @@ static struct { static int audit_syslog_facility(vfs_handle_struct *handle) { - /* fix me: let this be configurable by: - * lp_param_enum(SNUM(handle->conn), - * (handle->param?handle->param:"full_audit"), - * "syslog facility", - * audit_enum_facility,LOG_USER); - */ - return LOG_USER; + static const struct enum_list enum_log_facilities[] = { + { LOG_USER, "USER" }, + { LOG_LOCAL0, "LOCAL0" }, + { LOG_LOCAL1, "LOCAL1" }, + { LOG_LOCAL2, "LOCAL2" }, + { LOG_LOCAL3, "LOCAL3" }, + { LOG_LOCAL4, "LOCAL4" }, + { LOG_LOCAL5, "LOCAL5" }, + { LOG_LOCAL6, "LOCAL6" }, + { LOG_LOCAL7, "LOCAL7" } + }; + + int facility; + + facility = lp_parm_enum(SNUM(handle->conn), "full_audit", "facility", enum_log_facilities, LOG_USER); + + return facility; } static int audit_syslog_priority(vfs_handle_struct *handle) { - /* fix me: let this be configurable by: - * lp_param_enum(SNUM(handle->conn), - * (handle->param?handle->param:"full_audit"), - * "syslog priority", - * audit_enum_priority,LOG_NOTICE); - */ - return LOG_NOTICE; + static const struct enum_list enum_log_priorities[] = { + { LOG_EMERG, "EMERG" }, + { LOG_ALERT, "ALERT" }, + { LOG_CRIT, "CRIT" }, + { LOG_ERR, "ERR" }, + { LOG_WARNING, "WARNING" }, + { LOG_NOTICE, "NOTICE" }, + { LOG_INFO, "INFO" }, + { LOG_DEBUG, "DEBUG" } + }; + + int priority; + + priority = lp_parm_enum(SNUM(handle->conn), "full_audit", "priority", enum_log_priorities, LOG_NOTICE); + + return priority; } static char *audit_prefix(connection_struct *conn) -- cgit From a5b339c799b39d5147c6d31f94cc0b2ea9c865db Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 20 Oct 2005 17:33:17 +0000 Subject: r11232: Added ab's POSIX statvfs vfs call. Sorry for the delay ab. Jeremy. (This used to be commit af8545806770a7530eecc184bdd230ca14999884) --- source3/modules/vfs_full_audit.c | 21 +++++++++++++++++++++ 1 file changed, 21 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 99d5244482..d9d898dc0e 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -85,6 +85,10 @@ static int smb_full_audit_set_quota(struct vfs_handle_struct *handle, static int smb_full_audit_get_shadow_copy_data(struct vfs_handle_struct *handle, struct files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, BOOL labels); +static int smb_full_audit_statvfs(struct vfs_handle_struct *handle, + struct connection_struct *conn, + const char *path, + struct vfs_statvfs_struct *statbuf); static SMB_STRUCT_DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr); @@ -317,6 +321,8 @@ static vfs_op_tuple audit_op_tuples[] = { SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_get_shadow_copy_data), SMB_VFS_OP_GET_SHADOW_COPY_DATA, SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(smb_full_audit_statvfs), SMB_VFS_OP_STATVFS, + SMB_VFS_LAYER_LOGGER}, /* Directory operations */ @@ -518,6 +524,7 @@ static struct { { SMB_VFS_OP_GET_QUOTA, "get_quota" }, { SMB_VFS_OP_SET_QUOTA, "set_quota" }, { SMB_VFS_OP_GET_SHADOW_COPY_DATA, "get_shadow_copy_data" }, + { SMB_VFS_OP_STATVFS, "statvfs" }, { SMB_VFS_OP_OPENDIR, "opendir" }, { SMB_VFS_OP_READDIR, "readdir" }, { SMB_VFS_OP_SEEKDIR, "seekdir" }, @@ -864,6 +871,20 @@ static int smb_full_audit_get_shadow_copy_data(struct vfs_handle_struct *handle, return result; } +static int smb_full_audit_statvfs(struct vfs_handle_struct *handle, + struct connection_struct *conn, + const char *path, + struct vfs_statvfs_struct *statbuf) +{ + int result; + + result = SMB_VFS_NEXT_STATVFS(handle, conn, path, statbuf); + + do_log(SMB_VFS_OP_STATVFS, (result >= 0), handle, ""); + + return result; +} + static SMB_STRUCT_DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr) { -- cgit From cd8f41c327be4913facb1d451d2b820bf18c4685 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 19 Jan 2006 00:34:48 +0000 Subject: r13028: Fix for #3419 - vfs_full_audit *never* worked correctly. Static variables were used ! Jeremy. (This used to be commit 2ab5aeca895476869f0b50e513a77c9f2558fc56) --- source3/modules/vfs_full_audit.c | 84 ++++++++++++++++++++++++++++++---------- 1 file changed, 64 insertions(+), 20 deletions(-) (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 d9d898dc0e..52e245a176 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -35,6 +35,9 @@ * full_audit:success = open opendir * full_audit:failure = all * + * vfs op can be "all" which means log all operations. + * vfs op can be "none" which means no logging. + * * This leads to syslog entries of the form: * smbd_audit: nobody|192.168.234.1|opendir|ok|. * smbd_audit: nobody|192.168.234.1|open|fail (File not found)|r|x.txt @@ -61,6 +64,11 @@ extern struct current_user current_user; static int vfs_full_audit_debug_level = DBGC_VFS; +struct vfs_full_audit_private_data { + struct bitmap *success_ops; + struct bitmap *failure_ops; +}; + #undef DBGC_CLASS #define DBGC_CLASS vfs_full_audit_debug_level @@ -662,24 +670,33 @@ static char *audit_prefix(connection_struct *conn) return prefix; } -static struct bitmap *success_ops = NULL; - -static BOOL log_success(vfs_op_type op) +static BOOL log_success(vfs_handle_struct *handle, vfs_op_type op) { - if (success_ops == NULL) + struct vfs_full_audit_private_data *pd = NULL; + + SMB_VFS_HANDLE_GET_DATA(handle, pd, + struct vfs_full_audit_private_data, + return True); + + if (pd->success_ops == NULL) { return True; + } - return bitmap_query(success_ops, op); + return bitmap_query(pd->success_ops, op); } -static struct bitmap *failure_ops = NULL; - -static BOOL log_failure(vfs_op_type op) +static BOOL log_failure(vfs_handle_struct *handle, vfs_op_type op) { - if (failure_ops == NULL) + struct vfs_full_audit_private_data *pd = NULL; + + SMB_VFS_HANDLE_GET_DATA(handle, pd, + struct vfs_full_audit_private_data, + return True); + + if (pd->failure_ops == NULL) return True; - return bitmap_query(failure_ops, op); + return bitmap_query(pd->failure_ops, op); } static void init_bitmap(struct bitmap **bm, const char **ops) @@ -706,6 +723,10 @@ static void init_bitmap(struct bitmap **bm, const char **ops) break; } + if (strequal(*ops, "none")) { + break; + } + for (i=0; isuccess_ops) { + bitmap_free(pd->success_ops); + } + if (pd->failure_ops) { + bitmap_free(pd->failure_ops); + } + SAFE_FREE(pd); + *p_data = NULL; +} + /* Implementation of vfs_ops. Pass everything on to the default operation but log event first. */ @@ -775,18 +812,29 @@ static int smb_full_audit_connect(vfs_handle_struct *handle, connection_struct * const char *svc, const char *user) { int result; + struct vfs_full_audit_private_data *pd = NULL; const char *none[] = { NULL }; const char *all [] = { "all" }; + pd = SMB_MALLOC_P(struct vfs_full_audit_private_data); + if (!pd) { + return -1; + } + ZERO_STRUCTP(pd); + openlog("smbd_audit", 0, audit_syslog_facility(handle)); - init_bitmap(&success_ops, + init_bitmap(&pd->success_ops, lp_parm_string_list(SNUM(conn), "full_audit", "success", none)); - init_bitmap(&failure_ops, + init_bitmap(&pd->failure_ops, lp_parm_string_list(SNUM(conn), "full_audit", "failure", all)); + /* Store the private data. */ + SMB_VFS_HANDLE_SET_DATA(handle, pd, free_private_data, + struct vfs_full_audit_private_data, return -1); + result = SMB_VFS_NEXT_CONNECT(handle, conn, svc, user); do_log(SMB_VFS_OP_CONNECT, True, handle, @@ -803,11 +851,8 @@ static void smb_full_audit_disconnect(vfs_handle_struct *handle, do_log(SMB_VFS_OP_DISCONNECT, True, handle, "%s", lp_servicename(SNUM(conn))); - bitmap_free(success_ops); - success_ops = NULL; - - bitmap_free(failure_ops); - failure_ops = NULL; + /* The bitmaps will be disconnected when the private + data is deleted. */ return; } @@ -2003,4 +2048,3 @@ NTSTATUS vfs_full_audit_init(void) return ret; } - -- cgit From 53019f5a166e524157876ee1a19b88dfab807def Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 13 Mar 2006 18:42:57 +0000 Subject: r14333: Fix coverity #77, ensure we can't exit after allocation. Jeremy. (This used to be commit 15d78ab1fc83249552476d99144389cfe42a786f) --- source3/modules/vfs_full_audit.c | 4 ++++ 1 file changed, 4 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 52e245a176..0ae48f4818 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -816,6 +816,10 @@ static int smb_full_audit_connect(vfs_handle_struct *handle, connection_struct * const char *none[] = { NULL }; const char *all [] = { "all" }; + if (!handle) { + return -1; + } + pd = SMB_MALLOC_P(struct vfs_full_audit_private_data); if (!pd) { return -1; -- cgit From 22dbd67708f1651a2341d70ce576fac360affccf Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 10 Apr 2006 15:33:04 +0000 Subject: r15018: Merge Volker's ipc/trans2/nttrans changes over into 3.0. Also merge the new POSIX lock code - this is not enabled unless -DDEVELOPER is defined. This doesn't yet map onto underlying system POSIX locks. Updates vfs to allow lock queries. Jeremy. (This used to be commit 08e52ead03304ff04229e1bfe544ff40e2564fc7) --- source3/modules/vfs_full_audit.c | 17 +++++++++++++++++ 1 file changed, 17 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 0ae48f4818..309f6d15ae 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -161,6 +161,8 @@ static int smb_full_audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp int fd, SMB_OFF_T len); static BOOL smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type); +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, connection_struct *conn, const char *oldpath, const char *newpath); static int smb_full_audit_readlink(vfs_handle_struct *handle, connection_struct *conn, @@ -399,6 +401,8 @@ static vfs_op_tuple audit_op_tuples[] = { SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_lock), SMB_VFS_OP_LOCK, 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, SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_readlink), SMB_VFS_OP_READLINK, @@ -564,6 +568,7 @@ static struct { { SMB_VFS_OP_UTIME, "utime" }, { SMB_VFS_OP_FTRUNCATE, "ftruncate" }, { SMB_VFS_OP_LOCK, "lock" }, + { SMB_VFS_OP_GETLOCK, "getlock" }, { SMB_VFS_OP_SYMLINK, "symlink" }, { SMB_VFS_OP_READLINK, "readlink" }, { SMB_VFS_OP_LINK, "link" }, @@ -1313,6 +1318,18 @@ static BOOL smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, in 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) +{ + BOOL result; + + result = SMB_VFS_NEXT_GETLOCK(handle, fsp, fd, poffset, pcount, ptype, ppid); + + do_log(SMB_VFS_OP_GETLOCK, (result >= 0), handle, "%s", fsp->fsp_name); + + return result; +} + static int smb_full_audit_symlink(vfs_handle_struct *handle, connection_struct *conn, const char *oldpath, const char *newpath) { -- cgit From c334de0435419e5105c2aba269d169f9ebf12498 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 27 May 2006 16:58:36 +0000 Subject: r15910: vfs_full_audit does not need current_user (This used to be commit 09f3c7a86f931371dc6f886edccc15d3f5437d34) --- source3/modules/vfs_full_audit.c | 2 -- 1 file changed, 2 deletions(-) (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 309f6d15ae..b9ffd6fc05 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -60,8 +60,6 @@ #include "includes.h" -extern struct current_user current_user; - static int vfs_full_audit_debug_level = DBGC_VFS; struct vfs_full_audit_private_data { -- cgit From fbdcf2663b56007a438ac4f0d8d82436b1bfe688 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 11 Jul 2006 18:01:26 +0000 Subject: r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8) --- source3/modules/vfs_full_audit.c | 335 ++++++++++++++++++--------------------- 1 file changed, 153 insertions(+), 182 deletions(-) (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 b9ffd6fc05..fd15c5c358 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -72,48 +72,44 @@ struct vfs_full_audit_private_data { /* Function prototypes */ -static int smb_full_audit_connect(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_connect(vfs_handle_struct *handle, const char *svc, const char *user); -static void smb_full_audit_disconnect(vfs_handle_struct *handle, - connection_struct *conn); +static void smb_full_audit_disconnect(vfs_handle_struct *handle); static SMB_BIG_UINT smb_full_audit_disk_free(vfs_handle_struct *handle, - connection_struct *conn, const char *path, + const char *path, BOOL small_query, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize); static int smb_full_audit_get_quota(struct vfs_handle_struct *handle, - struct connection_struct *conn, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt); static int smb_full_audit_set_quota(struct vfs_handle_struct *handle, - struct connection_struct *conn, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt); static int smb_full_audit_get_shadow_copy_data(struct vfs_handle_struct *handle, struct files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, BOOL labels); static int smb_full_audit_statvfs(struct vfs_handle_struct *handle, - struct connection_struct *conn, const char *path, struct vfs_statvfs_struct *statbuf); -static SMB_STRUCT_DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct *conn, +static SMB_STRUCT_DIR *smb_full_audit_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr); static SMB_STRUCT_DIRENT *smb_full_audit_readdir(vfs_handle_struct *handle, - connection_struct *conn, SMB_STRUCT_DIR *dirp); -static void smb_full_audit_seekdir(vfs_handle_struct *handle, connection_struct *conn, + SMB_STRUCT_DIR *dirp); +static void smb_full_audit_seekdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp, long offset); -static long smb_full_audit_telldir(vfs_handle_struct *handle, connection_struct *conn, +static long smb_full_audit_telldir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp); -static void smb_full_audit_rewinddir(vfs_handle_struct *handle, connection_struct *conn, +static void smb_full_audit_rewinddir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp); -static int smb_full_audit_mkdir(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_mkdir(vfs_handle_struct *handle, const char *path, mode_t mode); -static int smb_full_audit_rmdir(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_rmdir(vfs_handle_struct *handle, const char *path); -static int smb_full_audit_closedir(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_closedir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp); -static int smb_full_audit_open(vfs_handle_struct *handle, connection_struct *conn, - const char *fname, int flags, mode_t mode); +static int smb_full_audit_open(vfs_handle_struct *handle, + const char *fname, files_struct *fsp, int flags, mode_t mode); static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp, int fd); static ssize_t smb_full_audit_read(vfs_handle_struct *handle, files_struct *fsp, int fd, void *data, size_t n); @@ -130,30 +126,30 @@ static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fsp, int fromfd, const DATA_BLOB *hdr, SMB_OFF_T offset, size_t n); -static int smb_full_audit_rename(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_rename(vfs_handle_struct *handle, const char *oldname, const char *newname); static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd); -static int smb_full_audit_stat(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_stat(vfs_handle_struct *handle, const char *fname, SMB_STRUCT_STAT *sbuf); static int smb_full_audit_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_STRUCT_STAT *sbuf); -static int smb_full_audit_lstat(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_lstat(vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf); -static int smb_full_audit_unlink(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_unlink(vfs_handle_struct *handle, const char *path); -static int smb_full_audit_chmod(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_chmod(vfs_handle_struct *handle, const char *path, mode_t mode); static int smb_full_audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode); -static int smb_full_audit_chown(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_chown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid); static int smb_full_audit_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd, uid_t uid, gid_t gid); -static int smb_full_audit_chdir(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_chdir(vfs_handle_struct *handle, const char *path); -static char *smb_full_audit_getwd(vfs_handle_struct *handle, connection_struct *conn, +static char *smb_full_audit_getwd(vfs_handle_struct *handle, char *path); -static int smb_full_audit_utime(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_utime(vfs_handle_struct *handle, const char *path, struct utimbuf *times); static int smb_full_audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T len); @@ -161,15 +157,15 @@ static BOOL smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, in int op, SMB_OFF_T offset, SMB_OFF_T count, int type); 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, connection_struct *conn, +static int smb_full_audit_symlink(vfs_handle_struct *handle, const char *oldpath, const char *newpath); -static int smb_full_audit_readlink(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_readlink(vfs_handle_struct *handle, const char *path, char *buf, size_t bufsiz); -static int smb_full_audit_link(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_link(vfs_handle_struct *handle, const char *oldpath, const char *newpath); -static int smb_full_audit_mknod(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_mknod(vfs_handle_struct *handle, const char *pathname, mode_t mode, SMB_DEV_T dev); -static char *smb_full_audit_realpath(vfs_handle_struct *handle, connection_struct *conn, +static char *smb_full_audit_realpath(vfs_handle_struct *handle, const char *path, char *resolved_path); static size_t smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info, @@ -183,120 +179,99 @@ static BOOL smb_full_audit_fset_nt_acl(vfs_handle_struct *handle, files_struct * static BOOL smb_full_audit_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info_sent, SEC_DESC *psd); -static int smb_full_audit_chmod_acl(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_chmod_acl(vfs_handle_struct *handle, const char *path, mode_t mode); static int smb_full_audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode); static int smb_full_audit_sys_acl_get_entry(vfs_handle_struct *handle, - connection_struct *conn, SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p); static int smb_full_audit_sys_acl_get_tag_type(vfs_handle_struct *handle, - connection_struct *conn, SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p); static int smb_full_audit_sys_acl_get_permset(vfs_handle_struct *handle, - connection_struct *conn, SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p); static void * smb_full_audit_sys_acl_get_qualifier(vfs_handle_struct *handle, - connection_struct *conn, SMB_ACL_ENTRY_T entry_d); static SMB_ACL_T smb_full_audit_sys_acl_get_file(vfs_handle_struct *handle, - connection_struct *conn, const char *path_p, SMB_ACL_TYPE_T type); static SMB_ACL_T smb_full_audit_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp, int fd); static int smb_full_audit_sys_acl_clear_perms(vfs_handle_struct *handle, - connection_struct *conn, SMB_ACL_PERMSET_T permset); static int smb_full_audit_sys_acl_add_perm(vfs_handle_struct *handle, - connection_struct *conn, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm); static char * smb_full_audit_sys_acl_to_text(vfs_handle_struct *handle, - connection_struct *conn, SMB_ACL_T theacl, + SMB_ACL_T theacl, ssize_t *plen); static SMB_ACL_T smb_full_audit_sys_acl_init(vfs_handle_struct *handle, - connection_struct *conn, int count); static int smb_full_audit_sys_acl_create_entry(vfs_handle_struct *handle, - connection_struct *conn, SMB_ACL_T *pacl, + SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry); static int smb_full_audit_sys_acl_set_tag_type(vfs_handle_struct *handle, - connection_struct *conn, SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype); static int smb_full_audit_sys_acl_set_qualifier(vfs_handle_struct *handle, - connection_struct *conn, SMB_ACL_ENTRY_T entry, void *qual); static int smb_full_audit_sys_acl_set_permset(vfs_handle_struct *handle, - connection_struct *conn, SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset); static int smb_full_audit_sys_acl_valid(vfs_handle_struct *handle, - connection_struct *conn, SMB_ACL_T theacl ); static int smb_full_audit_sys_acl_set_file(vfs_handle_struct *handle, - connection_struct *conn, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl); static int smb_full_audit_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_ACL_T theacl); static int smb_full_audit_sys_acl_delete_def_file(vfs_handle_struct *handle, - connection_struct *conn, const char *path); static int smb_full_audit_sys_acl_get_perm(vfs_handle_struct *handle, - connection_struct *conn, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm); static int smb_full_audit_sys_acl_free_text(vfs_handle_struct *handle, - connection_struct *conn, char *text); static int smb_full_audit_sys_acl_free_acl(vfs_handle_struct *handle, - connection_struct *conn, SMB_ACL_T posix_acl); static int smb_full_audit_sys_acl_free_qualifier(vfs_handle_struct *handle, - connection_struct *conn, void *qualifier, SMB_ACL_TAG_T tagtype); static ssize_t smb_full_audit_getxattr(struct vfs_handle_struct *handle, - struct connection_struct *conn, const char *path, + const char *path, const char *name, void *value, size_t size); static ssize_t smb_full_audit_lgetxattr(struct vfs_handle_struct *handle, - struct connection_struct *conn, const char *path, const char *name, void *value, size_t size); static ssize_t smb_full_audit_fgetxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, const char *name, void *value, size_t size); static ssize_t smb_full_audit_listxattr(struct vfs_handle_struct *handle, - struct connection_struct *conn, const char *path, char *list, size_t size); static ssize_t smb_full_audit_llistxattr(struct vfs_handle_struct *handle, - struct connection_struct *conn, const char *path, char *list, size_t size); static ssize_t smb_full_audit_flistxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, char *list, size_t size); static int smb_full_audit_removexattr(struct vfs_handle_struct *handle, - struct connection_struct *conn, const char *path, + const char *path, const char *name); static int smb_full_audit_lremovexattr(struct vfs_handle_struct *handle, - struct connection_struct *conn, const char *path, + const char *path, const char *name); static int smb_full_audit_fremovexattr(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, const char *name); static int smb_full_audit_setxattr(struct vfs_handle_struct *handle, - struct connection_struct *conn, const char *path, + const char *path, const char *name, const void *value, size_t size, int flags); static int smb_full_audit_lsetxattr(struct vfs_handle_struct *handle, - struct connection_struct *conn, const char *path, + const char *path, const char *name, const void *value, size_t size, int flags); static int smb_full_audit_fsetxattr(struct vfs_handle_struct *handle, @@ -666,10 +641,15 @@ static int audit_syslog_priority(vfs_handle_struct *handle) static char *audit_prefix(connection_struct *conn) { static pstring prefix; + extern userdom_struct current_user_info; pstrcpy(prefix, lp_parm_const_string(SNUM(conn), "full_audit", "prefix", "%u|%I")); - standard_sub_snum(SNUM(conn), prefix, sizeof(prefix)-1); + standard_sub_advanced(lp_servicename(SNUM(conn)), conn->user, + conn->connectpath, conn->gid, + get_current_username(), + current_user_info.domain, + prefix, sizeof(prefix)); return prefix; } @@ -811,7 +791,7 @@ static void free_private_data(void **p_data) /* Implementation of vfs_ops. Pass everything on to the default operation but log event first. */ -static int smb_full_audit_connect(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_connect(vfs_handle_struct *handle, const char *svc, const char *user) { int result; @@ -832,17 +812,17 @@ static int smb_full_audit_connect(vfs_handle_struct *handle, connection_struct * openlog("smbd_audit", 0, audit_syslog_facility(handle)); init_bitmap(&pd->success_ops, - lp_parm_string_list(SNUM(conn), "full_audit", "success", + lp_parm_string_list(SNUM(handle->conn), "full_audit", "success", none)); init_bitmap(&pd->failure_ops, - lp_parm_string_list(SNUM(conn), "full_audit", "failure", + lp_parm_string_list(SNUM(handle->conn), "full_audit", "failure", all)); /* Store the private data. */ SMB_VFS_HANDLE_SET_DATA(handle, pd, free_private_data, struct vfs_full_audit_private_data, return -1); - result = SMB_VFS_NEXT_CONNECT(handle, conn, svc, user); + result = SMB_VFS_NEXT_CONNECT(handle, svc, user); do_log(SMB_VFS_OP_CONNECT, True, handle, "%s", svc); @@ -850,13 +830,12 @@ static int smb_full_audit_connect(vfs_handle_struct *handle, connection_struct * return result; } -static void smb_full_audit_disconnect(vfs_handle_struct *handle, - connection_struct *conn) +static void smb_full_audit_disconnect(vfs_handle_struct *handle) { - SMB_VFS_NEXT_DISCONNECT(handle, conn); + SMB_VFS_NEXT_DISCONNECT(handle); do_log(SMB_VFS_OP_DISCONNECT, True, handle, - "%s", lp_servicename(SNUM(conn))); + "%s", lp_servicename(SNUM(handle->conn))); /* The bitmaps will be disconnected when the private data is deleted. */ @@ -865,13 +844,13 @@ static void smb_full_audit_disconnect(vfs_handle_struct *handle, } static SMB_BIG_UINT smb_full_audit_disk_free(vfs_handle_struct *handle, - connection_struct *conn, const char *path, + const char *path, BOOL small_query, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize) { SMB_BIG_UINT result; - result = SMB_VFS_NEXT_DISK_FREE(handle, conn, path, small_query, bsize, + result = SMB_VFS_NEXT_DISK_FREE(handle, path, small_query, bsize, dfree, dsize); /* Don't have a reasonable notion of failure here */ @@ -882,13 +861,12 @@ static SMB_BIG_UINT smb_full_audit_disk_free(vfs_handle_struct *handle, } static int smb_full_audit_get_quota(struct vfs_handle_struct *handle, - struct connection_struct *conn, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt) { int result; - result = SMB_VFS_NEXT_GET_QUOTA(handle, conn, qtype, id, qt); + result = SMB_VFS_NEXT_GET_QUOTA(handle, qtype, id, qt); do_log(SMB_VFS_OP_GET_QUOTA, (result >= 0), handle, ""); @@ -897,13 +875,12 @@ static int smb_full_audit_get_quota(struct vfs_handle_struct *handle, static int smb_full_audit_set_quota(struct vfs_handle_struct *handle, - struct connection_struct *conn, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt) { int result; - result = SMB_VFS_NEXT_SET_QUOTA(handle, conn, qtype, id, qt); + result = SMB_VFS_NEXT_SET_QUOTA(handle, qtype, id, qt); do_log(SMB_VFS_OP_SET_QUOTA, (result >= 0), handle, ""); @@ -924,25 +901,24 @@ static int smb_full_audit_get_shadow_copy_data(struct vfs_handle_struct *handle, } static int smb_full_audit_statvfs(struct vfs_handle_struct *handle, - struct connection_struct *conn, const char *path, struct vfs_statvfs_struct *statbuf) { int result; - result = SMB_VFS_NEXT_STATVFS(handle, conn, path, statbuf); + result = SMB_VFS_NEXT_STATVFS(handle, path, statbuf); do_log(SMB_VFS_OP_STATVFS, (result >= 0), handle, ""); return result; } -static SMB_STRUCT_DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct *conn, +static SMB_STRUCT_DIR *smb_full_audit_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr) { SMB_STRUCT_DIR *result; - result = SMB_VFS_NEXT_OPENDIR(handle, conn, fname, mask, attr); + result = SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr); do_log(SMB_VFS_OP_OPENDIR, (result != NULL), handle, "%s", fname); @@ -950,11 +926,11 @@ static SMB_STRUCT_DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connect } static SMB_STRUCT_DIRENT *smb_full_audit_readdir(vfs_handle_struct *handle, - connection_struct *conn, SMB_STRUCT_DIR *dirp) + SMB_STRUCT_DIR *dirp) { SMB_STRUCT_DIRENT *result; - result = SMB_VFS_NEXT_READDIR(handle, conn, dirp); + result = SMB_VFS_NEXT_READDIR(handle, dirp); /* This operation has no reasonable error condition * (End of dir is also failure), so always succeed. @@ -964,78 +940,78 @@ static SMB_STRUCT_DIRENT *smb_full_audit_readdir(vfs_handle_struct *handle, return result; } -static void smb_full_audit_seekdir(vfs_handle_struct *handle, connection_struct *conn, +static void smb_full_audit_seekdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp, long offset) { - SMB_VFS_NEXT_SEEKDIR(handle, conn, dirp, offset); + SMB_VFS_NEXT_SEEKDIR(handle, dirp, offset); do_log(SMB_VFS_OP_SEEKDIR, True, handle, ""); return; } -static long smb_full_audit_telldir(vfs_handle_struct *handle, connection_struct *conn, +static long smb_full_audit_telldir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp) { long result; - result = SMB_VFS_NEXT_TELLDIR(handle, conn, dirp); + result = SMB_VFS_NEXT_TELLDIR(handle, dirp); do_log(SMB_VFS_OP_TELLDIR, True, handle, ""); return result; } -static void smb_full_audit_rewinddir(vfs_handle_struct *handle, connection_struct *conn, +static void smb_full_audit_rewinddir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp) { - SMB_VFS_NEXT_REWINDDIR(handle, conn, dirp); + SMB_VFS_NEXT_REWINDDIR(handle, dirp); do_log(SMB_VFS_OP_REWINDDIR, True, handle, ""); return; } -static int smb_full_audit_mkdir(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_mkdir(vfs_handle_struct *handle, const char *path, mode_t mode) { int result; - result = SMB_VFS_NEXT_MKDIR(handle, conn, path, mode); + result = SMB_VFS_NEXT_MKDIR(handle, path, mode); do_log(SMB_VFS_OP_MKDIR, (result >= 0), handle, "%s", path); return result; } -static int smb_full_audit_rmdir(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_rmdir(vfs_handle_struct *handle, const char *path) { int result; - result = SMB_VFS_NEXT_RMDIR(handle, conn, path); + result = SMB_VFS_NEXT_RMDIR(handle, path); do_log(SMB_VFS_OP_RMDIR, (result >= 0), handle, "%s", path); return result; } -static int smb_full_audit_closedir(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_closedir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp) { int result; - result = SMB_VFS_NEXT_CLOSEDIR(handle, conn, dirp); + result = SMB_VFS_NEXT_CLOSEDIR(handle, dirp); do_log(SMB_VFS_OP_CLOSEDIR, (result >= 0), handle, ""); return result; } -static int smb_full_audit_open(vfs_handle_struct *handle, connection_struct *conn, - const char *fname, int flags, mode_t mode) +static int smb_full_audit_open(vfs_handle_struct *handle, + const char *fname, files_struct *fsp, int flags, mode_t mode) { int result; - result = SMB_VFS_NEXT_OPEN(handle, conn, fname, flags, mode); + result = SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode); do_log(SMB_VFS_OP_OPEN, (result >= 0), handle, "%s|%s", ((flags & O_WRONLY) || (flags & O_RDWR))?"w":"r", @@ -1133,12 +1109,12 @@ static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd, return result; } -static int smb_full_audit_rename(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_rename(vfs_handle_struct *handle, const char *oldname, const char *newname) { int result; - result = SMB_VFS_NEXT_RENAME(handle, conn, oldname, newname); + result = SMB_VFS_NEXT_RENAME(handle, oldname, newname); do_log(SMB_VFS_OP_RENAME, (result >= 0), handle, "%s|%s", oldname, newname); @@ -1156,12 +1132,12 @@ static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp, in return result; } -static int smb_full_audit_stat(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_stat(vfs_handle_struct *handle, const char *fname, SMB_STRUCT_STAT *sbuf) { int result; - result = SMB_VFS_NEXT_STAT(handle, conn, fname, sbuf); + result = SMB_VFS_NEXT_STAT(handle, fname, sbuf); do_log(SMB_VFS_OP_STAT, (result >= 0), handle, "%s", fname); @@ -1180,36 +1156,36 @@ static int smb_full_audit_fstat(vfs_handle_struct *handle, files_struct *fsp, in return result; } -static int smb_full_audit_lstat(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_lstat(vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf) { int result; - result = SMB_VFS_NEXT_LSTAT(handle, conn, path, sbuf); + result = SMB_VFS_NEXT_LSTAT(handle, path, sbuf); do_log(SMB_VFS_OP_LSTAT, (result >= 0), handle, "%s", path); return result; } -static int smb_full_audit_unlink(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_unlink(vfs_handle_struct *handle, const char *path) { int result; - result = SMB_VFS_NEXT_UNLINK(handle, conn, path); + result = SMB_VFS_NEXT_UNLINK(handle, path); do_log(SMB_VFS_OP_UNLINK, (result >= 0), handle, "%s", path); return result; } -static int smb_full_audit_chmod(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_chmod(vfs_handle_struct *handle, const char *path, mode_t mode) { int result; - result = SMB_VFS_NEXT_CHMOD(handle, conn, path, mode); + result = SMB_VFS_NEXT_CHMOD(handle, path, mode); do_log(SMB_VFS_OP_CHMOD, (result >= 0), handle, "%s|%o", path, mode); @@ -1229,12 +1205,12 @@ static int smb_full_audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, i return result; } -static int smb_full_audit_chown(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_chown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid) { int result; - result = SMB_VFS_NEXT_CHOWN(handle, conn, path, uid, gid); + result = SMB_VFS_NEXT_CHOWN(handle, path, uid, gid); do_log(SMB_VFS_OP_CHOWN, (result >= 0), handle, "%s|%ld|%ld", path, (long int)uid, (long int)gid); @@ -1255,36 +1231,36 @@ static int smb_full_audit_fchown(vfs_handle_struct *handle, files_struct *fsp, i return result; } -static int smb_full_audit_chdir(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_chdir(vfs_handle_struct *handle, const char *path) { int result; - result = SMB_VFS_NEXT_CHDIR(handle, conn, path); + result = SMB_VFS_NEXT_CHDIR(handle, path); do_log(SMB_VFS_OP_CHDIR, (result >= 0), handle, "chdir|%s", path); return result; } -static char *smb_full_audit_getwd(vfs_handle_struct *handle, connection_struct *conn, +static char *smb_full_audit_getwd(vfs_handle_struct *handle, char *path) { char *result; - result = SMB_VFS_NEXT_GETWD(handle, conn, path); + result = SMB_VFS_NEXT_GETWD(handle, path); do_log(SMB_VFS_OP_GETWD, (result != NULL), handle, "%s", path); return result; } -static int smb_full_audit_utime(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_utime(vfs_handle_struct *handle, const char *path, struct utimbuf *times) { int result; - result = SMB_VFS_NEXT_UTIME(handle, conn, path, times); + result = SMB_VFS_NEXT_UTIME(handle, path, times); do_log(SMB_VFS_OP_UTIME, (result >= 0), handle, "%s", path); @@ -1328,12 +1304,12 @@ static BOOL smb_full_audit_getlock(vfs_handle_struct *handle, files_struct *fsp, return result; } -static int smb_full_audit_symlink(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_symlink(vfs_handle_struct *handle, const char *oldpath, const char *newpath) { int result; - result = SMB_VFS_NEXT_SYMLINK(handle, conn, oldpath, newpath); + result = SMB_VFS_NEXT_SYMLINK(handle, oldpath, newpath); do_log(SMB_VFS_OP_SYMLINK, (result >= 0), handle, "%s|%s", oldpath, newpath); @@ -1341,24 +1317,24 @@ static int smb_full_audit_symlink(vfs_handle_struct *handle, connection_struct * return result; } -static int smb_full_audit_readlink(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_readlink(vfs_handle_struct *handle, const char *path, char *buf, size_t bufsiz) { int result; - result = SMB_VFS_NEXT_READLINK(handle, conn, path, buf, bufsiz); + result = SMB_VFS_NEXT_READLINK(handle, path, buf, bufsiz); do_log(SMB_VFS_OP_READLINK, (result >= 0), handle, "%s", path); return result; } -static int smb_full_audit_link(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_link(vfs_handle_struct *handle, const char *oldpath, const char *newpath) { int result; - result = SMB_VFS_NEXT_LINK(handle, conn, oldpath, newpath); + result = SMB_VFS_NEXT_LINK(handle, oldpath, newpath); do_log(SMB_VFS_OP_LINK, (result >= 0), handle, "%s|%s", oldpath, newpath); @@ -1366,24 +1342,24 @@ static int smb_full_audit_link(vfs_handle_struct *handle, connection_struct *con return result; } -static int smb_full_audit_mknod(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_mknod(vfs_handle_struct *handle, const char *pathname, mode_t mode, SMB_DEV_T dev) { int result; - result = SMB_VFS_NEXT_MKNOD(handle, conn, pathname, mode, dev); + result = SMB_VFS_NEXT_MKNOD(handle, pathname, mode, dev); do_log(SMB_VFS_OP_MKNOD, (result >= 0), handle, "%s", pathname); return result; } -static char *smb_full_audit_realpath(vfs_handle_struct *handle, connection_struct *conn, +static char *smb_full_audit_realpath(vfs_handle_struct *handle, const char *path, char *resolved_path) { char *result; - result = SMB_VFS_NEXT_REALPATH(handle, conn, path, resolved_path); + result = SMB_VFS_NEXT_REALPATH(handle, path, resolved_path); do_log(SMB_VFS_OP_REALPATH, (result != NULL), handle, "%s", path); @@ -1448,12 +1424,12 @@ static BOOL smb_full_audit_set_nt_acl(vfs_handle_struct *handle, files_struct *f return result; } -static int smb_full_audit_chmod_acl(vfs_handle_struct *handle, connection_struct *conn, +static int smb_full_audit_chmod_acl(vfs_handle_struct *handle, const char *path, mode_t mode) { int result; - result = SMB_VFS_NEXT_CHMOD_ACL(handle, conn, path, mode); + result = SMB_VFS_NEXT_CHMOD_ACL(handle, path, mode); do_log(SMB_VFS_OP_CHMOD_ACL, (result >= 0), handle, "%s|%o", path, mode); @@ -1475,13 +1451,13 @@ static int smb_full_audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fs } static int smb_full_audit_sys_acl_get_entry(vfs_handle_struct *handle, - connection_struct *conn, + SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p) { int result; - result = SMB_VFS_NEXT_SYS_ACL_GET_ENTRY(handle, conn, theacl, entry_id, + result = SMB_VFS_NEXT_SYS_ACL_GET_ENTRY(handle, theacl, entry_id, entry_p); do_log(SMB_VFS_OP_SYS_ACL_GET_ENTRY, (result >= 0), handle, @@ -1491,13 +1467,13 @@ static int smb_full_audit_sys_acl_get_entry(vfs_handle_struct *handle, } static int smb_full_audit_sys_acl_get_tag_type(vfs_handle_struct *handle, - connection_struct *conn, + SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p) { int result; - result = SMB_VFS_NEXT_SYS_ACL_GET_TAG_TYPE(handle, conn, entry_d, + result = SMB_VFS_NEXT_SYS_ACL_GET_TAG_TYPE(handle, entry_d, tag_type_p); do_log(SMB_VFS_OP_SYS_ACL_GET_TAG_TYPE, (result >= 0), handle, @@ -1507,13 +1483,13 @@ static int smb_full_audit_sys_acl_get_tag_type(vfs_handle_struct *handle, } static int smb_full_audit_sys_acl_get_permset(vfs_handle_struct *handle, - connection_struct *conn, + SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p) { int result; - result = SMB_VFS_NEXT_SYS_ACL_GET_PERMSET(handle, conn, entry_d, + result = SMB_VFS_NEXT_SYS_ACL_GET_PERMSET(handle, entry_d, permset_p); do_log(SMB_VFS_OP_SYS_ACL_GET_PERMSET, (result >= 0), handle, @@ -1523,12 +1499,12 @@ static int smb_full_audit_sys_acl_get_permset(vfs_handle_struct *handle, } static void * smb_full_audit_sys_acl_get_qualifier(vfs_handle_struct *handle, - connection_struct *conn, + SMB_ACL_ENTRY_T entry_d) { void *result; - result = SMB_VFS_NEXT_SYS_ACL_GET_QUALIFIER(handle, conn, entry_d); + result = SMB_VFS_NEXT_SYS_ACL_GET_QUALIFIER(handle, entry_d); do_log(SMB_VFS_OP_SYS_ACL_GET_QUALIFIER, (result != NULL), handle, ""); @@ -1537,13 +1513,12 @@ static void * smb_full_audit_sys_acl_get_qualifier(vfs_handle_struct *handle, } static SMB_ACL_T smb_full_audit_sys_acl_get_file(vfs_handle_struct *handle, - connection_struct *conn, const char *path_p, SMB_ACL_TYPE_T type) { SMB_ACL_T result; - result = SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, conn, path_p, type); + result = SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, path_p, type); do_log(SMB_VFS_OP_SYS_ACL_GET_FILE, (result != NULL), handle, "%s", path_p); @@ -1565,12 +1540,12 @@ static SMB_ACL_T smb_full_audit_sys_acl_get_fd(vfs_handle_struct *handle, } static int smb_full_audit_sys_acl_clear_perms(vfs_handle_struct *handle, - connection_struct *conn, + SMB_ACL_PERMSET_T permset) { int result; - result = SMB_VFS_NEXT_SYS_ACL_CLEAR_PERMS(handle, conn, permset); + result = SMB_VFS_NEXT_SYS_ACL_CLEAR_PERMS(handle, permset); do_log(SMB_VFS_OP_SYS_ACL_CLEAR_PERMS, (result >= 0), handle, ""); @@ -1579,13 +1554,13 @@ static int smb_full_audit_sys_acl_clear_perms(vfs_handle_struct *handle, } static int smb_full_audit_sys_acl_add_perm(vfs_handle_struct *handle, - connection_struct *conn, + SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm) { int result; - result = SMB_VFS_NEXT_SYS_ACL_ADD_PERM(handle, conn, permset, perm); + result = SMB_VFS_NEXT_SYS_ACL_ADD_PERM(handle, permset, perm); do_log(SMB_VFS_OP_SYS_ACL_ADD_PERM, (result >= 0), handle, ""); @@ -1594,12 +1569,12 @@ static int smb_full_audit_sys_acl_add_perm(vfs_handle_struct *handle, } static char * smb_full_audit_sys_acl_to_text(vfs_handle_struct *handle, - connection_struct *conn, SMB_ACL_T theacl, + SMB_ACL_T theacl, ssize_t *plen) { char * result; - result = SMB_VFS_NEXT_SYS_ACL_TO_TEXT(handle, conn, theacl, plen); + result = SMB_VFS_NEXT_SYS_ACL_TO_TEXT(handle, theacl, plen); do_log(SMB_VFS_OP_SYS_ACL_TO_TEXT, (result != NULL), handle, ""); @@ -1608,12 +1583,12 @@ static char * smb_full_audit_sys_acl_to_text(vfs_handle_struct *handle, } static SMB_ACL_T smb_full_audit_sys_acl_init(vfs_handle_struct *handle, - connection_struct *conn, + int count) { SMB_ACL_T result; - result = SMB_VFS_NEXT_SYS_ACL_INIT(handle, conn, count); + result = SMB_VFS_NEXT_SYS_ACL_INIT(handle, count); do_log(SMB_VFS_OP_SYS_ACL_INIT, (result != NULL), handle, ""); @@ -1622,12 +1597,12 @@ static SMB_ACL_T smb_full_audit_sys_acl_init(vfs_handle_struct *handle, } static int smb_full_audit_sys_acl_create_entry(vfs_handle_struct *handle, - connection_struct *conn, SMB_ACL_T *pacl, + SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry) { int result; - result = SMB_VFS_NEXT_SYS_ACL_CREATE_ENTRY(handle, conn, pacl, pentry); + result = SMB_VFS_NEXT_SYS_ACL_CREATE_ENTRY(handle, pacl, pentry); do_log(SMB_VFS_OP_SYS_ACL_CREATE_ENTRY, (result >= 0), handle, ""); @@ -1636,13 +1611,13 @@ static int smb_full_audit_sys_acl_create_entry(vfs_handle_struct *handle, } static int smb_full_audit_sys_acl_set_tag_type(vfs_handle_struct *handle, - connection_struct *conn, + SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype) { int result; - result = SMB_VFS_NEXT_SYS_ACL_SET_TAG_TYPE(handle, conn, entry, + result = SMB_VFS_NEXT_SYS_ACL_SET_TAG_TYPE(handle, entry, tagtype); do_log(SMB_VFS_OP_SYS_ACL_SET_TAG_TYPE, (result >= 0), handle, @@ -1652,13 +1627,13 @@ static int smb_full_audit_sys_acl_set_tag_type(vfs_handle_struct *handle, } static int smb_full_audit_sys_acl_set_qualifier(vfs_handle_struct *handle, - connection_struct *conn, + SMB_ACL_ENTRY_T entry, void *qual) { int result; - result = SMB_VFS_NEXT_SYS_ACL_SET_QUALIFIER(handle, conn, entry, qual); + result = SMB_VFS_NEXT_SYS_ACL_SET_QUALIFIER(handle, entry, qual); do_log(SMB_VFS_OP_SYS_ACL_SET_QUALIFIER, (result >= 0), handle, ""); @@ -1667,13 +1642,13 @@ static int smb_full_audit_sys_acl_set_qualifier(vfs_handle_struct *handle, } static int smb_full_audit_sys_acl_set_permset(vfs_handle_struct *handle, - connection_struct *conn, + SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset) { int result; - result = SMB_VFS_NEXT_SYS_ACL_SET_PERMSET(handle, conn, entry, permset); + result = SMB_VFS_NEXT_SYS_ACL_SET_PERMSET(handle, entry, permset); do_log(SMB_VFS_OP_SYS_ACL_SET_PERMSET, (result >= 0), handle, ""); @@ -1682,12 +1657,12 @@ static int smb_full_audit_sys_acl_set_permset(vfs_handle_struct *handle, } static int smb_full_audit_sys_acl_valid(vfs_handle_struct *handle, - connection_struct *conn, + SMB_ACL_T theacl ) { int result; - result = SMB_VFS_NEXT_SYS_ACL_VALID(handle, conn, theacl); + result = SMB_VFS_NEXT_SYS_ACL_VALID(handle, theacl); do_log(SMB_VFS_OP_SYS_ACL_VALID, (result >= 0), handle, ""); @@ -1696,13 +1671,13 @@ static int smb_full_audit_sys_acl_valid(vfs_handle_struct *handle, } static int smb_full_audit_sys_acl_set_file(vfs_handle_struct *handle, - connection_struct *conn, + const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl) { int result; - result = SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, conn, name, acltype, + result = SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, acltype, theacl); do_log(SMB_VFS_OP_SYS_ACL_SET_FILE, (result >= 0), handle, @@ -1725,12 +1700,12 @@ static int smb_full_audit_sys_acl_set_fd(vfs_handle_struct *handle, files_struct } static int smb_full_audit_sys_acl_delete_def_file(vfs_handle_struct *handle, - connection_struct *conn, + const char *path) { int result; - result = SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, conn, path); + result = SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, path); do_log(SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE, (result >= 0), handle, "%s", path); @@ -1739,13 +1714,13 @@ static int smb_full_audit_sys_acl_delete_def_file(vfs_handle_struct *handle, } static int smb_full_audit_sys_acl_get_perm(vfs_handle_struct *handle, - connection_struct *conn, + SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm) { int result; - result = SMB_VFS_NEXT_SYS_ACL_GET_PERM(handle, conn, permset, perm); + result = SMB_VFS_NEXT_SYS_ACL_GET_PERM(handle, permset, perm); do_log(SMB_VFS_OP_SYS_ACL_GET_PERM, (result >= 0), handle, ""); @@ -1754,12 +1729,12 @@ static int smb_full_audit_sys_acl_get_perm(vfs_handle_struct *handle, } static int smb_full_audit_sys_acl_free_text(vfs_handle_struct *handle, - connection_struct *conn, + char *text) { int result; - result = SMB_VFS_NEXT_SYS_ACL_FREE_TEXT(handle, conn, text); + result = SMB_VFS_NEXT_SYS_ACL_FREE_TEXT(handle, text); do_log(SMB_VFS_OP_SYS_ACL_FREE_TEXT, (result >= 0), handle, ""); @@ -1768,12 +1743,12 @@ static int smb_full_audit_sys_acl_free_text(vfs_handle_struct *handle, } static int smb_full_audit_sys_acl_free_acl(vfs_handle_struct *handle, - connection_struct *conn, + SMB_ACL_T posix_acl) { int result; - result = SMB_VFS_NEXT_SYS_ACL_FREE_ACL(handle, conn, posix_acl); + result = SMB_VFS_NEXT_SYS_ACL_FREE_ACL(handle, posix_acl); do_log(SMB_VFS_OP_SYS_ACL_FREE_ACL, (result >= 0), handle, ""); @@ -1782,13 +1757,12 @@ static int smb_full_audit_sys_acl_free_acl(vfs_handle_struct *handle, } static int smb_full_audit_sys_acl_free_qualifier(vfs_handle_struct *handle, - connection_struct *conn, void *qualifier, SMB_ACL_TAG_T tagtype) { int result; - result = SMB_VFS_NEXT_SYS_ACL_FREE_QUALIFIER(handle, conn, qualifier, + result = SMB_VFS_NEXT_SYS_ACL_FREE_QUALIFIER(handle, qualifier, tagtype); do_log(SMB_VFS_OP_SYS_ACL_FREE_QUALIFIER, (result >= 0), handle, @@ -1798,12 +1772,12 @@ static int smb_full_audit_sys_acl_free_qualifier(vfs_handle_struct *handle, } static ssize_t smb_full_audit_getxattr(struct vfs_handle_struct *handle, - struct connection_struct *conn, const char *path, + const char *path, const char *name, void *value, size_t size) { ssize_t result; - result = SMB_VFS_NEXT_GETXATTR(handle, conn, path, name, value, size); + result = SMB_VFS_NEXT_GETXATTR(handle, path, name, value, size); do_log(SMB_VFS_OP_GETXATTR, (result >= 0), handle, "%s|%s", path, name); @@ -1812,13 +1786,12 @@ static ssize_t smb_full_audit_getxattr(struct vfs_handle_struct *handle, } static ssize_t smb_full_audit_lgetxattr(struct vfs_handle_struct *handle, - struct connection_struct *conn, const char *path, const char *name, void *value, size_t size) { ssize_t result; - result = SMB_VFS_NEXT_LGETXATTR(handle, conn, path, name, value, size); + result = SMB_VFS_NEXT_LGETXATTR(handle, path, name, value, size); do_log(SMB_VFS_OP_LGETXATTR, (result >= 0), handle, "%s|%s", path, name); @@ -1841,12 +1814,11 @@ static ssize_t smb_full_audit_fgetxattr(struct vfs_handle_struct *handle, } static ssize_t smb_full_audit_listxattr(struct vfs_handle_struct *handle, - struct connection_struct *conn, const char *path, char *list, size_t size) { ssize_t result; - result = SMB_VFS_NEXT_LISTXATTR(handle, conn, path, list, size); + result = SMB_VFS_NEXT_LISTXATTR(handle, path, list, size); do_log(SMB_VFS_OP_LISTXATTR, (result >= 0), handle, "%s", path); @@ -1854,12 +1826,11 @@ static ssize_t smb_full_audit_listxattr(struct vfs_handle_struct *handle, } static ssize_t smb_full_audit_llistxattr(struct vfs_handle_struct *handle, - struct connection_struct *conn, const char *path, char *list, size_t size) { ssize_t result; - result = SMB_VFS_NEXT_LLISTXATTR(handle, conn, path, list, size); + result = SMB_VFS_NEXT_LLISTXATTR(handle, path, list, size); do_log(SMB_VFS_OP_LLISTXATTR, (result >= 0), handle, "%s", path); @@ -1881,12 +1852,12 @@ static ssize_t smb_full_audit_flistxattr(struct vfs_handle_struct *handle, } static int smb_full_audit_removexattr(struct vfs_handle_struct *handle, - struct connection_struct *conn, const char *path, + const char *path, const char *name) { int result; - result = SMB_VFS_NEXT_REMOVEXATTR(handle, conn, path, name); + result = SMB_VFS_NEXT_REMOVEXATTR(handle, path, name); do_log(SMB_VFS_OP_REMOVEXATTR, (result >= 0), handle, "%s|%s", path, name); @@ -1895,12 +1866,12 @@ static int smb_full_audit_removexattr(struct vfs_handle_struct *handle, } static int smb_full_audit_lremovexattr(struct vfs_handle_struct *handle, - struct connection_struct *conn, const char *path, + const char *path, const char *name) { int result; - result = SMB_VFS_NEXT_LREMOVEXATTR(handle, conn, path, name); + result = SMB_VFS_NEXT_LREMOVEXATTR(handle, path, name); do_log(SMB_VFS_OP_LREMOVEXATTR, (result >= 0), handle, "%s|%s", path, name); @@ -1923,13 +1894,13 @@ static int smb_full_audit_fremovexattr(struct vfs_handle_struct *handle, } static int smb_full_audit_setxattr(struct vfs_handle_struct *handle, - struct connection_struct *conn, const char *path, + const char *path, const char *name, const void *value, size_t size, int flags) { int result; - result = SMB_VFS_NEXT_SETXATTR(handle, conn, path, name, value, size, + result = SMB_VFS_NEXT_SETXATTR(handle, path, name, value, size, flags); do_log(SMB_VFS_OP_SETXATTR, (result >= 0), handle, @@ -1939,13 +1910,13 @@ static int smb_full_audit_setxattr(struct vfs_handle_struct *handle, } static int smb_full_audit_lsetxattr(struct vfs_handle_struct *handle, - struct connection_struct *conn, const char *path, + const char *path, const char *name, const void *value, size_t size, int flags) { int result; - result = SMB_VFS_NEXT_LSETXATTR(handle, conn, path, name, value, size, + result = SMB_VFS_NEXT_LSETXATTR(handle, path, name, value, size, flags); do_log(SMB_VFS_OP_LSETXATTR, (result >= 0), handle, -- cgit From 66cd8c30781a6856d2fe1516b281f8e176aa6304 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 6 Dec 2006 10:21:20 +0000 Subject: r20048: Fix vfs_full_audit after Jims kernel_flock addition (This used to be commit 4fe19e741fcb384f0cec59d3ec742d5bd173d41f) --- source3/modules/vfs_full_audit.c | 20 ++++++++++++++++++++ 1 file changed, 20 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 fd15c5c358..beda82c00e 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -155,6 +155,9 @@ static int smb_full_audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp int fd, SMB_OFF_T len); static BOOL smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type); +static int smb_full_audit_kernel_flock(struct vfs_handle_struct *handle, + struct files_struct *fsp, int fd, + uint32 share_mode); 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, @@ -374,6 +377,8 @@ static vfs_op_tuple audit_op_tuples[] = { SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_lock), SMB_VFS_OP_LOCK, 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_getlock), SMB_VFS_OP_GETLOCK, SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_symlink), SMB_VFS_OP_SYMLINK, @@ -541,6 +546,7 @@ static struct { { SMB_VFS_OP_UTIME, "utime" }, { SMB_VFS_OP_FTRUNCATE, "ftruncate" }, { SMB_VFS_OP_LOCK, "lock" }, + { SMB_VFS_OP_KERNEL_FLOCK, "kernel_flock" }, { SMB_VFS_OP_GETLOCK, "getlock" }, { SMB_VFS_OP_SYMLINK, "symlink" }, { SMB_VFS_OP_READLINK, "readlink" }, @@ -1292,6 +1298,20 @@ static BOOL smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, in return result; } +static int smb_full_audit_kernel_flock(struct vfs_handle_struct *handle, + struct files_struct *fsp, int fd, + uint32 share_mode) +{ + int result; + + result = SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, fd, share_mode); + + do_log(SMB_VFS_OP_KERNEL_FLOCK, (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 From 791f48f167de339c8ae371e5c80706511fd10018 Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Tue, 12 Dec 2006 17:38:42 +0000 Subject: r20124: clean up nested extern declaration warnings (This used to be commit ac3eb7813e33b9a2e78c9158433f7ed62c3b62bb) --- source3/modules/vfs_full_audit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (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 beda82c00e..f60a3b0585 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -60,6 +60,8 @@ #include "includes.h" +extern userdom_struct current_user_info; + static int vfs_full_audit_debug_level = DBGC_VFS; struct vfs_full_audit_private_data { @@ -647,7 +649,6 @@ static int audit_syslog_priority(vfs_handle_struct *handle) static char *audit_prefix(connection_struct *conn) { static pstring prefix; - extern userdom_struct current_user_info; pstrcpy(prefix, lp_parm_const_string(SNUM(conn), "full_audit", "prefix", "%u|%I")); -- cgit From 55ed1d59455566d90a03e7123fbf7a05a4bd4539 Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Tue, 19 Dec 2006 20:16:52 +0000 Subject: r20261: merge 20260 from samba_3_0_24 clean up a bunch of no previous prototype warnings (This used to be commit c60687db112405262adf26dbf267804b04074e67) --- source3/modules/vfs_full_audit.c | 1 + 1 file changed, 1 insertion(+) (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 f60a3b0585..e632040dc1 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -2039,6 +2039,7 @@ static int smb_full_audit_aio_suspend(struct vfs_handle_struct *handle, struct f } +NTSTATUS vfs_full_audit_init(void); NTSTATUS vfs_full_audit_init(void) { NTSTATUS ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION, -- cgit 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 From 4952fe368a40b239140b3035db6075427d237bb9 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 5 Mar 2007 23:40:03 +0000 Subject: r21714: Change the VFS interface to use struct timespec for utimes - change the call to ntimes. This preserves nsec timestamps we get from stat (if the system supports it) and only maps back down to usec or sec resolution on time set. Looks bigger than it is as I had to move lots of internal code from using time_t and struct utimebuf to struct timespec. Jeremy. (This used to be commit 8f3d530c5a748ea90f42ed8fbe68ae92178d4875) --- source3/modules/vfs_full_audit.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (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 6036e49fc1..e609ae1cd1 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -151,8 +151,8 @@ static int smb_full_audit_chdir(vfs_handle_struct *handle, const char *path); static char *smb_full_audit_getwd(vfs_handle_struct *handle, char *path); -static int smb_full_audit_utime(vfs_handle_struct *handle, - const char *path, struct utimbuf *times); +static int smb_full_audit_ntimes(vfs_handle_struct *handle, + const char *path, const struct timespec ts[2]); static int smb_full_audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T len); static BOOL smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, @@ -375,7 +375,7 @@ static vfs_op_tuple audit_op_tuples[] = { SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_getwd), SMB_VFS_OP_GETWD, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_utime), SMB_VFS_OP_UTIME, + {SMB_VFS_OP(smb_full_audit_ntimes), SMB_VFS_OP_NTIMES, SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_ftruncate), SMB_VFS_OP_FTRUNCATE, SMB_VFS_LAYER_LOGGER}, @@ -549,7 +549,7 @@ static struct { { SMB_VFS_OP_FCHOWN, "fchown" }, { SMB_VFS_OP_CHDIR, "chdir" }, { SMB_VFS_OP_GETWD, "getwd" }, - { SMB_VFS_OP_UTIME, "utime" }, + { SMB_VFS_OP_NTIMES, "ntimes" }, { SMB_VFS_OP_FTRUNCATE, "ftruncate" }, { SMB_VFS_OP_LOCK, "lock" }, { SMB_VFS_OP_KERNEL_FLOCK, "kernel_flock" }, @@ -1267,14 +1267,14 @@ static char *smb_full_audit_getwd(vfs_handle_struct *handle, return result; } -static int smb_full_audit_utime(vfs_handle_struct *handle, - const char *path, struct utimbuf *times) +static int smb_full_audit_ntimes(vfs_handle_struct *handle, + const char *path, const struct timespec ts[2]) { int result; - result = SMB_VFS_NEXT_UTIME(handle, path, times); + result = SMB_VFS_NEXT_NTIMES(handle, path, ts); - do_log(SMB_VFS_OP_UTIME, (result >= 0), handle, "%s", path); + do_log(SMB_VFS_OP_NTIMES, (result >= 0), handle, "%s", path); return result; } -- cgit From 6e5ea70e9e0aafa39dbf8cd53238d0045f38f468 Mon Sep 17 00:00:00 2001 From: James Peach Date: Thu, 8 Mar 2007 01:40:49 +0000 Subject: r21757: Add SMB_VFS_CHFLAGS operation. (This used to be commit 16cb22d6b83c502dec1b297c544c05d89714b3d6) --- source3/modules/vfs_full_audit.c | 17 +++++++++++++++++ 1 file changed, 17 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 e609ae1cd1..79a511df41 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -174,6 +174,8 @@ static int smb_full_audit_mknod(vfs_handle_struct *handle, const char *pathname, mode_t mode, SMB_DEV_T dev); static char *smb_full_audit_realpath(vfs_handle_struct *handle, const char *path, char *resolved_path); +static int smb_full_audit_chflags(vfs_handle_struct *handle, + const char *path, uint flags); static size_t smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info, SEC_DESC **ppdesc); @@ -397,6 +399,8 @@ static vfs_op_tuple audit_op_tuples[] = { SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_realpath), SMB_VFS_OP_REALPATH, SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(smb_full_audit_chflags), SMB_VFS_OP_CHFLAGS, + SMB_VFS_LAYER_LOGGER}, /* NT ACL operations. */ @@ -560,6 +564,7 @@ static struct { { SMB_VFS_OP_LINK, "link" }, { SMB_VFS_OP_MKNOD, "mknod" }, { SMB_VFS_OP_REALPATH, "realpath" }, + { SMB_VFS_OP_CHFLAGS, "chflags" }, { SMB_VFS_OP_FGET_NT_ACL, "fget_nt_acl" }, { SMB_VFS_OP_GET_NT_ACL, "get_nt_acl" }, { SMB_VFS_OP_FSET_NT_ACL, "fset_nt_acl" }, @@ -1405,6 +1410,18 @@ static char *smb_full_audit_realpath(vfs_handle_struct *handle, return result; } +static int smb_full_audit_chflags(vfs_handle_struct *handle, + const char *path, uint flags) +{ + int result; + + result = SMB_VFS_NEXT_CHFLAGS(handle, path, flags); + + do_log(SMB_VFS_OP_CHFLAGS, (result != 0), handle, "%s", path); + + return result; +} + static size_t smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info, SEC_DESC **ppdesc) -- cgit From e6bf92118b0dfe90896a612b663a060edbccea24 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 19 Mar 2007 17:02:15 +0000 Subject: r21874: Fix missing notify function. Thanks to Thomas Bork for pointing this out ! Jeremy. (This used to be commit b69e18c7f167418ca364a85f1dac252f7b549e57) --- source3/modules/vfs_full_audit.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 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 79a511df41..d6794c14ff 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -174,6 +174,13 @@ static int smb_full_audit_mknod(vfs_handle_struct *handle, const char *pathname, mode_t mode, SMB_DEV_T dev); static char *smb_full_audit_realpath(vfs_handle_struct *handle, const char *path, char *resolved_path); +static NTSTATUS smb_full_audit_notify_watch(struct vfs_handle_struct *handle, + struct sys_notify_context *ctx, + struct notify_entry *e, + void (*callback)(struct sys_notify_context *ctx, + void *private_data, + struct notify_event *ev), + void *private_data, void *handle_p); static int smb_full_audit_chflags(vfs_handle_struct *handle, const char *path, uint flags); static size_t smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, @@ -399,6 +406,8 @@ static vfs_op_tuple audit_op_tuples[] = { SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_realpath), SMB_VFS_OP_REALPATH, SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(smb_full_audit_notify_watch),SMB_VFS_OP_NOTIFY_WATCH, + SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_chflags), SMB_VFS_OP_CHFLAGS, SMB_VFS_LAYER_LOGGER}, @@ -1410,6 +1419,23 @@ static char *smb_full_audit_realpath(vfs_handle_struct *handle, return result; } +static NTSTATUS smb_full_audit_notify_watch(struct vfs_handle_struct *handle, + struct sys_notify_context *ctx, + struct notify_entry *e, + void (*callback)(struct sys_notify_context *ctx, + void *private_data, + struct notify_event *ev), + void *private_data, void *handle_p) +{ + NTSTATUS result; + + result = SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, e, callback, private_data, handle_p); + + do_log(SMB_VFS_OP_NOTIFY_WATCH, NT_STATUS_IS_OK(result), handle, ""); + + return result; +} + static int smb_full_audit_chflags(vfs_handle_struct *handle, const char *path, uint flags) { -- cgit From 7c09cfd0806d24e89f4dc9714a9efe09758e6f12 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 19 Mar 2007 21:03:30 +0000 Subject: r21877: Missed one line. Jeremy. (This used to be commit 184571e4b0283fb1a62c441f10429006656052c8) --- source3/modules/vfs_full_audit.c | 1 + 1 file changed, 1 insertion(+) (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 d6794c14ff..62530fb09c 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -573,6 +573,7 @@ static struct { { SMB_VFS_OP_LINK, "link" }, { SMB_VFS_OP_MKNOD, "mknod" }, { SMB_VFS_OP_REALPATH, "realpath" }, + { SMB_VFS_OP_NOTIFY_WATCH, "notify_watch" }, { SMB_VFS_OP_CHFLAGS, "chflags" }, { SMB_VFS_OP_FGET_NT_ACL, "fget_nt_acl" }, { SMB_VFS_OP_GET_NT_ACL, "get_nt_acl" }, -- cgit From 57d6318a0b5ecc0154547a04acef8ac222c1d28f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 23 May 2007 23:55:12 +0000 Subject: r23105: Add lchown to the vfs layer. We need this in the POSIX code. Jeremy. (This used to be commit 932523cbb508db869b726768e86bfa8e248f768b) --- 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 62530fb09c..cd434f1951 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -147,6 +147,8 @@ static int smb_full_audit_chown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid); static int smb_full_audit_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd, uid_t uid, gid_t gid); +static int smb_full_audit_lchown(vfs_handle_struct *handle, + const char *path, uid_t uid, gid_t gid); static int smb_full_audit_chdir(vfs_handle_struct *handle, const char *path); static char *smb_full_audit_getwd(vfs_handle_struct *handle, @@ -380,6 +382,8 @@ static vfs_op_tuple audit_op_tuples[] = { SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_fchown), SMB_VFS_OP_FCHOWN, SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(smb_full_audit_lchown), SMB_VFS_OP_LCHOWN, + SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_chdir), SMB_VFS_OP_CHDIR, SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_getwd), SMB_VFS_OP_GETWD, @@ -560,6 +564,7 @@ static struct { { SMB_VFS_OP_FCHMOD, "fchmod" }, { SMB_VFS_OP_CHOWN, "chown" }, { SMB_VFS_OP_FCHOWN, "fchown" }, + { SMB_VFS_OP_LCHOWN, "lchown" }, { SMB_VFS_OP_CHDIR, "chdir" }, { SMB_VFS_OP_GETWD, "getwd" }, { SMB_VFS_OP_NTIMES, "ntimes" }, @@ -1258,6 +1263,19 @@ static int smb_full_audit_fchown(vfs_handle_struct *handle, files_struct *fsp, i return result; } +static int smb_full_audit_lchown(vfs_handle_struct *handle, + const char *path, uid_t uid, gid_t gid) +{ + int result; + + result = SMB_VFS_NEXT_LCHOWN(handle, path, uid, gid); + + do_log(SMB_VFS_OP_LCHOWN, (result >= 0), handle, "%s|%ld|%ld", + path, (long int)uid, (long int)gid); + + return result; +} + static int smb_full_audit_chdir(vfs_handle_struct *handle, const char *path) { -- cgit From a0ac7a7f4c0290787cdadb5866272cee2bd61b8a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 26 Jun 2007 22:49:10 +0000 Subject: r23620: Convert set_nt_acl to return NTSTATUS. Also fix the chown return to correctly return NT_STATUS_INVALID_OWNER if it should be disallowed. Matches better what W2K3R3 does. NFSv4 ACL module owners, please examine these changes. Jeremy. (This used to be commit fc6899a5506b272f8cd5f5837ca13300b4e69a5f) --- source3/modules/vfs_full_audit.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (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 cd434f1951..e76cb9fc23 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -191,10 +191,10 @@ static size_t smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct static size_t smb_full_audit_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info, SEC_DESC **ppdesc); -static BOOL smb_full_audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, +static NTSTATUS smb_full_audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info_sent, SEC_DESC *psd); -static BOOL smb_full_audit_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, +static NTSTATUS smb_full_audit_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info_sent, SEC_DESC *psd); static int smb_full_audit_chmod_acl(vfs_handle_struct *handle, @@ -1497,30 +1497,30 @@ static size_t smb_full_audit_get_nt_acl(vfs_handle_struct *handle, files_struct return result; } -static BOOL smb_full_audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, +static NTSTATUS smb_full_audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info_sent, SEC_DESC *psd) { - BOOL result; + NTSTATUS result; result = SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, fd, security_info_sent, psd); - do_log(SMB_VFS_OP_FSET_NT_ACL, result, handle, "%s", fsp->fsp_name); + do_log(SMB_VFS_OP_FSET_NT_ACL, NT_STATUS_IS_OK(result), handle, "%s", fsp->fsp_name); return result; } -static BOOL smb_full_audit_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, +static NTSTATUS smb_full_audit_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info_sent, SEC_DESC *psd) { - BOOL result; + NTSTATUS result; result = SMB_VFS_NEXT_SET_NT_ACL(handle, fsp, name, security_info_sent, psd); - do_log(SMB_VFS_OP_SET_NT_ACL, result, handle, "%s", fsp->fsp_name); + do_log(SMB_VFS_OP_SET_NT_ACL, NT_STATUS_IS_OK(result), handle, "%s", fsp->fsp_name); return result; } -- cgit From d824b98f80ba186030cbb70b3a1e5daf80469ecd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 9 Jul 2007 19:25:36 +0000 Subject: r23779: Change from v2 or later to v3 or later. Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3) --- source3/modules/vfs_full_audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 e76cb9fc23..dab7a03aeb 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -10,7 +10,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, -- cgit From 153cfb9c83534b09f15cc16205d7adb19b394928 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 05:23:25 +0000 Subject: r23801: The FSF has moved around a lot. This fixes their Mass Ave address. (This used to be commit 87c91e4362c51819032bfbebbb273c52e203b227) --- source3/modules/vfs_full_audit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (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 dab7a03aeb..65748db36f 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -19,8 +19,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * along with this program; if not, see . */ /* -- cgit From 564e6841d60ec5ae573a707f73fcc0ab80a41394 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 2 Aug 2007 09:19:04 +0000 Subject: r24123: add file_id_create() to some vfs modules metze (This used to be commit 0bc5a9cd0136f8512e963a30b6e7b009667fb0bf) --- source3/modules/vfs_full_audit.c | 22 ++++++++++++++++++++++ 1 file changed, 22 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 65748db36f..47646e248f 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -184,6 +184,8 @@ static NTSTATUS smb_full_audit_notify_watch(struct vfs_handle_struct *handle, void *private_data, void *handle_p); static int smb_full_audit_chflags(vfs_handle_struct *handle, const char *path, uint flags); +static struct file_id smb_full_audit_file_id_create(struct vfs_handle_struct *handle, + SMB_DEV_T dev, SMB_INO_T inode); static size_t smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info, SEC_DESC **ppdesc); @@ -413,6 +415,8 @@ static vfs_op_tuple audit_op_tuples[] = { SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_chflags), SMB_VFS_OP_CHFLAGS, SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(smb_full_audit_file_id_create), SMB_VFS_OP_FILE_ID_CREATE, + SMB_VFS_LAYER_LOGGER}, /* NT ACL operations. */ @@ -579,6 +583,7 @@ static struct { { SMB_VFS_OP_REALPATH, "realpath" }, { SMB_VFS_OP_NOTIFY_WATCH, "notify_watch" }, { SMB_VFS_OP_CHFLAGS, "chflags" }, + { SMB_VFS_OP_FILE_ID_CREATE, "file_id_create" }, { SMB_VFS_OP_FGET_NT_ACL, "fget_nt_acl" }, { SMB_VFS_OP_GET_NT_ACL, "get_nt_acl" }, { SMB_VFS_OP_FSET_NT_ACL, "fset_nt_acl" }, @@ -1466,6 +1471,23 @@ static int smb_full_audit_chflags(vfs_handle_struct *handle, return result; } +static struct file_id smb_full_audit_file_id_create(struct vfs_handle_struct *handle, + SMB_DEV_T dev, SMB_INO_T inode) +{ + struct file_id id_zero; + struct file_id result; + + ZERO_STRUCT(id_zero); + + result = SMB_VFS_NEXT_FILE_ID_CREATE(handle, dev, inode); + + do_log(SMB_VFS_OP_FILE_ID_CREATE, + !file_id_equal(&id_zero, &result), + handle, "%s", file_id_static_string(&result)); + + return result; +} + static size_t smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info, SEC_DESC **ppdesc) -- cgit From 4ee8b2937d48308c6089fb539fdbd8625dfde360 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 10 Sep 2007 10:56:07 +0000 Subject: r25055: Add file_id_string_tos This removes file_id_string_static and file_id_string_static2 (This used to be commit 638c848c9afe374feb30e34c494f89b2a6c64f7b) --- source3/modules/vfs_full_audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 47646e248f..3e99e52637 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -1483,7 +1483,7 @@ static struct file_id smb_full_audit_file_id_create(struct vfs_handle_struct *ha do_log(SMB_VFS_OP_FILE_ID_CREATE, !file_id_equal(&id_zero, &result), - handle, "%s", file_id_static_string(&result)); + handle, "%s", file_id_string_tos(&result)); return result; } -- cgit From 470ebf8a3504474dea5c324d01282e59c034a236 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 28 Sep 2007 01:32:08 +0000 Subject: r25399: Excise uint - > uint32 (where appropriate) or unsigned int. Jeremy. (This used to be commit b4ee924000f4a21b16a70e08e58331d209c4d114) --- source3/modules/vfs_full_audit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (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 3e99e52637..18180bf3ef 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -183,7 +183,7 @@ static NTSTATUS smb_full_audit_notify_watch(struct vfs_handle_struct *handle, struct notify_event *ev), void *private_data, void *handle_p); static int smb_full_audit_chflags(vfs_handle_struct *handle, - const char *path, uint flags); + const char *path, unsigned int flags); static struct file_id smb_full_audit_file_id_create(struct vfs_handle_struct *handle, SMB_DEV_T dev, SMB_INO_T inode); static size_t smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, @@ -1460,7 +1460,7 @@ static NTSTATUS smb_full_audit_notify_watch(struct vfs_handle_struct *handle, } static int smb_full_audit_chflags(vfs_handle_struct *handle, - const char *path, uint flags) + const char *path, unsigned int flags) { int result; -- cgit From 30191d1a5704ad2b158386b511558972d539ce47 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 18 Oct 2007 17:40:25 -0700 Subject: RIP BOOL. Convert BOOL -> bool. I found a few interesting bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f) --- source3/modules/vfs_full_audit.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (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 18180bf3ef..df49c86264 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -78,7 +78,7 @@ static int smb_full_audit_connect(vfs_handle_struct *handle, static void smb_full_audit_disconnect(vfs_handle_struct *handle); static SMB_BIG_UINT smb_full_audit_disk_free(vfs_handle_struct *handle, const char *path, - BOOL small_query, SMB_BIG_UINT *bsize, + bool small_query, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize); static int smb_full_audit_get_quota(struct vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, @@ -88,7 +88,7 @@ static int smb_full_audit_set_quota(struct vfs_handle_struct *handle, SMB_DISK_QUOTA *qt); static int smb_full_audit_get_shadow_copy_data(struct vfs_handle_struct *handle, struct files_struct *fsp, - SHADOW_COPY_DATA *shadow_copy_data, BOOL labels); + SHADOW_COPY_DATA *shadow_copy_data, bool labels); static int smb_full_audit_statvfs(struct vfs_handle_struct *handle, const char *path, struct vfs_statvfs_struct *statbuf); @@ -156,14 +156,14 @@ static int smb_full_audit_ntimes(vfs_handle_struct *handle, const char *path, const struct timespec ts[2]); static int smb_full_audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T len); -static BOOL smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, +static bool smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type); 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, +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, const char *oldpath, const char *newpath); @@ -689,7 +689,7 @@ static char *audit_prefix(connection_struct *conn) return prefix; } -static BOOL log_success(vfs_handle_struct *handle, vfs_op_type op) +static bool log_success(vfs_handle_struct *handle, vfs_op_type op) { struct vfs_full_audit_private_data *pd = NULL; @@ -704,7 +704,7 @@ static BOOL log_success(vfs_handle_struct *handle, vfs_op_type op) return bitmap_query(pd->success_ops, op); } -static BOOL log_failure(vfs_handle_struct *handle, vfs_op_type op) +static bool log_failure(vfs_handle_struct *handle, vfs_op_type op) { struct vfs_full_audit_private_data *pd = NULL; @@ -720,7 +720,7 @@ static BOOL log_failure(vfs_handle_struct *handle, vfs_op_type op) static void init_bitmap(struct bitmap **bm, const char **ops) { - BOOL log_all = False; + bool log_all = False; if (*bm != NULL) return; @@ -735,7 +735,7 @@ static void init_bitmap(struct bitmap **bm, const char **ops) while (*ops != NULL) { int i; - BOOL found = False; + bool found = False; if (strequal(*ops, "all")) { log_all = True; @@ -780,7 +780,7 @@ static const char *audit_opname(vfs_op_type op) return vfs_op_names[op].name; } -static void do_log(vfs_op_type op, BOOL success, vfs_handle_struct *handle, +static void do_log(vfs_op_type op, bool success, vfs_handle_struct *handle, const char *format, ...) { fstring err_msg; @@ -881,7 +881,7 @@ static void smb_full_audit_disconnect(vfs_handle_struct *handle) static SMB_BIG_UINT smb_full_audit_disk_free(vfs_handle_struct *handle, const char *path, - BOOL small_query, SMB_BIG_UINT *bsize, + bool small_query, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize) { SMB_BIG_UINT result; @@ -925,7 +925,7 @@ static int smb_full_audit_set_quota(struct vfs_handle_struct *handle, static int smb_full_audit_get_shadow_copy_data(struct vfs_handle_struct *handle, struct files_struct *fsp, - SHADOW_COPY_DATA *shadow_copy_data, BOOL labels) + SHADOW_COPY_DATA *shadow_copy_data, bool labels) { int result; @@ -1329,10 +1329,10 @@ static int smb_full_audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp return result; } -static BOOL smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, +static bool smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type) { - BOOL result; + bool result; result = SMB_VFS_NEXT_LOCK(handle, fsp, fd, op, offset, count, type); @@ -1368,10 +1368,10 @@ static int smb_full_audit_linux_setlease(vfs_handle_struct *handle, files_struct return result; } -static BOOL smb_full_audit_getlock(vfs_handle_struct *handle, files_struct *fsp, int fd, +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) { - BOOL result; + bool result; result = SMB_VFS_NEXT_GETLOCK(handle, fsp, fd, poffset, pcount, ptype, ppid); -- cgit From 488b59cfac244ec8cfc60df687fcd153d693509c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 29 Oct 2007 17:16:13 -0700 Subject: Add in the recvfile entry to the VFS layer with a default implementation. Needed for the zero-copy write code. Jeremy. (This used to be commit bfbdb6324c5d13bfde8b742e9c5a0e0c9092bd86) --- source3/modules/vfs_full_audit.c | 22 ++++++++++++++++++++++ 1 file changed, 22 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 df49c86264..c8a82e3d9a 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -127,6 +127,10 @@ static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fsp, int fromfd, const DATA_BLOB *hdr, SMB_OFF_T offset, size_t n); +static ssize_t smb_full_audit_recvfile(vfs_handle_struct *handle, int fromfd, + files_struct *fsp, int tofd, + SMB_OFF_T offset, + size_t n); static int smb_full_audit_rename(vfs_handle_struct *handle, const char *oldname, const char *newname); static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd); @@ -363,6 +367,8 @@ static vfs_op_tuple audit_op_tuples[] = { SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_sendfile), SMB_VFS_OP_SENDFILE, SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(smb_full_audit_recvfile), SMB_VFS_OP_RECVFILE, + SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_rename), SMB_VFS_OP_RENAME, SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_fsync), SMB_VFS_OP_FSYNC, @@ -1145,6 +1151,22 @@ static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd, return result; } +static ssize_t smb_full_audit_recvfile(vfs_handle_struct *handle, int fromfd, + files_struct *fsp, int tofd, + SMB_OFF_T offset, + size_t n) +{ + ssize_t result; + + result = SMB_VFS_NEXT_RECVFILE(handle, fromfd, fsp, tofd, + offset, n); + + do_log(SMB_VFS_OP_RECVFILE, (result >= 0), handle, + "%s", fsp->fsp_name); + + return result; +} + static int smb_full_audit_rename(vfs_handle_struct *handle, const char *oldname, const char *newname) { -- cgit From 15953b82eb3b49d736b4b835b1d0d3cf0da0bff8 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 13 Oct 2007 21:06:49 +0200 Subject: Make [f]get_nt_acl return NTSTATUS (This used to be commit dcbe1bf942d017a3cd5084c6ef605a13912f795b) --- source3/modules/vfs_full_audit.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (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 c8a82e3d9a..0f84c4de17 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -190,10 +190,10 @@ static int smb_full_audit_chflags(vfs_handle_struct *handle, const char *path, unsigned int flags); static struct file_id smb_full_audit_file_id_create(struct vfs_handle_struct *handle, SMB_DEV_T dev, SMB_INO_T inode); -static size_t smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, +static NTSTATUS smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info, SEC_DESC **ppdesc); -static size_t smb_full_audit_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, +static NTSTATUS smb_full_audit_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info, SEC_DESC **ppdesc); static NTSTATUS smb_full_audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, @@ -1510,31 +1510,33 @@ static struct file_id smb_full_audit_file_id_create(struct vfs_handle_struct *ha return result; } -static size_t smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, +static NTSTATUS smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info, SEC_DESC **ppdesc) { - size_t result; + NTSTATUS result; result = SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, fd, security_info, ppdesc); - do_log(SMB_VFS_OP_FGET_NT_ACL, (result > 0), handle, + do_log(SMB_VFS_OP_FGET_NT_ACL, NT_STATUS_IS_OK(result), handle, "%s", fsp->fsp_name); return result; } -static size_t smb_full_audit_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, - const char *name, uint32 security_info, - SEC_DESC **ppdesc) +static NTSTATUS smb_full_audit_get_nt_acl(vfs_handle_struct *handle, + files_struct *fsp, + const char *name, + uint32 security_info, + SEC_DESC **ppdesc) { - size_t result; + NTSTATUS result; result = SMB_VFS_NEXT_GET_NT_ACL(handle, fsp, name, security_info, ppdesc); - do_log(SMB_VFS_OP_GET_NT_ACL, (result > 0), handle, + do_log(SMB_VFS_OP_GET_NT_ACL, NT_STATUS_IS_OK(result), handle, "%s", fsp->fsp_name); return result; -- cgit From 882987594455c6676d0b01618d91bdbfc5e3b267 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 16 Nov 2007 17:07:11 -0800 Subject: Remove pstring from modules directory. Jeremy. (This used to be commit 977dc3accb3d440e5fd19591c425da7dc3718d94) --- source3/modules/vfs_full_audit.c | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) (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 0f84c4de17..533ac712ca 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -681,18 +681,22 @@ static int audit_syslog_priority(vfs_handle_struct *handle) return priority; } -static char *audit_prefix(connection_struct *conn) +static char *audit_prefix(TALLOC_CTX *ctx, connection_struct *conn) { - static pstring prefix; + char *prefix = NULL; - pstrcpy(prefix, lp_parm_const_string(SNUM(conn), "full_audit", + prefix = talloc_strdup(ctx, + lp_parm_const_string(SNUM(conn), "full_audit", "prefix", "%u|%I")); - standard_sub_advanced(lp_servicename(SNUM(conn)), conn->user, - conn->connectpath, conn->gid, - get_current_username(), - current_user_info.domain, - prefix, sizeof(prefix)); - return prefix; + if (!prefix) { + return NULL; + } + return talloc_sub_advanced(ctx, + lp_servicename(SNUM(conn)), conn->user, + conn->connectpath, conn->gid, + get_current_username(), + current_user_info.domain, + prefix); } static bool log_success(vfs_handle_struct *handle, vfs_op_type op) @@ -790,8 +794,9 @@ static void do_log(vfs_op_type op, bool success, vfs_handle_struct *handle, const char *format, ...) { fstring err_msg; - pstring op_msg; + char *audit_pre = NULL; va_list ap; + char *op_msg = NULL; if (success && (!log_success(handle, op))) return; @@ -805,11 +810,20 @@ static void do_log(vfs_op_type op, bool success, vfs_handle_struct *handle, fstr_sprintf(err_msg, "fail (%s)", strerror(errno)); va_start(ap, format); - vsnprintf(op_msg, sizeof(op_msg), format, ap); + op_msg = talloc_vasprintf(NULL, format, ap); va_end(ap); + if (!op_msg) { + return; + } + + audit_pre = audit_prefix(NULL, handle->conn); syslog(audit_syslog_priority(handle), "%s|%s|%s|%s\n", - audit_prefix(handle->conn), audit_opname(op), err_msg, op_msg); + audit_pre ? audit_pre : "", + audit_opname(op), err_msg, op_msg); + + TALLOC_FREE(audit_pre); + TALLOC_FREE(op_msg); return; } -- cgit From ec7426d917f9029052748d2271c5c071a13feb78 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 11 Dec 2007 15:10:37 -0800 Subject: Fix warning message about data type always true. Jeremy. (This used to be commit 0a3be0aad7220eb97fe39460e20f36c8ae9ce474) --- source3/modules/vfs_full_audit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (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 533ac712ca..f4aeefbbf0 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -1372,7 +1372,7 @@ static bool smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, in result = SMB_VFS_NEXT_LOCK(handle, fsp, fd, op, offset, count, type); - do_log(SMB_VFS_OP_LOCK, (result >= 0), handle, "%s", fsp->fsp_name); + do_log(SMB_VFS_OP_LOCK, result, handle, "%s", fsp->fsp_name); return result; } @@ -1411,7 +1411,7 @@ static bool smb_full_audit_getlock(vfs_handle_struct *handle, files_struct *fsp, result = SMB_VFS_NEXT_GETLOCK(handle, fsp, fd, poffset, pcount, ptype, ppid); - do_log(SMB_VFS_OP_GETLOCK, (result >= 0), handle, "%s", fsp->fsp_name); + do_log(SMB_VFS_OP_GETLOCK, result, handle, "%s", fsp->fsp_name); return result; } -- cgit From 233eb0e560acb26f8706fd3ab96d4c6379458414 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 5 Dec 2007 09:53:10 +0100 Subject: Change the prototype of the vfs function get_nt_acl(). Up to now, get_nt_acl() took a files_struct pointer (fsp) and a file name. All the underlying functions should need and now do need (after the previous preparatory work), is a connection_struct and a file name. The connection_struct is already there in the vfs_handle passed to the vfs functions. So the files_struct argument can be eliminated. This eliminates the need of calling open_file_stat in a couple of places to produce the fsp needed. Michael (This used to be commit b5f600fab53c9d159a958c59795db3ba4a8acc63) --- source3/modules/vfs_full_audit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (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 f4aeefbbf0..f6b6e85837 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -1547,8 +1547,7 @@ static NTSTATUS smb_full_audit_get_nt_acl(vfs_handle_struct *handle, { NTSTATUS result; - result = SMB_VFS_NEXT_GET_NT_ACL(handle, fsp, name, security_info, - ppdesc); + result = SMB_VFS_NEXT_GET_NT_ACL(handle, name, security_info, ppdesc); do_log(SMB_VFS_OP_GET_NT_ACL, NT_STATUS_IS_OK(result), handle, "%s", fsp->fsp_name); -- cgit From ee24c629a68e13764f78064121a6aea3d0e9240c Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sat, 5 Jan 2008 02:16:15 +0100 Subject: Remove superfluous fd parameter from SMB_VFS_FGET_NT_ACL(). Michael (This used to be commit c0c7c1223da29c68359dac64a340c1c710d5f3d2) --- source3/modules/vfs_full_audit.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (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 f6b6e85837..8f90e0de87 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -191,7 +191,7 @@ static int smb_full_audit_chflags(vfs_handle_struct *handle, static struct file_id smb_full_audit_file_id_create(struct vfs_handle_struct *handle, SMB_DEV_T dev, SMB_INO_T inode); static NTSTATUS smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, - int fd, uint32 security_info, + uint32 security_info, SEC_DESC **ppdesc); static NTSTATUS smb_full_audit_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info, @@ -1525,13 +1525,12 @@ static struct file_id smb_full_audit_file_id_create(struct vfs_handle_struct *ha } static NTSTATUS smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, - int fd, uint32 security_info, + uint32 security_info, SEC_DESC **ppdesc) { NTSTATUS result; - result = SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, fd, security_info, - ppdesc); + result = SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, ppdesc); do_log(SMB_VFS_OP_FGET_NT_ACL, NT_STATUS_IS_OK(result), handle, "%s", fsp->fsp_name); -- cgit From 05352cf2cb7f9710444d340f3f14ac6917fb0416 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sun, 6 Jan 2008 18:48:02 +0100 Subject: Remove superfluous parameter fd from SMB_VFS_FSET_NT_ACL(). Michael (This used to be commit 4f2d139a186048f08180378a877b69d2f80ad51f) --- source3/modules/vfs_full_audit.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (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 8f90e0de87..bdbd84ab4f 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -197,7 +197,7 @@ static NTSTATUS smb_full_audit_get_nt_acl(vfs_handle_struct *handle, files_struc const char *name, uint32 security_info, SEC_DESC **ppdesc); static NTSTATUS smb_full_audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, - int fd, uint32 security_info_sent, + uint32 security_info_sent, SEC_DESC *psd); static NTSTATUS smb_full_audit_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info_sent, @@ -1555,13 +1555,12 @@ static NTSTATUS smb_full_audit_get_nt_acl(vfs_handle_struct *handle, } static NTSTATUS smb_full_audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, - int fd, uint32 security_info_sent, + uint32 security_info_sent, SEC_DESC *psd) { NTSTATUS result; - result = SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, fd, security_info_sent, - psd); + result = SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd); do_log(SMB_VFS_OP_FSET_NT_ACL, NT_STATUS_IS_OK(result), handle, "%s", fsp->fsp_name); -- cgit From ca275e254985727c50b1b988c958a3743a7bc8ce Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 7 Jan 2008 00:14:19 +0100 Subject: Remove unneeded parameter fd from SMB_VFS_PREAD(). Michael (This used to be commit 73e28806ce87d829ea7c38ed3440020845bb13bf) --- source3/modules/vfs_full_audit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (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 bdbd84ab4f..7acca905a0 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -115,7 +115,7 @@ static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp, in static ssize_t smb_full_audit_read(vfs_handle_struct *handle, files_struct *fsp, int fd, void *data, size_t n); static ssize_t smb_full_audit_pread(vfs_handle_struct *handle, files_struct *fsp, - int fd, void *data, size_t n, SMB_OFF_T offset); + void *data, size_t n, SMB_OFF_T offset); static ssize_t smb_full_audit_write(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data, size_t n); static ssize_t smb_full_audit_pwrite(vfs_handle_struct *handle, files_struct *fsp, @@ -1100,11 +1100,11 @@ static ssize_t smb_full_audit_read(vfs_handle_struct *handle, files_struct *fsp, } static ssize_t smb_full_audit_pread(vfs_handle_struct *handle, files_struct *fsp, - int fd, void *data, size_t n, SMB_OFF_T offset) + void *data, size_t n, SMB_OFF_T offset) { ssize_t result; - result = SMB_VFS_NEXT_PREAD(handle, fsp, fd, data, n, offset); + result = SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset); do_log(SMB_VFS_OP_PREAD, (result >= 0), handle, "%s", fsp->fsp_name); -- cgit From a56b417809805f8872c1e3238cce5d006d6189e4 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 7 Jan 2008 09:23:04 +0100 Subject: Remove redundant parameter fd from SMB_VFS_PWRITE(). Michael (This used to be commit 8c4901a19ae2fd3ee085f9499f33aa7db016d182) --- source3/modules/vfs_full_audit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (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 7acca905a0..c0bc40cc67 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -119,7 +119,7 @@ static ssize_t smb_full_audit_pread(vfs_handle_struct *handle, files_struct *fsp static ssize_t smb_full_audit_write(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data, size_t n); static ssize_t smb_full_audit_pwrite(vfs_handle_struct *handle, files_struct *fsp, - int fd, const void *data, size_t n, + const void *data, size_t n, SMB_OFF_T offset); static SMB_OFF_T smb_full_audit_lseek(vfs_handle_struct *handle, files_struct *fsp, int filedes, SMB_OFF_T offset, int whence); @@ -1124,12 +1124,12 @@ static ssize_t smb_full_audit_write(vfs_handle_struct *handle, files_struct *fsp } static ssize_t smb_full_audit_pwrite(vfs_handle_struct *handle, files_struct *fsp, - int fd, const void *data, size_t n, + const void *data, size_t n, SMB_OFF_T offset) { ssize_t result; - result = SMB_VFS_NEXT_PWRITE(handle, fsp, fd, data, n, offset); + result = SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset); do_log(SMB_VFS_OP_PWRITE, (result >= 0), handle, "%s", fsp->fsp_name); -- cgit From 6f657c873efa4779e762a8f9ede97e19da6fb7ec Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 7 Jan 2008 10:15:08 +0100 Subject: Remove redundant parameter fd from SMB_VFS_LSEEK(). Michael (This used to be commit df929796f2698698d2875227bda8500589cca2df) --- source3/modules/vfs_full_audit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (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 c0bc40cc67..b03f6b53f4 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -122,7 +122,7 @@ static ssize_t smb_full_audit_pwrite(vfs_handle_struct *handle, files_struct *fs const void *data, size_t n, SMB_OFF_T offset); static SMB_OFF_T smb_full_audit_lseek(vfs_handle_struct *handle, files_struct *fsp, - int filedes, SMB_OFF_T offset, int whence); + SMB_OFF_T offset, int whence); static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fsp, int fromfd, const DATA_BLOB *hdr, SMB_OFF_T offset, @@ -1137,11 +1137,11 @@ static ssize_t smb_full_audit_pwrite(vfs_handle_struct *handle, files_struct *fs } static SMB_OFF_T smb_full_audit_lseek(vfs_handle_struct *handle, files_struct *fsp, - int filedes, SMB_OFF_T offset, int whence) + SMB_OFF_T offset, int whence) { ssize_t result; - result = SMB_VFS_NEXT_LSEEK(handle, fsp, filedes, offset, whence); + result = SMB_VFS_NEXT_LSEEK(handle, fsp, offset, whence); do_log(SMB_VFS_OP_LSEEK, (result != (ssize_t)-1), handle, "%s", fsp->fsp_name); -- cgit From 8dcce0d236b2102ca94fbcb7aa7126fe6733f2e7 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 7 Jan 2008 12:49:02 +0100 Subject: Remove redundant parameter fd from SMB_VFS_FSYNC(). Michael (This used to be commit 8f83c9a7b245dbfef28195f9a7f33047a8ba95a0) --- source3/modules/vfs_full_audit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (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 b03f6b53f4..396b2bbb68 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -133,7 +133,7 @@ static ssize_t smb_full_audit_recvfile(vfs_handle_struct *handle, int fromfd, size_t n); static int smb_full_audit_rename(vfs_handle_struct *handle, const char *oldname, const char *newname); -static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd); +static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp); static int smb_full_audit_stat(vfs_handle_struct *handle, const char *fname, SMB_STRUCT_STAT *sbuf); static int smb_full_audit_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd, @@ -1193,11 +1193,11 @@ static int smb_full_audit_rename(vfs_handle_struct *handle, return result; } -static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd) +static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp) { int result; - result = SMB_VFS_NEXT_FSYNC(handle, fsp, fd); + result = SMB_VFS_NEXT_FSYNC(handle, fsp); do_log(SMB_VFS_OP_FSYNC, (result >= 0), handle, "%s", fsp->fsp_name); -- cgit From 87a684f7fcfa8d9fabc42e33981299d0b33eeeb7 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 7 Jan 2008 13:21:26 +0100 Subject: Remove redundant parameter fd from SMB_VFS_FSTAT(). Michael (This used to be commit 0b86c420be94d295f6917a220b5d699f65b46711) --- source3/modules/vfs_full_audit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (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 396b2bbb68..7464bf80b3 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -136,7 +136,7 @@ static int smb_full_audit_rename(vfs_handle_struct *handle, static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp); static int smb_full_audit_stat(vfs_handle_struct *handle, const char *fname, SMB_STRUCT_STAT *sbuf); -static int smb_full_audit_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd, +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); @@ -1216,12 +1216,12 @@ static int smb_full_audit_stat(vfs_handle_struct *handle, return result; } -static int smb_full_audit_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd, +static int smb_full_audit_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf) { int result; - result = SMB_VFS_NEXT_FSTAT(handle, fsp, fd, sbuf); + result = SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf); do_log(SMB_VFS_OP_FSTAT, (result >= 0), handle, "%s", fsp->fsp_name); -- cgit From e614dec27f33c932c6c29c806d567fd6015cd5e6 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 7 Jan 2008 13:44:37 +0100 Subject: Remove redundant parameter fd from SMB_VFS_FCHMOD(). Michael (This used to be commit a54d5604da556d1250ca9948d4acc4a187a9fede) --- source3/modules/vfs_full_audit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (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 7464bf80b3..fee65ba53f 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -144,7 +144,7 @@ static int smb_full_audit_unlink(vfs_handle_struct *handle, const char *path); static int smb_full_audit_chmod(vfs_handle_struct *handle, const char *path, mode_t mode); -static int smb_full_audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, +static int smb_full_audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode); static int smb_full_audit_chown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid); @@ -1264,12 +1264,12 @@ static int smb_full_audit_chmod(vfs_handle_struct *handle, return result; } -static int smb_full_audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, +static int smb_full_audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode) { int result; - result = SMB_VFS_NEXT_FCHMOD(handle, fsp, fd, mode); + result = SMB_VFS_NEXT_FCHMOD(handle, fsp, mode); do_log(SMB_VFS_OP_FCHMOD, (result >= 0), handle, "%s|%o", fsp->fsp_name, mode); -- cgit From 670909cb07e38a06bf5db12342b3b1189f0e1ab7 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 7 Jan 2008 14:26:00 +0100 Subject: Remove redundant parameter fd from SMB_VFS_FCHOWN(). Michael (This used to be commit fbb193db3e0dc51cb000ae406a68bc547f31d9ab) --- source3/modules/vfs_full_audit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (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 fee65ba53f..f7796adba0 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -148,7 +148,7 @@ static int smb_full_audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode); static int smb_full_audit_chown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid); -static int smb_full_audit_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd, +static int smb_full_audit_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid); static int smb_full_audit_lchown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid); @@ -1290,12 +1290,12 @@ static int smb_full_audit_chown(vfs_handle_struct *handle, return result; } -static int smb_full_audit_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd, +static int smb_full_audit_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid) { int result; - result = SMB_VFS_NEXT_FCHOWN(handle, fsp, fd, uid, gid); + result = SMB_VFS_NEXT_FCHOWN(handle, fsp, uid, gid); do_log(SMB_VFS_OP_FCHOWN, (result >= 0), handle, "%s|%ld|%ld", fsp->fsp_name, (long int)uid, (long int)gid); -- cgit From b457b94bb86897b7020c6f300cd19a3d8e192610 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 7 Jan 2008 15:55:09 +0100 Subject: Remove redundant parameter fd from SMB_VFS_FTRUNCATE(). Michael (This used to be commit 2ad66050a0452b8e7e08b1e7a01efa00c72fd451) --- source3/modules/vfs_full_audit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (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 f7796adba0..1384c16290 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -159,7 +159,7 @@ static char *smb_full_audit_getwd(vfs_handle_struct *handle, static int smb_full_audit_ntimes(vfs_handle_struct *handle, const char *path, const struct timespec ts[2]); static int smb_full_audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp, - int fd, SMB_OFF_T len); + SMB_OFF_T len); static bool smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type); static int smb_full_audit_kernel_flock(struct vfs_handle_struct *handle, @@ -1353,11 +1353,11 @@ static int smb_full_audit_ntimes(vfs_handle_struct *handle, } static int smb_full_audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp, - int fd, SMB_OFF_T len) + SMB_OFF_T len) { int result; - result = SMB_VFS_NEXT_FTRUNCATE(handle, fsp, fd, len); + result = SMB_VFS_NEXT_FTRUNCATE(handle, fsp, len); do_log(SMB_VFS_OP_FTRUNCATE, (result >= 0), handle, "%s", fsp->fsp_name); -- cgit From edd30e716fb5133b269ef82358e95d187a107870 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 7 Jan 2008 16:38:23 +0100 Subject: Remove redundant parameter fd from SMB_VFS_LOCK(). Michael (This used to be commit 4f3ab2c406072e0b43581057e7e785e8ad454cfa) --- source3/modules/vfs_full_audit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (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 1384c16290..13f442485f 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -160,7 +160,7 @@ static int smb_full_audit_ntimes(vfs_handle_struct *handle, const char *path, const struct timespec ts[2]); static int smb_full_audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T len); -static bool smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, +static bool smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type); static int smb_full_audit_kernel_flock(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, @@ -1365,12 +1365,12 @@ static int smb_full_audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp return result; } -static bool smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, +static bool smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type) { bool result; - result = SMB_VFS_NEXT_LOCK(handle, fsp, fd, op, offset, count, type); + result = SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type); do_log(SMB_VFS_OP_LOCK, result, handle, "%s", fsp->fsp_name); -- cgit From 327cc04da587fa54f28dafb00267fde79b858349 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 7 Jan 2008 17:14:20 +0100 Subject: Remove redundant parameter fd from SMB_VFS_KERNEL_FLOCK(). Michael (This used to be commit 195c519377c2fdc655e25760b52bc0694b8dda81) --- source3/modules/vfs_full_audit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (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 13f442485f..cc14597d97 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -163,7 +163,7 @@ static int smb_full_audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp static bool smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type); static int smb_full_audit_kernel_flock(struct vfs_handle_struct *handle, - struct files_struct *fsp, int fd, + struct files_struct *fsp, uint32 share_mode); static int smb_full_audit_linux_setlease(vfs_handle_struct *handle, files_struct *fsp, int fd, int leasetype); @@ -1378,12 +1378,12 @@ static bool smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, } static int smb_full_audit_kernel_flock(struct vfs_handle_struct *handle, - struct files_struct *fsp, int fd, + struct files_struct *fsp, uint32 share_mode) { int result; - result = SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, fd, share_mode); + result = SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode); do_log(SMB_VFS_OP_KERNEL_FLOCK, (result >= 0), handle, "%s", fsp->fsp_name); -- cgit From 26169410cd3fa90be5740a913f027802488eca8d Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 7 Jan 2008 21:47:53 +0100 Subject: Remove redundant parameter fd from SMB_VFS_LINUX_SETLEASE(). Michael (This used to be commit 8880eb82f16d561a4023ec8426f8ea35c579a7a6) --- source3/modules/vfs_full_audit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (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 cc14597d97..2f0935f4b4 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -166,7 +166,7 @@ static int smb_full_audit_kernel_flock(struct vfs_handle_struct *handle, struct files_struct *fsp, uint32 share_mode); static int smb_full_audit_linux_setlease(vfs_handle_struct *handle, files_struct *fsp, - int fd, int leasetype); + 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, @@ -1392,11 +1392,11 @@ static int smb_full_audit_kernel_flock(struct vfs_handle_struct *handle, } static int smb_full_audit_linux_setlease(vfs_handle_struct *handle, files_struct *fsp, - int fd, int leasetype) + int leasetype) { int result; - result = SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, fd, leasetype); + result = SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, leasetype); do_log(SMB_VFS_OP_LINUX_SETLEASE, (result >= 0), handle, "%s", fsp->fsp_name); -- cgit From f7bf4cb3f17b5356b93c4ec89c300ad5dc20d2bc Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 7 Jan 2008 22:18:50 +0100 Subject: Remove redundant parameter fd from SMB_VFS_GETLOCK(). Michael (This used to be commit ee5a20becdcdb20d7012732b324c6938fab44f67) --- source3/modules/vfs_full_audit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (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 2f0935f4b4..54433347b8 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -167,7 +167,7 @@ static int smb_full_audit_kernel_flock(struct vfs_handle_struct *handle, uint32 share_mode); static int smb_full_audit_linux_setlease(vfs_handle_struct *handle, files_struct *fsp, int leasetype); -static bool smb_full_audit_getlock(vfs_handle_struct *handle, files_struct *fsp, int fd, +static bool smb_full_audit_getlock(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid); static int smb_full_audit_symlink(vfs_handle_struct *handle, const char *oldpath, const char *newpath); @@ -1404,12 +1404,12 @@ static int smb_full_audit_linux_setlease(vfs_handle_struct *handle, files_struct return result; } -static bool smb_full_audit_getlock(vfs_handle_struct *handle, files_struct *fsp, int fd, +static bool smb_full_audit_getlock(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid) { bool result; - result = SMB_VFS_NEXT_GETLOCK(handle, fsp, fd, poffset, pcount, ptype, ppid); + result = SMB_VFS_NEXT_GETLOCK(handle, fsp, poffset, pcount, ptype, ppid); do_log(SMB_VFS_OP_GETLOCK, result, handle, "%s", fsp->fsp_name); -- cgit From 62e9d503d82d645cf29af643732ad97c0eb8b340 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 7 Jan 2008 23:53:34 +0100 Subject: Remove redundant parameter fd from SMB_VFS_SYS_ACL_GET_FD(). Michael (This used to be commit 42663e8736e1a3dfb57e0aafdcbf5fec880da779) --- source3/modules/vfs_full_audit.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (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 54433347b8..d572c155e2 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -221,8 +221,7 @@ static SMB_ACL_T smb_full_audit_sys_acl_get_file(vfs_handle_struct *handle, const char *path_p, SMB_ACL_TYPE_T type); static SMB_ACL_T smb_full_audit_sys_acl_get_fd(vfs_handle_struct *handle, - files_struct *fsp, - int fd); + files_struct *fsp); static int smb_full_audit_sys_acl_clear_perms(vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset); static int smb_full_audit_sys_acl_add_perm(vfs_handle_struct *handle, @@ -451,7 +450,7 @@ static vfs_op_tuple audit_op_tuples[] = { SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_sys_acl_get_file), SMB_VFS_OP_SYS_ACL_GET_FILE, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_sys_acl_get_fd), SMB_VFS_OP_SYS_ACL_GET_FD, +{SMB_VFS_OP(smb_full_audit_sys_acl_get_fd), SMB_VFS_OP_SYS_ACL_GET_FD, SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_sys_acl_clear_perms), SMB_VFS_OP_SYS_ACL_CLEAR_PERMS, SMB_VFS_LAYER_LOGGER}, @@ -1684,11 +1683,11 @@ static SMB_ACL_T smb_full_audit_sys_acl_get_file(vfs_handle_struct *handle, } static SMB_ACL_T smb_full_audit_sys_acl_get_fd(vfs_handle_struct *handle, - files_struct *fsp, int fd) + files_struct *fsp) { SMB_ACL_T result; - result = SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp, fd); + result = SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp); do_log(SMB_VFS_OP_SYS_ACL_GET_FD, (result != NULL), handle, "%s", fsp->fsp_name); -- cgit From b2182c11eab0e1b2f0acb5d82aec86d4598573eb Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 8 Jan 2008 01:14:24 +0100 Subject: Remove redundant parameter fd from SMB_VFS_FCHMOD_ACL(). Michael (This used to be commit 7b201c177b3668f54751ba17d6a0b53ed913e7f7) --- source3/modules/vfs_full_audit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (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 d572c155e2..4e70879dc2 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -205,7 +205,7 @@ static NTSTATUS smb_full_audit_set_nt_acl(vfs_handle_struct *handle, files_struc static int smb_full_audit_chmod_acl(vfs_handle_struct *handle, const char *path, mode_t mode); static int smb_full_audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, - int fd, mode_t mode); + mode_t mode); static int smb_full_audit_sys_acl_get_entry(vfs_handle_struct *handle, SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p); @@ -1594,11 +1594,11 @@ static int smb_full_audit_chmod_acl(vfs_handle_struct *handle, } static int smb_full_audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, - int fd, mode_t mode) + mode_t mode) { int result; - result = SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, fd, mode); + result = SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode); do_log(SMB_VFS_OP_FCHMOD_ACL, (result >= 0), handle, "%s|%o", fsp->fsp_name, mode); -- cgit From 5921607f2647cec20a6bcebd17c5a0c53449c1ba Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 8 Jan 2008 01:54:19 +0100 Subject: Remove redundant parameter fd from SMB_VFS_SYS_ACL_SET_FD(). Michael (This used to be commit 9296e93588c0e795cae770765050247ac1474a74) --- source3/modules/vfs_full_audit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (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 4e70879dc2..64c74df1ba 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -250,7 +250,7 @@ static int smb_full_audit_sys_acl_set_file(vfs_handle_struct *handle, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl); static int smb_full_audit_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, - int fd, SMB_ACL_T theacl); + SMB_ACL_T theacl); static int smb_full_audit_sys_acl_delete_def_file(vfs_handle_struct *handle, const char *path); static int smb_full_audit_sys_acl_get_perm(vfs_handle_struct *handle, @@ -1843,11 +1843,11 @@ static int smb_full_audit_sys_acl_set_file(vfs_handle_struct *handle, } static int smb_full_audit_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, - int fd, SMB_ACL_T theacl) + SMB_ACL_T theacl) { int result; - result = SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, fd, theacl); + result = SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl); do_log(SMB_VFS_OP_SYS_ACL_SET_FD, (result >= 0), handle, "%s", fsp->fsp_name); -- cgit From 50ee744fa445b74136a8f2cef36c2b48ba7ee5f6 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 8 Jan 2008 10:00:47 +0100 Subject: Remove redundant parameter fd from SMB_VFS_FGETXATTR(). Michael (This used to be commit 2cb739a82dc6bb194d60718cc74b26ee7c1c46a7) --- source3/modules/vfs_full_audit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (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 64c74df1ba..82e212ed0a 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -270,7 +270,7 @@ static ssize_t smb_full_audit_lgetxattr(struct vfs_handle_struct *handle, const char *path, const char *name, void *value, size_t size); static ssize_t smb_full_audit_fgetxattr(struct vfs_handle_struct *handle, - struct files_struct *fsp, int fd, + struct files_struct *fsp, const char *name, void *value, size_t size); static ssize_t smb_full_audit_listxattr(struct vfs_handle_struct *handle, const char *path, char *list, size_t size); @@ -1956,12 +1956,12 @@ static ssize_t smb_full_audit_lgetxattr(struct vfs_handle_struct *handle, } static ssize_t smb_full_audit_fgetxattr(struct vfs_handle_struct *handle, - struct files_struct *fsp, int fd, + struct files_struct *fsp, const char *name, void *value, size_t size) { ssize_t result; - result = SMB_VFS_NEXT_FGETXATTR(handle, fsp, fd, name, value, size); + result = SMB_VFS_NEXT_FGETXATTR(handle, fsp, name, value, size); do_log(SMB_VFS_OP_FGETXATTR, (result >= 0), handle, "%s|%s", fsp->fsp_name, name); -- cgit From 9f691df852581b1ae4fab7cb9907606f4dcab291 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 8 Jan 2008 10:51:40 +0100 Subject: Remove redundant parameter fd from SMB_VFS_FLISTXATTR(). Michael (This used to be commit 167649b3b8bc293f8434ffc9fb5f80463e4e75be) --- source3/modules/vfs_full_audit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (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 82e212ed0a..ecf136347c 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -277,7 +277,7 @@ static ssize_t smb_full_audit_listxattr(struct vfs_handle_struct *handle, static ssize_t smb_full_audit_llistxattr(struct vfs_handle_struct *handle, const char *path, char *list, size_t size); static ssize_t smb_full_audit_flistxattr(struct vfs_handle_struct *handle, - struct files_struct *fsp, int fd, char *list, + struct files_struct *fsp, char *list, size_t size); static int smb_full_audit_removexattr(struct vfs_handle_struct *handle, const char *path, @@ -1994,12 +1994,12 @@ static ssize_t smb_full_audit_llistxattr(struct vfs_handle_struct *handle, } static ssize_t smb_full_audit_flistxattr(struct vfs_handle_struct *handle, - struct files_struct *fsp, int fd, char *list, + struct files_struct *fsp, char *list, size_t size) { ssize_t result; - result = SMB_VFS_NEXT_FLISTXATTR(handle, fsp, fd, list, size); + result = SMB_VFS_NEXT_FLISTXATTR(handle, fsp, list, size); do_log(SMB_VFS_OP_FLISTXATTR, (result >= 0), handle, "%s", fsp->fsp_name); -- cgit From 1590dd32cfccd9ce73cd798330b5207bcc48bfaf Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 8 Jan 2008 11:29:09 +0100 Subject: Remove redundant parameter fd from SMB_VFS_FREMOVEXATTR(). Michael (This used to be commit bfc3b5a27f707d3e4b8d5d66192891e22365fbb3) --- source3/modules/vfs_full_audit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (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 ecf136347c..6517c17256 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -286,7 +286,7 @@ static int smb_full_audit_lremovexattr(struct vfs_handle_struct *handle, const char *path, const char *name); static int smb_full_audit_fremovexattr(struct vfs_handle_struct *handle, - struct files_struct *fsp, int fd, + struct files_struct *fsp, const char *name); static int smb_full_audit_setxattr(struct vfs_handle_struct *handle, const char *path, @@ -2036,12 +2036,12 @@ static int smb_full_audit_lremovexattr(struct vfs_handle_struct *handle, } static int smb_full_audit_fremovexattr(struct vfs_handle_struct *handle, - struct files_struct *fsp, int fd, + struct files_struct *fsp, const char *name) { int result; - result = SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, fd, name); + result = SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, name); do_log(SMB_VFS_OP_FREMOVEXATTR, (result >= 0), handle, "%s|%s", fsp->fsp_name, name); -- cgit From aab6704ce803a738ba125895b20a31f242fe2885 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 8 Jan 2008 11:47:33 +0100 Subject: Remove redundant parameter fd from SMB_VFS_FSETXATTR(). Michael (This used to be commit 0bd2643463a9160c8a1c7e1c2f8cca7b89060e09) --- source3/modules/vfs_full_audit.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (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 6517c17256..ffa2c52da1 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -297,7 +297,7 @@ static int smb_full_audit_lsetxattr(struct vfs_handle_struct *handle, const char *name, const void *value, size_t size, int flags); static int smb_full_audit_fsetxattr(struct vfs_handle_struct *handle, - struct files_struct *fsp, int fd, const char *name, + struct files_struct *fsp, const char *name, const void *value, size_t size, int flags); static int smb_full_audit_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); @@ -2082,13 +2082,12 @@ static int smb_full_audit_lsetxattr(struct vfs_handle_struct *handle, } static int smb_full_audit_fsetxattr(struct vfs_handle_struct *handle, - struct files_struct *fsp, int fd, const char *name, + struct files_struct *fsp, const char *name, const void *value, size_t size, int flags) { int result; - result = SMB_VFS_NEXT_FSETXATTR(handle, fsp, fd, name, value, size, - flags); + result = SMB_VFS_NEXT_FSETXATTR(handle, fsp, name, value, size, flags); do_log(SMB_VFS_OP_FSETXATTR, (result >= 0), handle, "%s|%s", fsp->fsp_name, name); -- cgit From 4a056e127ac35d640d899cd8a4735b927aa8d005 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 8 Jan 2008 12:20:51 +0100 Subject: Remove redundant parameter fd from SMB_VFS_AIO_CANCEL(). Michael (This used to be commit 3c997ae0002d4c50e8899600c17ddf74ac61f6f0) --- source3/modules/vfs_full_audit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (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 ffa2c52da1..95fdc17d56 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -303,7 +303,7 @@ static int smb_full_audit_fsetxattr(struct vfs_handle_struct *handle, static int smb_full_audit_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); static int smb_full_audit_aio_write(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); static ssize_t smb_full_audit_aio_return(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); -static int smb_full_audit_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_STRUCT_AIOCB *aiocb); +static int smb_full_audit_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); static int smb_full_audit_aio_error(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); static int smb_full_audit_aio_fsync(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb); static int smb_full_audit_aio_suspend(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_AIOCB * const aiocb[], int n, const struct timespec *ts); @@ -2128,11 +2128,11 @@ static ssize_t smb_full_audit_aio_return(struct vfs_handle_struct *handle, struc return result; } -static int smb_full_audit_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_STRUCT_AIOCB *aiocb) +static int smb_full_audit_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb) { int result; - result = SMB_VFS_NEXT_AIO_CANCEL(handle, fsp, fd, aiocb); + result = SMB_VFS_NEXT_AIO_CANCEL(handle, fsp, aiocb); do_log(SMB_VFS_OP_AIO_CANCEL, (result >= 0), handle, "%s", fsp->fsp_name); -- cgit From 1d66f4d58b5fdd9c4e0c022cd2724e05d144510b Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 10 Jan 2008 15:33:51 +0100 Subject: Remove redundant parameter fd from SMB_VFS_READ(). Michael (This used to be commit a8fc2ddad8d5f7c6c00cb36c74a32a02d69d1d04) --- source3/modules/vfs_full_audit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (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 95fdc17d56..18ee5ba50f 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -113,7 +113,7 @@ static int smb_full_audit_open(vfs_handle_struct *handle, const char *fname, files_struct *fsp, int flags, mode_t mode); static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp, int fd); static ssize_t smb_full_audit_read(vfs_handle_struct *handle, files_struct *fsp, - int fd, void *data, size_t n); + void *data, size_t n); static ssize_t smb_full_audit_pread(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n, SMB_OFF_T offset); static ssize_t smb_full_audit_write(vfs_handle_struct *handle, files_struct *fsp, @@ -1087,11 +1087,11 @@ static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp, in } static ssize_t smb_full_audit_read(vfs_handle_struct *handle, files_struct *fsp, - int fd, void *data, size_t n) + void *data, size_t n) { ssize_t result; - result = SMB_VFS_NEXT_READ(handle, fsp, fd, data, n); + result = SMB_VFS_NEXT_READ(handle, fsp, data, n); do_log(SMB_VFS_OP_READ, (result >= 0), handle, "%s", fsp->fsp_name); -- cgit From e9a3a62e7448bef72d9c17c90ff2b404082f067c Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 10 Jan 2008 15:49:35 +0100 Subject: Remove redundant parameter fd from SMB_VFS_WRITE(). Michael (This used to be commit c8ae7d095a2a6a7eac920a68ca7244e3a423e1b1) --- source3/modules/vfs_full_audit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (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 18ee5ba50f..00512678b1 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -117,7 +117,7 @@ static ssize_t smb_full_audit_read(vfs_handle_struct *handle, files_struct *fsp, static ssize_t smb_full_audit_pread(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n, SMB_OFF_T offset); static ssize_t smb_full_audit_write(vfs_handle_struct *handle, files_struct *fsp, - int fd, const void *data, size_t n); + const void *data, size_t n); static ssize_t smb_full_audit_pwrite(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset); @@ -1111,11 +1111,11 @@ static ssize_t smb_full_audit_pread(vfs_handle_struct *handle, files_struct *fsp } static ssize_t smb_full_audit_write(vfs_handle_struct *handle, files_struct *fsp, - int fd, const void *data, size_t n) + const void *data, size_t n) { ssize_t result; - result = SMB_VFS_NEXT_WRITE(handle, fsp, fd, data, n); + result = SMB_VFS_NEXT_WRITE(handle, fsp, data, n); do_log(SMB_VFS_OP_WRITE, (result >= 0), handle, "%s", fsp->fsp_name); -- cgit From 4caab9ca25e1163378714de825d835e79e27dd4f Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 11 Jan 2008 00:51:19 +0100 Subject: Combine fsp and fromfd to fromfsp in SMB_VFS_SENDFILE(). Michael (This used to be commit a52cfb7d777157c93c9dc26c67f457be592dd537) --- source3/modules/vfs_full_audit.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (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 00512678b1..baa5d24a33 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -124,7 +124,7 @@ static ssize_t smb_full_audit_pwrite(vfs_handle_struct *handle, files_struct *fs static SMB_OFF_T smb_full_audit_lseek(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset, int whence); static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd, - files_struct *fsp, int fromfd, + files_struct *fromfsp, const DATA_BLOB *hdr, SMB_OFF_T offset, size_t n); static ssize_t smb_full_audit_recvfile(vfs_handle_struct *handle, int fromfd, @@ -1149,17 +1149,16 @@ static SMB_OFF_T smb_full_audit_lseek(vfs_handle_struct *handle, files_struct *f } static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd, - files_struct *fsp, int fromfd, + files_struct *fromfsp, const DATA_BLOB *hdr, SMB_OFF_T offset, size_t n) { ssize_t result; - result = SMB_VFS_NEXT_SENDFILE(handle, tofd, fsp, fromfd, hdr, - offset, n); + result = SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, hdr, offset, n); do_log(SMB_VFS_OP_SENDFILE, (result >= 0), handle, - "%s", fsp->fsp_name); + "%s", fromfsp->fsp_name); return result; } -- cgit From fef9cf00e1e110ff5872f1c368d080fe4f7939d6 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 11 Jan 2008 01:26:54 +0100 Subject: Combine fsp and tofd to tofsp in SMB_VFS_RECVFILE(). Michael (This used to be commit 3958abffaf2866c69ad9e13ec345364fde5c78bb) --- source3/modules/vfs_full_audit.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (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 baa5d24a33..5aa9bab5b5 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -128,7 +128,7 @@ static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd, const DATA_BLOB *hdr, SMB_OFF_T offset, size_t n); static ssize_t smb_full_audit_recvfile(vfs_handle_struct *handle, int fromfd, - files_struct *fsp, int tofd, + files_struct *tofsp, SMB_OFF_T offset, size_t n); static int smb_full_audit_rename(vfs_handle_struct *handle, @@ -1164,17 +1164,16 @@ static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd, } static ssize_t smb_full_audit_recvfile(vfs_handle_struct *handle, int fromfd, - files_struct *fsp, int tofd, + files_struct *tofsp, SMB_OFF_T offset, size_t n) { ssize_t result; - result = SMB_VFS_NEXT_RECVFILE(handle, fromfd, fsp, tofd, - offset, n); + result = SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, n); do_log(SMB_VFS_OP_RECVFILE, (result >= 0), handle, - "%s", fsp->fsp_name); + "%s", tofsp->fsp_name); return result; } -- cgit From 296bbc3c9f5b13bc1d3639e104b7fab307b8f184 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 21 Mar 2008 10:20:53 +0100 Subject: Fix Coverity IDs 553, 552 (This used to be commit 1a0aed566b7e4fc75bf894aac6828bfa4152c3dc) --- source3/modules/vfs_full_audit.c | 4 ++++ 1 file changed, 4 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 5aa9bab5b5..6a8861361c 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -546,6 +546,7 @@ static struct { { SMB_VFS_OP_SET_QUOTA, "set_quota" }, { SMB_VFS_OP_GET_SHADOW_COPY_DATA, "get_shadow_copy_data" }, { SMB_VFS_OP_STATVFS, "statvfs" }, + { SMB_VFS_OP_FS_CAPABILITIES, "fs_capabilities" }, { SMB_VFS_OP_OPENDIR, "opendir" }, { SMB_VFS_OP_READDIR, "readdir" }, { SMB_VFS_OP_SEEKDIR, "seekdir" }, @@ -636,6 +637,9 @@ static struct { { SMB_VFS_OP_AIO_ERROR, "aio_error" }, { SMB_VFS_OP_AIO_FSYNC, "aio_fsync" }, { SMB_VFS_OP_AIO_SUSPEND,"aio_suspend" }, + { SMB_VFS_OP_AIO_FORCE, "aio_force" }, + { SMB_VFS_OP_IS_OFFLINE, "aio_is_offline" }, + { SMB_VFS_OP_SET_OFFLINE, "aio_set_offline" }, { SMB_VFS_OP_LAST, NULL } }; -- cgit From 20caa9bbe64e231c37f11e6781def3410338a7f2 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 23 Mar 2008 17:50:55 +0100 Subject: Fix Coverity ID 450 (This used to be commit 700cceb6940c95997cfef374cffd50729a35528a) --- source3/modules/vfs_full_audit.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (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 6a8861361c..19218cc47d 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -679,7 +679,11 @@ static int audit_syslog_priority(vfs_handle_struct *handle) int priority; - priority = lp_parm_enum(SNUM(handle->conn), "full_audit", "priority", enum_log_priorities, LOG_NOTICE); + priority = lp_parm_enum(SNUM(handle->conn), "full_audit", "priority", + enum_log_priorities, LOG_NOTICE); + if (priority == -1) { + priority = LOG_WARNING; + } return priority; } -- cgit From 0db7aba8af80a01150d1061a4192ab814e4234b7 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 11 Jan 2008 14:19:28 +0100 Subject: Remove redundant parameter fd from SMB_VFS_CLOSE(). Now all those redundant fd's have vanished from the VFS API. Michael (This used to be commit 14294535512a7f191c5008e622b6708e417854ae) --- source3/modules/vfs_full_audit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (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 19218cc47d..2f8098de9b 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -111,7 +111,7 @@ static int smb_full_audit_closedir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp); static int smb_full_audit_open(vfs_handle_struct *handle, const char *fname, files_struct *fsp, int flags, mode_t mode); -static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp, int fd); +static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp); static ssize_t smb_full_audit_read(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n); static ssize_t smb_full_audit_pread(vfs_handle_struct *handle, files_struct *fsp, @@ -1083,11 +1083,11 @@ static int smb_full_audit_open(vfs_handle_struct *handle, return result; } -static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp, int fd) +static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp) { int result; - result = SMB_VFS_NEXT_CLOSE(handle, fsp, fd); + result = SMB_VFS_NEXT_CLOSE(handle, fsp); do_log(SMB_VFS_OP_CLOSE, (result >= 0), handle, "%s", fsp->fsp_name); -- cgit From 00b2cdf75e9bea25034440054b4acd91a179c86d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 8 May 2008 18:09:07 -0700 Subject: Yay ! Remove a VFS entry. Removed the set_nt_acl() call, this can only be done via fset_nt_acl() using an open file/directory handle. I'd like to do the same with get_nt_acl() but am concerned about efficiency problems with "hide unreadable/hide unwritable" when doing a directory listing (this would mean opening every file in the dir on list). Moving closer to rationalizing the ACL model and maybe moving the POSIX calls into a posix_acl VFS module rather than having them as first class citizens of the VFS. Jeremy. (This used to be commit f487f742cb903a06fbf2be006ddc9ce9063339ed) --- source3/modules/vfs_full_audit.c | 20 -------------------- 1 file changed, 20 deletions(-) (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 2f8098de9b..19a1d02de4 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -199,9 +199,6 @@ static NTSTATUS smb_full_audit_get_nt_acl(vfs_handle_struct *handle, files_struc static NTSTATUS smb_full_audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32 security_info_sent, SEC_DESC *psd); -static NTSTATUS smb_full_audit_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, - const char *name, uint32 security_info_sent, - SEC_DESC *psd); static int smb_full_audit_chmod_acl(vfs_handle_struct *handle, const char *path, mode_t mode); static int smb_full_audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, @@ -431,8 +428,6 @@ static vfs_op_tuple audit_op_tuples[] = { SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_fset_nt_acl), SMB_VFS_OP_FSET_NT_ACL, SMB_VFS_LAYER_LOGGER}, - {SMB_VFS_OP(smb_full_audit_set_nt_acl), SMB_VFS_OP_SET_NT_ACL, - SMB_VFS_LAYER_LOGGER}, /* POSIX ACL operations. */ @@ -593,7 +588,6 @@ static struct { { SMB_VFS_OP_FGET_NT_ACL, "fget_nt_acl" }, { SMB_VFS_OP_GET_NT_ACL, "get_nt_acl" }, { SMB_VFS_OP_FSET_NT_ACL, "fset_nt_acl" }, - { SMB_VFS_OP_SET_NT_ACL, "set_nt_acl" }, { SMB_VFS_OP_CHMOD_ACL, "chmod_acl" }, { SMB_VFS_OP_FCHMOD_ACL, "fchmod_acl" }, { SMB_VFS_OP_SYS_ACL_GET_ENTRY, "sys_acl_get_entry" }, @@ -1572,20 +1566,6 @@ static NTSTATUS smb_full_audit_fset_nt_acl(vfs_handle_struct *handle, files_stru return result; } -static NTSTATUS smb_full_audit_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, - const char *name, uint32 security_info_sent, - SEC_DESC *psd) -{ - NTSTATUS result; - - result = SMB_VFS_NEXT_SET_NT_ACL(handle, fsp, name, security_info_sent, - psd); - - do_log(SMB_VFS_OP_SET_NT_ACL, NT_STATUS_IS_OK(result), handle, "%s", fsp->fsp_name); - - return result; -} - static int smb_full_audit_chmod_acl(vfs_handle_struct *handle, const char *path, mode_t mode) { -- cgit From 53a623d8a69b5dd7fbd964013032878e09032375 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 8 May 2008 15:53:55 +0200 Subject: Remove the unix token info from connection_struct (This used to be commit 2834dacc8d49f77fe55fb5d7e3eb2dda431d1d3d) --- source3/modules/vfs_full_audit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (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 19a1d02de4..1b44e02375 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -694,7 +694,8 @@ static char *audit_prefix(TALLOC_CTX *ctx, connection_struct *conn) } return talloc_sub_advanced(ctx, lp_servicename(SNUM(conn)), conn->user, - conn->connectpath, conn->gid, + conn->connectpath, + conn->server_info->gid, get_current_username(), current_user_info.domain, prefix); -- cgit From 5bda9a8af02c7889e15e580a5620689aa312a16a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 8 May 2008 16:06:42 +0200 Subject: Remove "user" from connection_struct (This used to be commit 368454a27cb53a408ec416cbf37235b304592fb5) --- source3/modules/vfs_full_audit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (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 1b44e02375..31069c1669 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -693,7 +693,8 @@ static char *audit_prefix(TALLOC_CTX *ctx, connection_struct *conn) return NULL; } return talloc_sub_advanced(ctx, - lp_servicename(SNUM(conn)), conn->user, + lp_servicename(SNUM(conn)), + conn->server_info->unix_name, conn->connectpath, conn->server_info->gid, get_current_username(), -- cgit From 50ab871813d8281760e0c70d454cba996e0b67d8 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 11 May 2008 11:26:33 +0200 Subject: Remove some references to get_current_username() and current_user_info (This used to be commit 344d69f95e217d16213eaa6b53141af6ab459708) --- source3/modules/vfs_full_audit.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (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 31069c1669..8718dbd886 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -59,8 +59,6 @@ #include "includes.h" -extern userdom_struct current_user_info; - static int vfs_full_audit_debug_level = DBGC_VFS; struct vfs_full_audit_private_data { @@ -697,8 +695,8 @@ static char *audit_prefix(TALLOC_CTX *ctx, connection_struct *conn) conn->server_info->unix_name, conn->connectpath, conn->server_info->gid, - get_current_username(), - current_user_info.domain, + conn->server_info->sanitized_username, + pdb_get_domain(conn->server_info->sam_account), prefix); } -- cgit From d1e0c7f0c1a62030e08fd3ae00ec8ed07c79aa72 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 7 Jun 2008 09:04:03 +0200 Subject: Add STREAMINFO op to vfs_full_audit Fix Coverity ID 552 and 553 (This used to be commit c46e10d2605b22d31675976e62e5ae61d73c8a0a) --- source3/modules/vfs_full_audit.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 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 8718dbd886..3005de3829 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -188,6 +188,12 @@ static int smb_full_audit_chflags(vfs_handle_struct *handle, const char *path, unsigned int flags); static struct file_id smb_full_audit_file_id_create(struct vfs_handle_struct *handle, SMB_DEV_T dev, SMB_INO_T inode); +static NTSTATUS smb_full_audit_streaminfo(vfs_handle_struct *handle, + struct files_struct *fsp, + const char *fname, + TALLOC_CTX *mem_ctx, + unsigned int *pnum_streams, + struct stream_struct **pstreams); static NTSTATUS smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32 security_info, SEC_DESC **ppdesc); @@ -417,6 +423,8 @@ static vfs_op_tuple audit_op_tuples[] = { SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_file_id_create), SMB_VFS_OP_FILE_ID_CREATE, SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(smb_full_audit_streaminfo), SMB_VFS_OP_STREAMINFO, + SMB_VFS_LAYER_LOGGER}, /* NT ACL operations. */ @@ -583,6 +591,7 @@ static struct { { SMB_VFS_OP_NOTIFY_WATCH, "notify_watch" }, { SMB_VFS_OP_CHFLAGS, "chflags" }, { SMB_VFS_OP_FILE_ID_CREATE, "file_id_create" }, + { SMB_VFS_OP_STREAMINFO, "streaminfo" }, { SMB_VFS_OP_FGET_NT_ACL, "fget_nt_acl" }, { SMB_VFS_OP_GET_NT_ACL, "get_nt_acl" }, { SMB_VFS_OP_FSET_NT_ACL, "fset_nt_acl" }, @@ -1523,6 +1532,24 @@ static struct file_id smb_full_audit_file_id_create(struct vfs_handle_struct *ha return result; } +static NTSTATUS smb_full_audit_streaminfo(vfs_handle_struct *handle, + struct files_struct *fsp, + const char *fname, + TALLOC_CTX *mem_ctx, + unsigned int *pnum_streams, + struct stream_struct **pstreams) +{ + NTSTATUS result; + + result = SMB_VFS_NEXT_STREAMINFO(handle, fsp, fname, mem_ctx, + pnum_streams, pstreams); + + do_log(SMB_VFS_OP_STREAMINFO, NT_STATUS_IS_OK(result), handle, + "%s", fname); + + return result; +} + static NTSTATUS smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32 security_info, SEC_DESC **ppdesc) -- cgit From 40f5eab5eb515937e1b23cf6762b77c194d29b9d Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 19 Jun 2008 16:54:12 +0200 Subject: Wrap the unix token info in a unix_user_token in auth_serversupplied_info No functional change, this is a preparation for more current_user ref removal (This used to be commit dcaedf345e62ab74ea87f0a3fa1e3199c75c5445) --- source3/modules/vfs_full_audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 3005de3829..3cefbcda34 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -703,7 +703,7 @@ static char *audit_prefix(TALLOC_CTX *ctx, connection_struct *conn) lp_servicename(SNUM(conn)), conn->server_info->unix_name, conn->connectpath, - conn->server_info->gid, + conn->server_info->utok.gid, conn->server_info->sanitized_username, pdb_get_domain(conn->server_info->sam_account), prefix); -- cgit From 878766c6a8677d174ee20d4d6b4ed87d903b4779 Mon Sep 17 00:00:00 2001 From: Lars Müller Date: Fri, 4 Jul 2008 14:51:01 +0200 Subject: Add SMB_VFS_OP_RECVFILE to get it in sync with vfs.h Fix "vfs_full_audit.c: name table not in sync with vfs.h" panic reported by Franz Sirl. (This used to be commit 72b96b75a4a1b523540a24fb758b1965ad66009b) --- source3/modules/vfs_full_audit.c | 1 + 1 file changed, 1 insertion(+) (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 3cefbcda34..6aa47aff9b 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -564,6 +564,7 @@ static struct { { SMB_VFS_OP_PWRITE, "pwrite" }, { SMB_VFS_OP_LSEEK, "lseek" }, { SMB_VFS_OP_SENDFILE, "sendfile" }, + { SMB_VFS_OP_RECVFILE, "recvfile" }, { SMB_VFS_OP_RENAME, "rename" }, { SMB_VFS_OP_FSYNC, "fsync" }, { SMB_VFS_OP_STAT, "stat" }, -- cgit From 9253044276fdf44bae2db2e232a47b229ebb0055 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 14 Aug 2008 10:58:50 -0700 Subject: Fix bug #5692 - Core dump in full_audit.so. There were some function mismatches in the various GET_NT_ACL modules (some places the fsp parameter has not been removed). Jeremy. (This used to be commit 221cc5e21eb27cdad51f34ec6832467a7bd89213) --- source3/modules/vfs_full_audit.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (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 6aa47aff9b..1224ec3edb 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -197,7 +197,7 @@ static NTSTATUS smb_full_audit_streaminfo(vfs_handle_struct *handle, static NTSTATUS smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32 security_info, SEC_DESC **ppdesc); -static NTSTATUS smb_full_audit_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, +static NTSTATUS smb_full_audit_get_nt_acl(vfs_handle_struct *handle, const char *name, uint32 security_info, SEC_DESC **ppdesc); static NTSTATUS smb_full_audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, @@ -1566,7 +1566,6 @@ static NTSTATUS smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_stru } static NTSTATUS smb_full_audit_get_nt_acl(vfs_handle_struct *handle, - files_struct *fsp, const char *name, uint32 security_info, SEC_DESC **ppdesc) @@ -1576,7 +1575,7 @@ static NTSTATUS smb_full_audit_get_nt_acl(vfs_handle_struct *handle, result = SMB_VFS_NEXT_GET_NT_ACL(handle, name, security_info, ppdesc); do_log(SMB_VFS_OP_GET_NT_ACL, NT_STATUS_IS_OK(result), handle, - "%s", fsp->fsp_name); + "%s", name); return result; } -- cgit