[RFC] linux-2.6.10-auditfs-tc1.patch

David Woodhouse dwmw2 at infradead.org
Thu Jan 20 15:58:20 UTC 2005


On Thu, 2005-01-20 at 09:47 -0600, Timothy R. Chavez wrote:
> On Thu, 20 Jan 2005 13:32:27 +0000, David Woodhouse <dwmw2 at infradead.org> wrote:
> > Can we make the i_audit field in struct inode dependent on
> > CONFIG_AUDITFILESYSTEM?
> 
> Sure, I'm glad you pointed that out.

You also have to do likewise in fs/inode.c, and fs/namei.c doesn't build
with CONFIG_AUDITFILESYSTEM disabled because it uses the return value of
audit_notify_watch(). 

You don't seem to be logging the _result_ of the permission() call, or
am I missing something?

--- ./fs/inode.c~	2005-01-20 15:45:43.000000000 +0000
+++ ./fs/inode.c	2005-01-20 15:54:34.744093992 +0000
@@ -135,7 +135,9 @@ static struct inode *alloc_inode(struct 
 		inode->i_cdev = NULL;
 		inode->i_rdev = 0;
 		inode->i_security = NULL;
+#ifdef CONFIG_AUDITFILESYSTEM
 		inode->i_audit = NULL;
+#endif
 		inode->dirtied_when = 0;
 		if (security_inode_alloc(inode)) {
 			if (inode->i_sb->s_op->destroy_inode)
--- ./include/linux/fs.h~	2005-01-20 15:53:54.635065632 +0000
+++ ./include/linux/fs.h	2005-01-20 15:53:27.413077728 +0000
@@ -1,4 +1,4 @@
-##ifndef _LINUX_FS_H
+#ifndef _LINUX_FS_H
 #define _LINUX_FS_H
 
 /*
@@ -451,7 +451,9 @@ struct inode {
 #ifdef CONFIG_QUOTA
 	struct dquot		*i_dquot[MAXQUOTAS];
 #endif
+#ifdef CONFIG_AUDITFILESYSTEM
 	struct audit_data	*i_audit;
+#endif
 	/* These three should probably be a union */
 	struct list_head	i_devices;
 	struct pipe_inode_info	*i_pipe;
--- ./include/linux/audit.h~	2005-01-20 15:45:43.000000000 +0000
+++ ./include/linux/audit.h	2005-01-20 15:49:20.346091408 +0000
@@ -188,7 +188,7 @@ extern int audit_notify_watch(struct tas
 #define audit_putname(n) do { ; } while (0)
 #define audit_inode(n,i,d) do { ; } while (0)
 #define audit_get_loginuid(c) ({ -1; })
-#define audit_notify_watch(t,i,m) do { ; } while(0)
+#define audit_notify_watch(t,i,m) ({ 0; })
 #endif
 
 #ifdef CONFIG_AUDITFILESYSTEM


-- 
dwmw2




More information about the Linux-audit mailing list