Alexander Hall wrote:
Alexander Hall wrote:
Tasmanian Devil wrote:

Sorry, I was too fast, I just saw that symbolic links don't have
modes. I don't now then, sorry!

I'd say they do have modes, but they are not very useful:

$ umask 777; ln -s a b
$ umask 000; ln -s a c
$ ls -lF
total 0
l---------  1 alexander  staff  1 Dec  1 11:47 b@ -> a
lrwxrwxrwx  1 alexander  staff  1 Dec  1 11:47 c@ -> a
$ echo "test" > a
$ cat b
test
$ cat c
test

Ok... can someone please make this clear to me?
This is an excellent take home assignment. Just plug it into your shell and see for yourself.

Looking into the man pages, it is stated over and over again that symbolic links do not have modes. Do they _really_ not have them (see example above), or are they just never used?
The Devil is just demonstrating that symbolic link permissions are immaterial. Ultimately, it is the permissions of the target that determine rights. I am not sure why then symbolic links have permissions, but I can hypothesize that they exist for consistency. In the filesystem code it is probably easiest to treat everything uniformly.

-pachl

Reply via email to