[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Signing causes to loose hardlinks.



Dag Wieers wrote:

Hi,

I guess this may have already been covered by someone else, but if I resign a package that is hardlinked, rpm causes the package to have another inode, loosing all the hardlinks in return.

Could this be fixed in a future version, or is this done on purpose ?



Hmmm, I expect just the opposite, as rpm goes to lengths to reopen the original
package with O_TRUNC to preserve the inode in the face of hardlinks.


Here's the line from lib/rpmchecksig.c that does the dirty, O_TRUNC still set:

       if (manageFile(&ofd, &trpm, O_WRONLY|O_CREAT|O_TRUNC, 0))
           goto exit;

The O_TRUNC is painful for those who use symlinks, not hardlinks. There's also
the issue of ENOSPC, as the O_TRUNC wipes out the old before the new is written,
causing data loss if/when ENOSPC is encountered later on write.


There's no all-round clear win for everyone, but I'll be happy to listen to suggestions.

73 de Jeff





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []