- 论坛徽章:
- 145
|
本帖最后由 jason680 于 2010-11-10 09:38 编辑
chmod never changes the permissions of symbolic links; the chmod sys-
tem call cannot change their permissions. This is not a problem since
the permissions of symbolic links are never used. However, for each
symbolic link listed on the command line, chmod changes the permis-
sions of the pointed-to file. In contrast, chmod ignores symbolic
links encountered during recursive directory traversals.
STICKY FILES
On older Unix systems, the sticky bit caused executable files to be
hoarded in swap space. This feature is not useful on modern VM sys-
tems, and the Linux kernel ignores the sticky bit on files. Other
kernels may use the sticky bit on files for system-defined purposes.
On some systems, only the superuser can set the sticky bit on files.
STICKY DIRECTORIES
When the sticky bit is set on a directory, files in that directory may
be unlinked or renamed only by root or their owner. Without the
sticky bit, anyone able to write to the directory can delete or rename
files. The sticky bit is commonly found on directories, such as /tmp,
that are world-writable.
把连结档案放至有sticky的目录下(/ tmp目录本身就是stcky目录)下,
这样只有root及owner(所有者)才能删档.
$ whoami
test
$ ls -l /home/t
-rwxrwxr-x 1 root test 8 Nov 10 09:22 /home/t
$ ls -l /tmp/t
lrwxrwxrwx 1 root root 7 Nov 10 09:21 /tmp/t -> /home/t
$ rm /tmp/t
rm: cannot remove `/tmp/t': Operation not permitted
#test不是/ tmp/t的owner,无法删档... |
|