Fields.uidand .euidwere moved to struct cred, which is now displayed as .credin a field struct task_struct. This was done in this commit: CRED: a separate task security context from task_struct . If you look at the diff for the file include/linux/sched.h, you may notice this change:
- uid_t uid,euid,suid,fsuid;
- gid_t gid,egid,sgid,fsgid;
+ struct cred *cred;
So now instead of:
current->uid;
current->euid;
you should use:
const struct cred *cred = current_cred();
cred->uid;
cred->euid;
Please note that the function current_cred()must be used to access the field .cred, as it is an RCU pointer .
Check also check_same_owner () .
source
share