Messages in this thread Patch in this message | | | From | "Serge E. Hallyn" <> | Subject | [PATCH 6/6] file capabilities: remove needless (?) bprm_clear_caps calls | Date | Fri, 26 Sep 2008 22:27:50 -0400 |
| |
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@us.ibm.com> --- 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
| |