symbolic link filemodes unchangeable.

mario at r3.cs.man.ac.uk mario at r3.cs.man.ac.uk
Sat Nov 18 04:00:04 AEST 1989


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?
  --no read permission would prevent you from finding what the
    symbolic link pointed to
  --no search(execute) permission would prevent you from following the
    symbolic link, and
  --if you could open the symbolic link for writing (say, to redirect
    the link without removing it), no write permission would prevent you
    from doing that too.
All seems fairly obvious (except maybe the last point; maybe something
deep depends on symbolic links being immutable; also, you'd need to
extend open() to open the link not the target).  So why isn't it like this?

Mario Wolczko
   ______      Dept. of Computer Science   Internet:      mario at cs.man.ac.uk
 /~      ~\    The University              USENET:    mcvax!ukc!man.cs!mario
(    __    )   Manchester M13 9PL          JANET:         mario at uk.ac.man.cs
 `-':  :`-'    U.K.                        Tel: +44-61-275 6146  (FAX: 6280)
____;  ;_____________the mushroom project___________________________________



More information about the Comp.unix.questions mailing list