[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: [LI] Re: What is SUID ?



Bilal Muddassir forced the electrons to say:
> 4711
> ^
> ???? Kindly explain this digit
> 
Sorry for the late reply.

You understand the other digits in the mode, right? You add up the exact
permissions you want by the rule: 4 = read, 2 = write, 1 = execute. This digit
is also derived similarly. Here, the difference is that:

4 = set UID
2 = set GID
1 = set sticky bit.

Set GID works similar to set UID, here it is the group of the program is set
to that of the person invoking it (some games are installed as set GID so that
everyone playing can update the score file, which usually has the group
write bit turned on; another example is the program write which is set GID to
tty which is the group of the /dev/tty* entries).

The sticky bit is set so that you can give a directory 777 permission, but
still others won't be able to delete files in that directory that they don't
own. The only places this is used in Linux are /tmp and /var/tmp where
everyone can create files, but can delete only files that he/she owns.

Binand

-- 
#include <stdio.h>                                   | Binand Raj S.
char *p = "#include <stdio.h>%cchar *p = %c%s%c;     | This is a self-
int main(){printf(p,10,34,p,34,10);return 0;}%c";    | printing program.
int main(){printf(p,10,34,p,34,10);return 0;}        | Try it!!
--------------------------------------------------------------------
The Linux India Mailing List Archives are now available.  Please search
the archive at http://lists.linux-india.org/ before posting your question
to avoid repetition and save bandwidth.