@@ -536,7 +536,7 @@ int cap_convert_nscap(struct dentry *dentry, void **ivalue, size_t size)
536536static inline int bprm_caps_from_vfs_caps (struct cpu_vfs_cap_data * caps ,
537537 struct linux_binprm * bprm ,
538538 bool * effective ,
539- bool * has_cap )
539+ bool * has_fcap )
540540{
541541 struct cred * new = bprm -> cred ;
542542 unsigned i ;
@@ -546,7 +546,7 @@ static inline int bprm_caps_from_vfs_caps(struct cpu_vfs_cap_data *caps,
546546 * effective = true;
547547
548548 if (caps -> magic_etc & VFS_CAP_REVISION_MASK )
549- * has_cap = true;
549+ * has_fcap = true;
550550
551551 CAP_FOR_EACH_U32 (i ) {
552552 __u32 permitted = caps -> permitted .cap [i ];
@@ -652,7 +652,7 @@ int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data
652652 * its xattrs and, if present, apply them to the proposed credentials being
653653 * constructed by execve().
654654 */
655- static int get_file_caps (struct linux_binprm * bprm , bool * effective , bool * has_cap )
655+ static int get_file_caps (struct linux_binprm * bprm , bool * effective , bool * has_fcap )
656656{
657657 int rc = 0 ;
658658 struct cpu_vfs_cap_data vcaps ;
@@ -683,7 +683,7 @@ static int get_file_caps(struct linux_binprm *bprm, bool *effective, bool *has_c
683683 goto out ;
684684 }
685685
686- rc = bprm_caps_from_vfs_caps (& vcaps , bprm , effective , has_cap );
686+ rc = bprm_caps_from_vfs_caps (& vcaps , bprm , effective , has_fcap );
687687 if (rc == - EINVAL )
688688 printk (KERN_NOTICE "%s: cap_from_disk returned %d for %s\n" ,
689689 __func__ , rc , bprm -> filename );
@@ -707,7 +707,7 @@ static int get_file_caps(struct linux_binprm *bprm, bool *effective, bool *has_c
707707 * set UID root and nothing is changed. If we are root, cap_permitted is
708708 * updated. If we have become set UID root, the effective bit is set.
709709 */
710- static void handle_privileged_root (struct linux_binprm * bprm , bool has_cap ,
710+ static void handle_privileged_root (struct linux_binprm * bprm , bool has_fcap ,
711711 bool * effective , kuid_t root_uid )
712712{
713713 const struct cred * old = current_cred ();
@@ -720,7 +720,7 @@ static void handle_privileged_root(struct linux_binprm *bprm, bool has_cap,
720720 * for a setuid root binary run by a non-root user. Do set it
721721 * for a root user just to cause least surprise to an admin.
722722 */
723- if (has_cap && !uid_eq (new -> uid , root_uid ) && uid_eq (new -> euid , root_uid )) {
723+ if (has_fcap && !uid_eq (new -> uid , root_uid ) && uid_eq (new -> euid , root_uid )) {
724724 warn_setuid_and_fcaps_mixed (bprm -> filename );
725725 return ;
726726 }
@@ -759,20 +759,20 @@ int cap_bprm_set_creds(struct linux_binprm *bprm)
759759{
760760 const struct cred * old = current_cred ();
761761 struct cred * new = bprm -> cred ;
762- bool effective = false, has_cap = false, is_setid ;
762+ bool effective = false, has_fcap = false, is_setid ;
763763 int ret ;
764764 kuid_t root_uid ;
765765
766766 if (WARN_ON (!cap_ambient_invariant_ok (old )))
767767 return - EPERM ;
768768
769- ret = get_file_caps (bprm , & effective , & has_cap );
769+ ret = get_file_caps (bprm , & effective , & has_fcap );
770770 if (ret < 0 )
771771 return ret ;
772772
773773 root_uid = make_kuid (new -> user_ns , 0 );
774774
775- handle_privileged_root (bprm , has_cap , & effective , root_uid );
775+ handle_privileged_root (bprm , has_fcap , & effective , root_uid );
776776
777777 /* if we have fs caps, clear dangerous personality flags */
778778 if (__cap_gained (permitted , new , old ))
@@ -802,7 +802,7 @@ int cap_bprm_set_creds(struct linux_binprm *bprm)
802802 new -> sgid = new -> fsgid = new -> egid ;
803803
804804 /* File caps or setid cancels ambient. */
805- if (has_cap || is_setid )
805+ if (has_fcap || is_setid )
806806 cap_clear (new -> cap_ambient );
807807
808808 /*
0 commit comments