Re: chmod, chgrp and symlinks

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


From: Kasper Dupont <kasperd@daimi.au.dk>
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.

Disagreed.

>
> 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 mailto:aaarep@daimi.au.dk
for(_=52;_;(_%5)||(_/=5),(_%5)&&(_-=2))putchar(_);


Relevant Pages

  • Re: chmod, chgrp and symlinks
    ... >> i.e. will cause DoS. ... KD> Is that really a major problem? ... KD> be made on a separate filesystem. ... KD> In some cases it would be nice to prevent hardlinks even ...
    (comp.os.linux.security)
  • Re: ext2 Partition auf block-level kopieren
    ... Rein auf die Anzahl der Dateien bezogen ist das fast unendlich viel da es jedes Backup Verzeichnisse mit mehreren Tausend Dateien enthält die nur per hardlinks verknüpft sind. ... das wird dann wohl nicht gehen, denn das Filesystem hat dann genau die ...
    (de.comp.os.unix.linux.misc)
  • Re: chmod, chgrp and symlinks
    ... know if all hardlinks are inside that tree. ... > KD> be made on a separate filesystem. ... symlinks to remove a symlink to a directory. ... so are user quotas. ...
    (comp.os.linux.security)
  • very poor ext3 write performance on big filesystems?
    ... TB doesn't make this filesystem that big, but 200 millions of files is a decent number. ... Most of the files are hardlinked multiple times, ... Recently I began removing some of unneeded files (or hardlinks) and to my surprise, it takes longer than I initially expected. ... I see up to 5000 kB read/write from/to the disk, wa reported by top is usually 20-70%. ...
    (Linux-Kernel)
  • Re: Linking Files: Hard Link vs. Soft Link?
    ... because symlinks work across filesystems, and KDE only does symlinks, so ... detection to prevent infinite loops when walking the filesystem. ... a lot simpler to disallow multiple hardlinks to directories (with the ...
    (Ubuntu)