Check for file conflicts within package (RhBug:808750)

- Packages having file conflicts with itself may seem absurd, but
  directory symlinks (such as /lib being a symlink to /usr/lib)
  make this entirely possible. This makes us catch and abort early
  on these cases instead of silently overwriting the self-conflicting
  files, potentially with disastrous results.
This commit is contained in:
Panu Matilainen 2012-04-12 18:01:52 +03:00
parent a13e56cd87
commit 48c4ed1148
1 changed files with 6 additions and 1 deletions

View File

@ -414,7 +414,12 @@ static void handleOverlappedFiles(rpmts ts, rpmFpHash ht, rpmte p, rpmfi fi)
*
*/
/* Locate this overlapped file in the set of added/removed packages. */
/*
* Locate this overlapped file in the set of added/removed packages,
* including the package owning it: a package can have self-conflicting
* files when directory symlinks are present. Don't compare a file
* with itself though...
*/
for (j = 0; j < numRecs && !(recs[j].p == p && recs[j].fileno == i); j++)
{};