diff options
author | Amy Griffis <amy.griffis@hp.com> | 2006-07-13 21:16:02 +0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2006-08-03 18:50:21 +0400 |
commit | 3e2efce067cec0099f99ae59f28feda99b02b498 (patch) | |
tree | 94577cb6cb7f223319bb89a805b2d6945d42632e /fs | |
parent | 46f5960fdbf359f0c75989854bbaebc1de7a1eb4 (diff) | |
download | linux-3e2efce067cec0099f99ae59f28feda99b02b498.tar.xz |
[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')
-rw-r--r-- | fs/namei.c | 2 |
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: * It already exists. */ mutex_unlock(&dir->d_inode->i_mutex); + audit_inode_update(path.dentry->d_inode); error = -EEXIST; if (flag & O_EXCL) @@ -1669,6 +1670,7 @@ do_last: if (flag & O_NOFOLLOW) goto exit_dput; } + error = -ENOENT; if (!path.dentry->d_inode) goto exit_dput; |