Symlink permissions -- part 1.

James Mastros (root@jennifer-unix.dyn.ml.org)
Sun, 25 Jan 1998 16:40:15 -0500 (EST)


Here is the first part of my symlink permissions patch: read & lchown.
Readlink may now only be done on symlinks that you have read permissions
for. This has gone through some minor testing, but not nearly enough:

15:47:33:root:~/linktest->ls -l
/bin/ls: foo: Operation not permitted
total 0
l--------- 1 root root 1 Jan 25 14:07 foo
lrwxrwxrwx 1 root root 1 Jan 25 14:08 foo2 -> //
lr-------- 1 root root 27 Jan 25 14:38 foo3 ->
/root/win.desktop/saved.txt*

"#cd foo;ls" gives correct output.
Unfornatly:
"#cd foo;`which pwd`" does too. This meens that directories pointed to by
unreadable symlinks are basicly worthless. Is there any way to fix this?
Is there any way to do a "pwd" type call on a file? (Note: the begining of
the patch includes a stupid little lchown program to test this with.)

-=- James Mastros

BTW -- This is (obviously) against 2.1.81. The next part is exec ==
following the link.