diff options
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/namei.c b/fs/namei.c index e01070d7bf58..55a131230f94 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -159,7 +159,7 @@ char * getname(const char __user * filename) | |||
159 | #ifdef CONFIG_AUDITSYSCALL | 159 | #ifdef CONFIG_AUDITSYSCALL |
160 | void putname(const char *name) | 160 | void putname(const char *name) |
161 | { | 161 | { |
162 | if (unlikely(current->audit_context)) | 162 | if (unlikely(!audit_dummy_context())) |
163 | audit_putname(name); | 163 | audit_putname(name); |
164 | else | 164 | else |
165 | __putname(name); | 165 | __putname(name); |
@@ -1125,7 +1125,7 @@ static int fastcall do_path_lookup(int dfd, const char *name, | |||
1125 | retval = link_path_walk(name, nd); | 1125 | retval = link_path_walk(name, nd); |
1126 | out: | 1126 | out: |
1127 | if (likely(retval == 0)) { | 1127 | if (likely(retval == 0)) { |
1128 | if (unlikely(current->audit_context && nd && nd->dentry && | 1128 | if (unlikely(!audit_dummy_context() && nd && nd->dentry && |
1129 | nd->dentry->d_inode)) | 1129 | nd->dentry->d_inode)) |
1130 | audit_inode(name, nd->dentry->d_inode); | 1130 | audit_inode(name, nd->dentry->d_inode); |
1131 | } | 1131 | } |
@@ -1357,7 +1357,7 @@ static int may_delete(struct inode *dir,struct dentry *victim,int isdir) | |||
1357 | return -ENOENT; | 1357 | return -ENOENT; |
1358 | 1358 | ||
1359 | BUG_ON(victim->d_parent->d_inode != dir); | 1359 | BUG_ON(victim->d_parent->d_inode != dir); |
1360 | audit_inode_child(victim->d_name.name, victim->d_inode, dir->i_ino); | 1360 | audit_inode_child(victim->d_name.name, victim->d_inode, dir); |
1361 | 1361 | ||
1362 | error = permission(dir,MAY_WRITE | MAY_EXEC, NULL); | 1362 | error = permission(dir,MAY_WRITE | MAY_EXEC, NULL); |
1363 | if (error) | 1363 | if (error) |
@@ -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; |