Re: How to find username who has accessed my file



On Dec 19, 11:34 am, William Pursell <bill.purs...@xxxxxxxxx> wrote:
On Dec 19, 6:13 am, Ashish Kumar <ashish.sac...@xxxxxxxxx> wrote:



Is there any wayout to find the username who has access my file in a
kernel module ?

Are you talking about a user who is running a process that
makes a call into your kernel module() to access a file?
If so, try getuid()/geteuid().

If you are talking about trying to find out who has read one
of the source files for a kernel module, I don't believe that
is in general possible.

Thanks for reply William.
user id i got simply putting current ->uid in my open call of module.
But now looking how to get username from this uid.

Regards,
Ashish
.