Re: chmod, chgrp and symlinks

From: Kasper Dupont (kasperd@daimi.au.dk)
Date: 02/04/03


From: Kasper Dupont <kasperd@daimi.au.dk>
Date: Tue, 04 Feb 2003 09:23:31 +0100

Nico Kadel-Garcia wrote:
>
> "Ramazan Jah-Far" <ramazanjf@svitonline.com> wrote in message
> news:slrnb3t6cm.1au.ramazanjf@localhost.localdomain...
> > Hi!
> > In comp.os.linux.security, luc wastiaux wrote:
> > lw> And other than installing the openwall kernel or patching chmod/chgrp
> > lw> are there other ways of making my script secure ?
> >
> > Try this: instead of
> > chown -R luc.mp3 $dir/luc/
> > use
> > chown -R --no-dereference luc:mp3 $dir/luc/
> > etc. But I think chown doesn't dereference symlinks
> > by default :).
>
> You've *completely* ignored hard links.

In that case you could refuse to change permissions on any
file with multiple links. Use the find command and the
"-links 1" test.

-- 
Kasper Dupont -- der bruger for meget tid på usenet.
For sending spam use mailto:aaarep@daimi.au.dk
for(_=52;_;(_%5)||(_/=5),(_%5)&&(_-=2))putchar(_);

Quantcast