public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* wierd current->uid in module
@ 2004-05-02  4:19 project8sem4
  0 siblings, 0 replies; 2+ messages in thread
From: project8sem4 @ 2004-05-02  4:19 UTC (permalink / raw)
  To: linux-kernel

hi
 i am doing a project on
 a very simple system call interception module.
 the module is supposed to return the  uid of the 
user who made the call to the syscall. i m trying to 
do it thus:
 
//in the kernel module
 asmlinkage long my_syscall(arg1,arg2)
 {
         sprintf(buffer, "%s%s%i", arg1,arg2,current->uid);
         //this buffer is later read.
         return original_syscall(arg1,arg2);
 }
 
the problem is that the uid returned is always -1 
whether the user is root or otherwise. 
could you suggest a way out please.
 thanx
 -kt
 

-- 
http://www.fastmail.fm - The way an email service should be

^ permalink raw reply	[flat|nested] 2+ messages in thread

* wierd current->uid in module
@ 2004-05-02  4:22 project8sem4
  0 siblings, 0 replies; 2+ messages in thread
From: project8sem4 @ 2004-05-02  4:22 UTC (permalink / raw)
  To: linux-kernel




hi 
i am new to the kernel. i am working on a simple
 system call interception module that is supposed
 to return the uid of the user who made the call.
 this i do by using current->uid.
 
a fragment of my code:
 
//in kernel module
 asmlinkage long my_mkdir(const char * filename)
 {
         sprintf(buffer,"%s,%i",filename, current->uid);
         //this buffer is later read.
         return original_mkdir( filename);
 }
 
the problem is that the current->uid value always 
turns out to be -1, whether its root or a non-root
 user.
 im using redhat 7.2 (kernel 2.4.7-10)
 can anyone please help me out..
 thanx in advance,
 kt
 

-- 
http://www.fastmail.fm - mmm... Fastmail...

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-05-02  4:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-02  4:19 wierd current->uid in module project8sem4
  -- strict thread matches above, loose matches on Subject: below --
2004-05-02  4:22 project8sem4

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox