Re: chmod, chgrp and symlinks

From: Kasper Dupont (
Date: 02/05/03

From: Kasper Dupont <>
Date: Wed, 05 Feb 2003 11:30:58 +0100

Ramazan Jah-Far wrote:
> Hardlinks are a pain in ass anyway. Considering all
> said above, hardlinks turn to be a sort of design
> flaw. IMO.


> Think what will happen when someone make hardlink of
> every file in $dir:
> KD> and to prevent chmod on hardlinks you could use:
> KD> find $dir -type f -links 1 -name '*.mp3' -print0 | xargs -0 chmod 640
> This will _prevent_ the very sense of the script :),
> i.e. will cause DoS.

Is that really a major problem? Doesn't sound to me like
the script is that important, to me it sounds more like
just a convenience instead of doing it by hand every now
and then.

But if it really is that necesarry, the directory could
be made on a seperate filesystem. Then you don't have
to care about hardlinks, because hardlinks between
filesystems is not possible. Just remove the -links test
from the find command, and it will work as intended. In
some cases it would be nice to prevent hardlinks even
between subtrees of the same filesystem, in particular
in combination with directory quotas. Does anybody know
a filesystem implementing such a thing?

Kasper Dupont -- der bruger for meget tid på usenet.
For sending spam use