Using the process defined in struct task_struct http://lxr.linux.no/linux+v2.6.30.5/include/linux/sched.h#L246 how do I get the current user? I have to check if the user is root. I apparently can't use getuid
0
votes
3 Answers
2
votes
You can use task_uid
to get the user id of the task_struct
, or task_euid
if that's what you happen to need.
0
votes
0
votes
ended up using a member variable uid_t uid, which I didn't see at first. Checked the version of linux I was using (old) and found it here: http://lxr.linux.no/linux+v2.6.18/include/linux/sched.h#L246
sorry for the trouble