Exemplo n.º 1
0
static int audit_rename(vfs_handle_struct *handle,
			const struct smb_filename *smb_fname_src,
			const struct smb_filename *smb_fname_dst)
{
	int result;

	result = SMB_VFS_NEXT_RENAME(handle, smb_fname_src, smb_fname_dst);

	syslog(audit_syslog_priority(handle), "rename %s -> %s %s%s\n",
	       smb_fname_src->base_name,
	       smb_fname_dst->base_name,
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : "");

	return result;    
}
Exemplo n.º 2
0
static int audit_connect(vfs_handle_struct *handle, const char *svc, const char *user)
{
	int result;

	result = SMB_VFS_NEXT_CONNECT(handle, svc, user);
	if (result < 0) {
		return result;
	}

	openlog("smbd_audit", LOG_PID, audit_syslog_facility(handle));

	syslog(audit_syslog_priority(handle), "connect to service %s by user %s\n", 
	       svc, user);

	return 0;
}
Exemplo n.º 3
0
static int audit_open(vfs_handle_struct *handle,
		      struct smb_filename *smb_fname, files_struct *fsp,
		      int flags, mode_t mode)
{
	int result;

	result = SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);

	syslog(audit_syslog_priority(handle), "open %s (fd %d) %s%s%s\n", 
	       smb_fname->base_name, result,
	       ((flags & O_WRONLY) || (flags & O_RDWR)) ? "for writing " : "", 
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : "");

	return result;
}
Exemplo n.º 4
0
static int audit_rename(vfs_handle_struct *handle, const char *oldname, const char *newname)
{
	int result;
	
	result = SMB_VFS_NEXT_RENAME(handle, oldname, newname);

	syslog(audit_syslog_priority(handle), "rename %s -> %s %s%s\n",
	       oldname, newname,
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : "");
	DEBUG(1, ("vfs_extd_audit: rename old: %s newname: %s  %s %s\n",
	       oldname, newname,
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : ""));

	return result;    
}
Exemplo n.º 5
0
static int audit_close(vfs_handle_struct *handle, files_struct *fsp, int fd)
{
	int result;
	
	result = SMB_VFS_NEXT_CLOSE(handle, fsp, fd);

	syslog(audit_syslog_priority(handle), "close fd %d %s%s\n",
	       fd,
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : "");
	DEBUG(2, ("vfs_extd_audit: close fd %d %s %s\n",
	       fd,
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : ""));

	return result;
}
Exemplo n.º 6
0
static int audit_mkdir(vfs_handle_struct *handle, const char *path, mode_t mode)
{
	int result;
	
	result = SMB_VFS_NEXT_MKDIR(handle, path, mode);
	
	syslog(audit_syslog_priority(handle), "mkdir %s %s%s\n", 
	       path,
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : "");
	DEBUG(0, ("vfs_extd_audit: mkdir %s %s %s\n",
	       path,
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : ""));

	return result;
}
Exemplo n.º 7
0
static SMB_STRUCT_DIR *audit_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr)
{
	SMB_STRUCT_DIR *result;

	result = SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr);

	syslog(audit_syslog_priority(handle), "opendir %s %s%s\n",
	       fname,
	       (result == NULL) ? "failed: " : "",
	       (result == NULL) ? strerror(errno) : "");
	DEBUG(1, ("vfs_extd_audit: opendir %s %s %s\n",
	       fname,
	       (result == NULL) ? "failed: " : "",
	       (result == NULL) ? strerror(errno) : ""));

	return result;
}
Exemplo n.º 8
0
static int audit_unlink(vfs_handle_struct *handle, const char *path)
{
	int result;
	
	result = SMB_VFS_NEXT_UNLINK(handle, path);

	syslog(audit_syslog_priority(handle), "unlink %s %s%s\n",
	       path,
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : "");
	DEBUG(0, ("vfs_extd_audit: unlink %s %s %s\n",
	       path,
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : ""));

	return result;
}
Exemplo n.º 9
0
static int audit_chmod_acl(vfs_handle_struct *handle, const char *path, mode_t mode)
{
	int result;
	
	result = SMB_VFS_NEXT_CHMOD_ACL(handle, path, mode);

	syslog(audit_syslog_priority(handle), "chmod_acl %s mode 0x%x %s%s\n",
	       path, mode,
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : "");
	DEBUG(1, ("vfs_extd_audit: chmod_acl %s mode 0x%x %s %s\n",
	        path, mode,
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : ""));

	return result;
}
Exemplo n.º 10
0
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);

	syslog(audit_syslog_priority(handle), "fchmod_acl %s mode 0x%x %s%s\n",
	       fsp->fsp_name, mode,
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : "");
	DEBUG(1, ("vfs_extd_audit: fchmod_acl %s mode 0x%x %s %s",
	       fsp->fsp_name,  mode,
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : ""));

	return result;
}
Exemplo n.º 11
0
static int 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, fname, fsp, flags, mode);

	syslog(audit_syslog_priority(handle), "open %s (fd %d) %s%s%s\n", 
	       fname, result,
	       ((flags & O_WRONLY) || (flags & O_RDWR)) ? "for writing " : "", 
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : "");
	DEBUG(2, ("vfs_extd_audit: open %s %s %s\n",
	       fname,
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : ""));

	return result;
}
Exemplo n.º 12
0
static int audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
{
	int result;

	result = SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode);

	if (lp_syslog() > 0) {
		syslog(audit_syslog_priority(handle), "fchmod_acl %s mode 0x%x %s%s\n",
		       fsp->fsp_name->base_name, mode,
		       (result < 0) ? "failed: " : "",
		       (result < 0) ? strerror(errno) : "");
	}
	DEBUG(1, ("vfs_extd_audit: fchmod_acl %s mode 0x%x %s %s",
		fsp_str_dbg(fsp),  (unsigned int)mode,
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : ""));

	return result;
}
Exemplo n.º 13
0
static int audit_chmod(vfs_handle_struct *handle, const char *path, mode_t mode)
{
	int result;

	result = SMB_VFS_NEXT_CHMOD(handle, path, mode);

	if (lp_syslog() > 0) {
		syslog(audit_syslog_priority(handle), "chmod %s mode 0x%x %s%s\n",
		       path, mode,
		       (result < 0) ? "failed: " : "",
		       (result < 0) ? strerror(errno) : "");
	}
	DEBUG(1, ("vfs_extd_audit: chmod %s mode 0x%x %s %s\n",
	       path, (unsigned int)mode,
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : ""));

	return result;
}
Exemplo n.º 14
0
static int audit_rmdir(vfs_handle_struct *handle, const char *path)
{
	int result;

	result = SMB_VFS_NEXT_RMDIR(handle, path);

	if (lp_syslog() > 0) {
		syslog(audit_syslog_priority(handle), "rmdir %s %s%s\n",
		       path,
		       (result < 0) ? "failed: " : "",
		       (result < 0) ? strerror(errno) : "");
	}
	DEBUG(0, ("vfs_extd_audit: rmdir %s %s %s\n",
               path,
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : ""));

	return result;
}
Exemplo n.º 15
0
static int audit_unlink(vfs_handle_struct *handle,
			const struct smb_filename *smb_fname)
{
	int result;

	result = SMB_VFS_NEXT_UNLINK(handle, smb_fname);

	if (lp_syslog() > 0) {
		syslog(audit_syslog_priority(handle), "unlink %s %s%s\n",
		       smb_fname->base_name,
		       (result < 0) ? "failed: " : "",
		       (result < 0) ? strerror(errno) : "");
	}
	DEBUG(0, ("vfs_extd_audit: unlink %s %s %s\n",
	       smb_fname_str_dbg(smb_fname),
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : ""));

	return result;
}
Exemplo n.º 16
0
static int audit_chmod_acl(vfs_handle_struct *handle,
			const struct smb_filename *smb_fname,
			mode_t mode)
{
	int result;

	result = SMB_VFS_NEXT_CHMOD_ACL(handle, smb_fname, mode);

	if (lp_syslog() > 0) {
		syslog(audit_syslog_priority(handle), "chmod_acl %s mode 0x%x %s%s\n",
		       smb_fname->base_name, mode,
		       (result < 0) ? "failed: " : "",
		       (result < 0) ? strerror(errno) : "");
	}
	DEBUG(1, ("vfs_extd_audit: chmod_acl %s mode 0x%x %s %s\n",
	       smb_fname->base_name, (unsigned int)mode,
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : ""));

	return result;
}
Exemplo n.º 17
0
static int audit_mkdir(vfs_handle_struct *handle,
			const struct smb_filename *smb_fname,
			mode_t mode)
{
	int result;

	result = SMB_VFS_NEXT_MKDIR(handle, smb_fname, mode);

	if (lp_syslog() > 0) {
		syslog(audit_syslog_priority(handle), "mkdir %s %s%s\n",
		       smb_fname->base_name,
		       (result < 0) ? "failed: " : "",
		       (result < 0) ? strerror(errno) : "");
	}
	DEBUG(0, ("vfs_extd_audit: mkdir %s %s %s\n",
	       smb_fname->base_name,
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : ""));

	return result;
}
Exemplo n.º 18
0
static DIR *audit_opendir(vfs_handle_struct *handle,
			const struct smb_filename *smb_fname,
			const char *mask,
			uint32_t attr)
{
	DIR *result;

	result = SMB_VFS_NEXT_OPENDIR(handle, smb_fname, mask, attr);

	if (lp_syslog() > 0) {
		syslog(audit_syslog_priority(handle), "opendir %s %s%s\n",
		       smb_fname->base_name,
		       (result == NULL) ? "failed: " : "",
		       (result == NULL) ? strerror(errno) : "");
	}
	DEBUG(1, ("vfs_extd_audit: opendir %s %s %s\n",
	       smb_fname->base_name,
	       (result == NULL) ? "failed: " : "",
	       (result == NULL) ? strerror(errno) : ""));

	return result;
}
Exemplo n.º 19
0
static int audit_rename(vfs_handle_struct *handle,
			const struct smb_filename *smb_fname_src,
			const struct smb_filename *smb_fname_dst)
{
	int result;

	result = SMB_VFS_NEXT_RENAME(handle, smb_fname_src, smb_fname_dst);

	if (lp_syslog() > 0) {
		syslog(audit_syslog_priority(handle), "rename %s -> %s %s%s\n",
		       smb_fname_src->base_name,
		       smb_fname_dst->base_name,
		       (result < 0) ? "failed: " : "",
		       (result < 0) ? strerror(errno) : "");
	}
	DEBUG(1, ("vfs_extd_audit: rename old: %s newname: %s  %s %s\n",
		smb_fname_str_dbg(smb_fname_src),
		smb_fname_str_dbg(smb_fname_dst),
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : ""));

	return result;
}