[PATCH 6/6] file capabilities: remove needless (?) bprm_clear_caps calls

From: Serge E. Hallyn
Date: Fri Sep 26 2008 - 22:29:59 EST


Two error conditions at the top of get_file_caps() call
bprm_clear_caps(). However, the bprm capabilities have not
yet been set at this point.

Remove those calls (saving another 16 bytes on vmlinux).

Signed-off-by: Serge E. Hallyn <serue@xxxxxxxxxx>
---
security/commoncap.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/security/commoncap.c b/security/commoncap.c
index e5afb7c..43bba7a 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -250,15 +250,11 @@ static int get_file_caps(struct linux_binprm *bprm)
struct vfs_cap_data vcaps;
struct inode *inode;

- if (!file_caps_enabled) {
- bprm_clear_caps(bprm);
+ if (!file_caps_enabled)
return 0;
- }

- if (bprm->file->f_vfsmnt->mnt_flags & MNT_NOSUID) {
- bprm_clear_caps(bprm);
+ if (bprm->file->f_vfsmnt->mnt_flags & MNT_NOSUID)
return 0;
- }

dentry = dget(bprm->file->f_dentry);
inode = dentry->d_inode;
--
1.5.1.1.GIT

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/