summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>2026-03-19 20:20:01 +0100
committerJulian Andres Klode <jak@debian.org>2026-05-01 16:12:00 +0000
commit244bf4d107d7f17eb7a21b036717a161618387ae (patch)
tree8304452c120d49c678b19f624a165f8b8ff5245f
parentdcc690d7e08f6d54fc10ee372510875a41ec9a3b (diff)
pkgAcqMetaBase: Commit InRelease after other transaction items
If apt update is interrupted during transaction commit, the system may end up with updated InRelease that does not match the other list files, which can cause apt to believe that the lists are already up-to-date when they are in fact not. Closes: #1078608
-rw-r--r--apt-pkg/acquire-item.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 458868bec..b77bccc9d 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -1348,8 +1348,12 @@ void pkgAcqMetaBase::CommitTransaction()
for (std::vector<pkgAcqTransactionItem*>::iterator I = Transaction.begin();
I != Transaction.end(); ++I)
{
- (*I)->TransactionState(TransactionCommit);
+ if (*I != this)
+ (*I)->TransactionState(TransactionCommit);
}
+ // commit ourselves last to not end up with fresh InRelease
+ // that doesn't match other files when killed mid-commit
+ TransactionState(TransactionCommit);
Transaction.clear();
}
/*}}}*/