symbolic link filemodes unchangeable.

Conor P. Cahill cpcahil at virtech.uucp
Thu Nov 23 10:46:30 AEST 1989


In article <363 at m1.cs.man.ac.uk>, mario at r3.cs.man.ac.uk writes:
> In article <1989Nov16.004352.6195 at virtech.uucp> Conor P. Cahill writes:
> >> Why can't you change the filemodes of a symbolic link ? :
> >
> >Because the modes of the link are never used.  Restricting the write 
> >access on the link file does not restrict the write access on the 
> >file that it is linked to.  That is why there is no lopen(), or lchmod()
> >system call (would be similar to lstat()).
> 
> But a symbolic link contains information (the path where the file can
> really be found).  So why can't I protect that information in the same
> way as I can protect all other information in the system?

     [things one could do with symbolic link permission bits deleted]


Not that I was there when symbolic links were designed, but here goes:

The symbolic link mechanism is designed to supplement the hard link mechanism
wheree the hard link mechanism was not sufficient (like between file systems).
The hard link has only 1 set of permission bits, reguardless of the name used
to access the file.  Since the symbolic link has it's own inode, the only 
way to have it appear the same as a hard link is to ignore the permission
bits of the symbolic link file and use the permission bits of the file it
points to.


-- 
+-----------------------------------------------------------------------+
| Conor P. Cahill     uunet!virtech!cpcahil      	703-430-9247	!
| Virtual Technologies Inc.,    P. O. Box 876,   Sterling, VA 22170     |
+-----------------------------------------------------------------------+



More information about the Comp.unix.questions mailing list