LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 08-31-2009, 01:11 PM   #1
lqu
LQ Newbie
 
Registered: Aug 2009
Posts: 15

Rep: Reputation: 0
howto get uid from kernel?


Hi all,

I'm compiling a kernel module using 2.6.30.5 (downloaded from kernel.org). I wanted to get the current process' uid and euid thru current-> uid and current->euid. But I got the error: ‘struct task_struct’ has no member named ‘uid’.

I checked SOURCE/inlucde/linux/sched.h, uid and euid are not in struct task_struct any more. How can I access them in version 2.6.30.5?

thanks in advance,
lqu
 
Old 09-01-2009, 01:01 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
The process credentials ('uid' and so on) have been moved into a credentials structure 'cred'. There is a pointer to the credentials (and real credentials) in the task_struct. The structure is defined in sys/cred.h. There were also some macros defined to hide some of the implementation details.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Effective UID and real UID Milosevic Linux - General 1 01-06-2007 03:01 PM
Effective UID and Real UID Milosevic Linux - Newbie 1 01-06-2007 10:41 AM
Changing the UID of a Physical Volume to a specific UID jambraun Linux - Newbie 2 02-09-2006 02:34 PM
FREEBSD5.3 platform: PHP setcookie() successful, but $uid = $_COOKIE['uid']; fail tclwp Programming 1 03-30-2005 08:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 07:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration