From a13e56cd871a306fe48cd902c0ada0d825076a1f Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Tue, 3 Apr 2012 06:11:11 +0300 Subject: [PATCH] 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. --- lib/transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/transaction.c b/lib/transaction.c index 855bf2da4..c46860369 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -415,7 +415,7 @@ static void handleOverlappedFiles(rpmts ts, rpmFpHash ht, rpmte p, rpmfi fi) */ /* Locate this overlapped file in the set of added/removed packages. */ - for (j = 0; j < numRecs && recs[j].p != p; j++) + for (j = 0; j < numRecs && !(recs[j].p == p && recs[j].fileno == i); j++) {}; /* Find what the previous disposition of this file was. */