Subject: Re: hard links not metalogged correctly
To: None <tech-toolchain@NetBSD.org>
From: Jukka Salmi <j+nbsd@2005.salmi.ch>
List: tech-toolchain
Date: 07/08/2005 18:17:01
der Mouse --> tech-toolchain (2005-07-08 11:12:37 -0400):
> > Two questions about makelink() from src/usr.bin/xinstall/xinstall.c:
> 
> > - The mode being metalogged for hard links is [...]
> > - Why are owner, group and fflags ignored?
> 
> Perhaps because the mode, owner, group, etc, are all necessarily
> inherited from the linked-to file, so there's no point in bothering
> with them?

Sure, but using mtree syntax, you can specify how many links a file has
using the `nlink' keyword, but you can't specify which files these links
are. No, specifying identical checksums doesn't count ;-)


> I think the right fix here is not to change the metalogged data for the
> hardlink, but rather to make tools that listen to that data ignore the
> values for a hardlink - or at the very least use the corresponding
> values for the target (which must necessarily be earlier in the file,
> right?) instead.

This doesn't work because for hard links both source and target file(s)
are specified as `type=file', so you can't distinguish them.

To make this work, a new keyword needs to be added to mtree which could
be used to describe the files which are hard links to the current file.
Or one abuses the `tags' keyword for this, and delegates parsing to the
reader...


Regards, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~