wierd current->uid in module

From: project8sem4
Date: Sat May 01 2004 - 23:23:55 EST





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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/