linux kernel - Getting a user ID and a process group ID from a task_struct and a pid_namespace -


i'm trying modify linux kernel , need user id , process group id task_struct , pid_namespace. although searched definitions in source code, couldn't find global variables or functions (maybe missing because of lack of comments in codes) access them.

is there method inside kernel space since can not use user-space functions getuid(), etc.?

you should able use task_struct->cred->uid or task_struct->real_cred->uid. being said, have not tested , cursory reading of lxr (include/linux/sched.h line 1508 , include/linux/cred.h line 127).

if want pgid, try pid_vnr(task_pgrp(task_struct)). code kernel/sys.c line 990.


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -