Lines Matching refs:cred
52 * @cred: The credentials to use
65 int cap_capable(const struct cred *cred, struct user_namespace *targ_ns,
70 /* See if cred has the capability in the target user namespace
76 if (ns == cred->user_ns)
77 return cap_raised(cred->cap_effective, cap) ? 0 : -EPERM;
83 if (ns->level <= cred->user_ns->level)
90 if ((ns->parent == cred->user_ns) && uid_eq(ns->owner, cred->euid))
136 const struct cred *cred, *child_cred;
140 cred = current_cred();
143 caller_caps = &cred->cap_effective;
145 caller_caps = &cred->cap_permitted;
146 if (cred->user_ns == child_cred->user_ns &&
173 const struct cred *cred, *child_cred;
176 cred = __task_cred(parent);
178 if (cred->user_ns == child_cred->user_ns &&
179 cap_issubset(child_cred->cap_permitted, cred->cap_permitted))
202 const struct cred *cred;
206 cred = __task_cred(target);
207 *effective = cred->cap_effective;
208 *inheritable = cred->cap_inheritable;
209 *permitted = cred->cap_permitted;
241 int cap_capset(struct cred *new,
242 const struct cred *old,
554 struct cred *new = bprm->cred;
677 cap_clear(bprm->cred->cap_permitted);
707 cap_clear(bprm->cred->cap_permitted);
714 static inline bool __is_real(kuid_t uid, struct cred *cred)
715 { return uid_eq(cred->uid, uid); }
717 static inline bool __is_eff(kuid_t uid, struct cred *cred)
718 { return uid_eq(cred->euid, uid); }
720 static inline bool __is_suid(kuid_t uid, struct cred *cred)
721 { return !__is_real(uid, cred) && __is_eff(uid, cred); }
738 const struct cred *old = current_cred();
739 struct cred *new = bprm->cred;
771 #define __cap_grew(target, source, cred) \
772 !cap_issubset(cred->cap_##target, cred->cap_##source)
773 #define __cap_full(field, cred) \
774 cap_issubset(CAP_FULL_SET, cred->cap_##field)
776 static inline bool __is_setuid(struct cred *new, const struct cred *old)
779 static inline bool __is_setgid(struct cred *new, const struct cred *old)
799 static inline bool nonroot_raised_pE(struct cred *new, const struct cred *old,
827 * constructed by execve(). The proposed creds in @bprm->cred is altered,
833 const struct cred *old = current_cred();
834 struct cred *new = bprm->cred;
1020 static inline void cap_emulate_setxuid(struct cred *new, const struct cred *old)
1057 int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags)
1164 struct cred *new;
1193 const struct cred *old = current_cred();
1194 struct cred *new;