[Rpm-maint] corrupted cpio in case of hardlink on symlink
pixel at mandriva.com
Wed Sep 10 12:43:05 UTC 2008
there is a bug in rpmbuild triggered by hardlink on softlink.
ie things like:
lrwxrwxrwx 2 pixel pixel 1 Sep 10 13:28 b -> a
lrwxrwxrwx 2 pixel pixel 1 Sep 10 13:28 c -> a
the cpio generated by rpmbuild is broken.
!S_ISDIR(st->st_mode) && st->st_nlink > 1
S_ISREG(st->st_mode) && st->st_nlink > 1
rationale: in build/files.c, the 2 ocurrences of "flp->fl_nlink > 1"
are protected by "S_ISREG(flp->fl_mode)".
here is a test case:
rm -rf %buildroot
install -d %buildroot/etc
ln -s a b
ln b c
another fix would be:
!(S_ISDIR(st->st_mode) || S_ISLNK(st->st_mode))
(as done in jbj's rpm, but only at one place, hence the test case is
still failing: /etc/a /etc/b are not in the cpio)
More information about the Rpm-maint