aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAmy Griffis <amy.griffis@hp.com>2006-07-13 13:16:02 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2006-08-03 10:50:21 -0400
commit3e2efce067cec0099f99ae59f28feda99b02b498 (patch)
tree94577cb6cb7f223319bb89a805b2d6945d42632e /fs/namei.c
parent46f5960fdbf359f0c75989854bbaebc1de7a1eb4 (diff)
[PATCH] fix faulty inode data collection for open() with O_CREAT
When the specified path is an existing file or when it is a symlink, audit collects the wrong inode number, which causes it to miss the open() event. Adding a second hook to the open() path fixes this. Also add audit_copy_inode() to consolidate some code. Signed-off-by: Amy Griffis <amy.griffis@hp.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/namei.c b/fs/namei.c
index e01070d7bf58..47a7bad92d2a 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1659,6 +1659,7 @@ do_last:
1659 * It already exists. 1659 * It already exists.
1660 */ 1660 */
1661 mutex_unlock(&dir->d_inode->i_mutex); 1661 mutex_unlock(&dir->d_inode->i_mutex);
1662 audit_inode_update(path.dentry->d_inode);
1662 1663
1663 error = -EEXIST; 1664 error = -EEXIST;
1664 if (flag & O_EXCL) 1665 if (flag & O_EXCL)
@@ -1669,6 +1670,7 @@ do_last:
1669 if (flag & O_NOFOLLOW) 1670 if (flag & O_NOFOLLOW)
1670 goto exit_dput; 1671 goto exit_dput;
1671 } 1672 }
1673
1672 error = -ENOENT; 1674 error = -ENOENT;
1673 if (!path.dentry->d_inode) 1675 if (!path.dentry->d_inode)
1674 goto exit_dput; 1676 goto exit_dput;