* sys_geteuid() quesion
@ 2010-05-28 12:07 Rumen Bogdanovski
2010-05-28 12:44 ` Andreas Schwab
0 siblings, 1 reply; 2+ messages in thread
From: Rumen Bogdanovski @ 2010-05-28 12:07 UTC (permalink / raw)
To: linux-kernel
Hi all,
I have a simple question:
I need to make a kernel module for a specific character device.
But I need to know which uid is reading and writing because the
data written and data read should be user specific. So will
sys_geteuid() do the job for me. Or simply how can I a
module know who is calling its read or write?
Thank you in advance.
Rumen
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: sys_geteuid() quesion
2010-05-28 12:07 sys_geteuid() quesion Rumen Bogdanovski
@ 2010-05-28 12:44 ` Andreas Schwab
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Schwab @ 2010-05-28 12:44 UTC (permalink / raw)
To: Rumen Bogdanovski; +Cc: linux-kernel
Rumen Bogdanovski <rbogdanovski@gmail.com> writes:
> Or simply how can I a module know who is calling its read or write?
The current task is always (except in interrupt context) available in
current, and its euid is returned by current_euid().
Andreas.
--
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-05-28 12:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-28 12:07 sys_geteuid() quesion Rumen Bogdanovski
2010-05-28 12:44 ` Andreas Schwab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®