Re: UIDs and GIDs in struct task_struct

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Onkar,


On Wed, Jun 17, 2009 at 7:53 AM, Onkar <onkar.n.m@xxxxxxxxx> wrote:
>
> Why are there so many uids and gids in
>
> struct task_struct {
> --
> --
>     uid_t uid,euid,suid,fsuid;
>     gid_t gid,egid,sgid,fsgid;
> --
> --
> }
>
> What is the significance and in which situation we use uid,euid,suid,fsuid and gid,egid,sgid,fsgid ?
> any pointers on this ...


There are four pairs of process and group identifiers held in a
processes task_struct:

uid, gid
=======

    The user identifier and group identifier of the user that the
process is running on behalf of,
effective uid and gid
    There are some programs which change the uid and gid from that of
the executing process into their own (held as attributes in the VFS
inode describing the executable image). These programs are known as
setuid programs and they are useful because it is a way of restricting
accesses to services, particularly those that run on behalf of someone
else, for example a network daemon. The effective uid and gid are
those from the setuid program and the uid and gid remain as they were.
The kernel checks the effective uid and gid whenever it checks for
privilege rights.

file system uid and gid
==================
    These are normally the same as the effective uid and gid and are
used when checking file system access rights. They are needed for NFS
mounted filesystems where the user mode NFS server needs to access
files as if it were a particular process. In this case only the file
system uid and gid are changed (not the effective uid and gid). This
avoids a situation where malicious users could send a kill signal to
the NFS server. Kill signals are delivered to processes with a
particular effective uid and gid.
saved uid and gid
==============
    These are mandated by the POSIX standard and are used by programs
which change the processes uid and gid via system calls. They are used
to save the real uid and gid during the time that the original uid and
gid have been changed.


Source: http://www.linux-tutorial.info/modules.php?name=MContent&pageid=321

Hope this helps.
A simple google would have solved your problem.

>
> Regards,
> Onkar
>



--
Regards,
Sandeep.






“To learn is to change. Education is a process that changes the learner.”

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux