Oi,

your explanation of the sticky bit is not correct. If it is set, only
the owner of the file can delete the file. See the following example:

btp333@btp5x14 ~ > cd /usr/cd-image
Directory: /usr/cd-image
/usr/cd-image
btp333@btp5x14 /usr/cd-image > ls -al
total 6567
drwxrwxrwt   5 btp301   bt_p3        5120 Jul 11 19:39 .
drwxr-xr-x  25 root     root         1024 Feb 24 21:10 ..
-rw-r--r--   1 root     root         3614 Dec 30  1999 README.multi
drwxr-xr-x   2 root     root         1024 Jan 12  2000 image
-rw-r--r--   1 btp434   bt_p4     6672384 Jul  3 14:12 image1.dat
drwxr-xr-x   2 root     root        12288 Jan  4  2000 lost+found
drwxr-xr-x   2 btp333   bt_p3        1024 Jun  8 15:37 mandrake
btp333@btp5x14 /usr/cd-image > 

Here we se a directory where the sticky bit is set. The user logged in
is 'btp333' he could do a

  rm -rf mandrake

and the directory mandrake will be deleted (he would not do it, because
Mandrake is a nice distribution). But he cannot delete image1.dat
because it belongs to 'btp434'. 'btp301' as the owner of the directory
/usr/cd-image cannot delete anything inside it, because he does not own
any of the files. 'root' naturally can delete all files and the
directory /usr/cd-image itself (the directory is on a local disk of the
machine).

   Till



"Eric MC.D" wrote:
> 
> To Till,
> For ex. if rwxrwxrwx is attributed to a file everyone can
> delete
> this file.
> The SUID and SGID bit are normaly applicable to prog. files.
> But this is also available for dirs.
> This is the Sticky bit for dirs.
> If the Sticky bit is set, only the prop. of the dir can
> delete a file in this dir. (also the root (0) of corse)
> To set this bit do:
> chmod u+t /dir
> or
> chmod 1777 /dir
> Now it becomes drwxrwxrwxt.
>

Reply via email to