Subject: Re: Symlink ownership
To: None <Chris_G_Demetriou@BALVENIE.PDL.CS.CMU.EDU>
From: Kenneth Stailey <kstailey@owl.dol-esa.gov>
List: current-users
Date: 07/25/1995 13:41:02
> > > Not quite.  The idea is to present symlinks as objects which don't
> > > have owners (which is currently not true; this is preparation for a
> > > day on which it may be).  But _something_ has to go into the st_uid
> > > and st_gid fields of the struct stat; the choice was to copy the
> > > ownership of the containing directory.
> > 
> > Would it be better for the fake ownership to come from the symlink's
> > target if one exists, and the directory if the target does not?
> 
> Not really; it's not uncommon to symlink to things that you don't own.
> 
> also, i imagine that there could be ... interesting potential security
> implications of using the target...

Aside from the cross-device aspect, isn't it how hard links work?

owl% ls -l /usr/games/dm 
-r-sr-xr-x  1 games  bin  12288 Jun 30 14:53 /usr/games/dm
owl% ln /usr/games/dm foo
owl% ls -l foo
-r-sr-xr-x  2 games  bin  12288 Jun 30 14:53 foo
owl% id
uid=14081(kstailey) gid=20(staff) groups=20(staff), 0(wheel), 5(operator), 117(dialer), 200(nfs)
owl% pwd
/usr/home/kstailey/tmp