lkml.org 
[lkml]   [2004]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
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    [W:0.026 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site