lkml.org 
[lkml]   [2004]   [May]   [2]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
From project8sem4@fastmail ...
DateSat, 01 May 2004 21:22:19 -0700
Subjectwierd current->uid in module


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...
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:02    [from the cache]
©2003-2008