Your message dated Wed, 05 Feb 2025 20:46:17 +0000
with message-id <e1tfmhp-008rrv...@fasolo.debian.org>
and subject line Bug#1093132: fixed in molly-guard 0.8.5
has caused the Debian Bug report #1093132,
regarding molly-guard: duplicated /usr-move diversions subtly wrong (DEP17)
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)
--
1093132: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1093132
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Source: molly-guard
Version: 0.8.4
Severity: serious
Tags: patch
Hi,
I'm saddened to tell you that despite having taken three iterations on
molly-guard already, I've still gotten it wrong. I got reports for
debian-installer-utils and live-build that things were broken and looked
deeper. You may find the backstory at
https://lists.debian.org/debian-devel/2025/01/msg00125.html. As a
result, I sketched out all the possible upgrade scenarios for
molly-guard (with three different init systems) and tested the full
matrix with an unmodified rebuild of molly-guard. Sure enough it would
quickly fail. Earlier, my understanding of the --rename semantics were
wrong and as a result, it would wrongly rename files. A simple case to
see this is starting with bookworm, the installing molly-guard from
trixie and removing it.
So I set out rewrite the preinst script avoiding --rename as much as
possible and instead handling all of the renames manually. This may
sound backwards, but it appears to practically work much better. At
least the tests I wrote now pass.
I really do appreciate reviews if you have cycles to spend on that. In
the maintainer script, I've added more comments to make it easier to
follow. In particular, reviewing the test cases and judging whether they
cover all relevant scenarios would be very welcome.
If that's asking too much, so be it. What I can say now is that the
current state in unstable demonstrably has bugs and those bugs no longer
reproduce when applying the attached patch.
I really hope that this is my last molly-guard update before trixie.
Keep the fingers crossed.
Helmut
diff --minimal -Nru molly-guard-0.8.4/debian/changelog
molly-guard-0.8.4+nmu1/debian/changelog
--- molly-guard-0.8.4/debian/changelog 2024-03-09 22:38:43.000000000 +0100
+++ molly-guard-0.8.4+nmu1/debian/changelog 2025-01-14 12:40:30.000000000
+0100
@@ -1,3 +1,11 @@
+molly-guard (0.8.4+nmu1) UNRELEASED; urgency=medium
+
+ * Non-maintainer upload.
+ * Rework the duplicated diversions to avoid trouble with --rename.
+ (DEP17, Closes: #-1)
+
+ -- Helmut Grohne <hel...@subdivi.de> Tue, 14 Jan 2025 12:40:30 +0100
+
molly-guard (0.8.4) unstable; urgency=medium
[ Helmut Grohne ]
diff --minimal -Nru molly-guard-0.8.4/debian/molly-guard.preinst
molly-guard-0.8.4+nmu1/debian/molly-guard.preinst
--- molly-guard-0.8.4/debian/molly-guard.preinst 2024-03-09
22:38:43.000000000 +0100
+++ molly-guard-0.8.4+nmu1/debian/molly-guard.preinst 2025-01-14
12:40:30.000000000 +0100
@@ -15,31 +15,30 @@
case "$1" in
install|upgrade)
for cmd in halt poweroff reboot shutdown coldreboot ; do
- truenameusr="$(dpkg-divert --truename "/usr/sbin/$cmd")"
- truenamealias="$(dpkg-divert --truename "/sbin/$cmd")"
- rename_flag=--no-rename
- if test "$truenameusr" = "/usr/sbin/$cmd" && test "$truenamealias"
= "/sbin/$cmd"; then
- rename_flag=--rename
- fi
- if test "$truenameusr" = "/usr/sbin/$cmd"; then
- dpkg-divert --package molly-guard --divert
"/usr/sbin/$cmd.no-molly-guard" "$rename_flag" --add "/usr/sbin/$cmd"
- elif test "$truenameusr" != "/usr/sbin/$cmd.no-molly-guard"; then
- dpkg-divert --package molly-guard --no-rename --remove
"/usr/sbin/$cmd"
- dpkg-divert --package molly-guard --no-rename --divert
"/usr/sbin/$cmd.no-molly-guard" --add "/usr/sbin/$cmd"
- if test -e "$truenameusr" || test -h "$truenameusr"; then
- mv "$truenameusr" "/usr/sbin/$cmd.no-molly-guard"
- fi
- fi
- if test "$truenamealias" = "/sbin/$cmd"; then
- # DEP17 M18 duplicated diversion. Can be --removed after
trixie.
- dpkg-divert --package molly-guard --divert
"/sbin/$cmd.no-molly-guard.usr-is-merged" "$rename_flag" --add "/sbin/$cmd"
- elif test "$truenamealias" !=
"/sbin/$cmd.no-molly-guard.usr-is-merged"; then
- dpkg-divert --package molly-guard --no-rename --remove
"/sbin/$cmd"
- dpkg-divert --package molly-guard --no-rename --divert
"/sbin/$cmd.no-molly-guard.usr-is-merged" --add "/sbin/$cmd"
- if test -e "$truenamealias" || test -h "$truenamealias"; then
- mv "$truenamealias"
"/sbin/$cmd.no-molly-guard.usr-is-merged"
+ # DEP17 M18 duplicated diversion. Once trixie is released,
+ # remove the aliased diversion in postinst and only have
+ # the canonical one with --rename here.
+ truename="$(dpkg-divert --truename "/sbin/$cmd")"
+ if test "$(dpkg-divert --truename "/usr/sbin/$cmd")" !=
"/usr/sbin/$cmd"; then
+ : # Canonically diverted already. Nothing to rename.
+ elif test "$truenam" = "/sbin/$cmd.no-molly-guard.usr-is-merged";
then
+ : # Aliased diversion as expected. Nothing to rename.
+ elif test "$truename" != "/sbin/$cmd"; then
+ # Aliased diversion with earlier target. Fix target.
+ dpkg-divert --remove --no-rename "/sbin/$cmd"
+ if test -e "$DPKG_ROOT$truename" -o -h "$DPKG_ROOT$truename";
then
+ mv "$DPKG_ROOT$truename"
"$DPKG_ROOT/sbin/$cmd.no-molly-guard.usr-is-merged"
fi
+ elif dpkg -S "/sbin/$cmd" >/dev/null 2>&1; then
+ # Not diverted yet. Installed as aliased.
+ mv "$DPKG_ROOT/sbin/$cmd"
"$DPKG_ROOT/sbin/$cmd.no-molly-guard.usr-is-merged"
+ elif test -e "$DPKG_ROOT/usr/sbin/$cmd" -o -h
"$DPKG_ROOT/usr/sbin/$cmd"; then
+ # Not diverted yet. Installed as canonical.
+ mv "$DPKG_ROOT/usr/sbin/$cmd"
"$DPKG_ROOT/usr/sbin/$cmd.no-molly-guard"
fi
+ # All necessary moving has been done. Hence --no-rename.
+ dpkg-divert --add --no-rename --divert
"/sbin/$cmd.no-molly-guard.usr-is-merged" "/sbin/$cmd"
+ dpkg-divert --add --no-rename --divert
"/usr/sbin/$cmd.no-molly-guard" "/usr/sbin/$cmd"
done
for cmd in pm-hibernate pm-suspend pm-suspend-hybrid ; do
@@ -47,6 +46,7 @@
if test "$truename" = "/usr/sbin/$cmd"; then
dpkg-divert --package molly-guard --divert
"/usr/sbin/$cmd.no-molly-guard" --rename "/usr/sbin/$cmd"
elif test "$truename" != "/usr/sbin/$cmd.no-molly-guard"; then
+ # Upgrading from pre-trixie. Update the diversion target from
aliased to canonical.
dpkg-divert --package molly-guard --no-rename --remove
"/usr/sbin/$cmd"
dpkg-divert --package molly-guard --divert
"/usr/sbin/$cmd.no-molly-guard" --no-rename --add "/usr/sbin/$cmd"
if test -e "$truename" -o -h "$truename"; then
test.sh
Description: Bourne shell script
--- End Message ---
--- Begin Message ---
Source: molly-guard
Source-Version: 0.8.5
Done: Marc Haber <mh+debian-packa...@zugschlus.de>
We believe that the bug you reported is fixed in the latest version of
molly-guard, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 1093...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Marc Haber <mh+debian-packa...@zugschlus.de> (supplier of updated molly-guard
package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Format: 1.8
Date: Wed, 05 Feb 2025 20:24:34 +0100
Source: molly-guard
Architecture: source
Version: 0.8.5
Distribution: unstable
Urgency: medium
Maintainer: Simó Albert i Beltran <s...@probeta.net>
Changed-By: Marc Haber <mh+debian-packa...@zugschlus.de>
Closes: 1093132
Changes:
molly-guard (0.8.5) unstable; urgency=medium
.
* Rework the duplicated diversions to avoid trouble with --rename (DEP17)
Thanks to Helmut Grohne (Closes: #1093132)
* 30-query-hostname is a bash script
* Standards-Version: 4.7.0 (no changes necessary)↲
Checksums-Sha1:
5d3fbb57d5c213ec9a33c8621d9c330dbdabc091 1737 molly-guard_0.8.5.dsc
3962aa5584991bb3adf77566db2ec9e4926d0d68 14340 molly-guard_0.8.5.tar.xz
c79b0061caadeabba68c6292f4f878502efe0193 5730
molly-guard_0.8.5_source.buildinfo
Checksums-Sha256:
3cabb45850e832b15f03b4b618711b9482136d00f04ef6e1da391bad9d73c568 1737
molly-guard_0.8.5.dsc
62712d20e429151b4257d86a326ca7ac0a71901639b3d2805a447eb9ee137fa8 14340
molly-guard_0.8.5.tar.xz
81938451fc002f218c28b9c41802c354be554f6ab1755ce8eb63e863cb0cfbdf 5730
molly-guard_0.8.5_source.buildinfo
Files:
e8e1dc64b94c4e846060769f96e04b83 1737 admin optional molly-guard_0.8.5.dsc
0f81eb9f34004532d68c3293e36005a0 14340 admin optional molly-guard_0.8.5.tar.xz
9c78e206026bdb08298c1236c7329eff 5730 admin optional
molly-guard_0.8.5_source.buildinfo
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEE6QL5UJ/L0pcuNEbjj3cgEwEyBEIFAmejxGsACgkQj3cgEwEy
BEK/PA/+OOpAlv+l5T8/45JtTAAwEroKRZJ0xAibSqs/5f0wFcfFxUAgVvZNd7CG
4rpFv/cxQrwlVygWrNXpGq+vOEfVvKaozZsSsXgW0lraPR4AD3yVVMgdZu9tYgSH
6nBKoYGizFBrSTNyP0nxLqouIyiVFB9Jubv1IGVTDNOgwFpC5jRbw90JLnTDyMlr
zXCCk3Vm2fBIABX6AeIwo1yhXga8PFjyzGHGY0LzblDCt1qJq8l+EmkxvIJdYm/m
Xlquk+k4LlmjRGJkD6Ffp2AdeFoHLq1rCsllfWUg4v/q6YPA6M5tRY8a62uS1JTi
nlgLxJv00v+ACArRaMMifD3UzgqexFJQGX6j3mJD/WHTc9tc2PdtA4HhTsU2KZQ/
YVcc4d9YCuzcXhc/8bqgNG8sI95flDlK4OPChqYx0j7o13hyVZgW90h9v/bXu4cp
aLFtpWvBuMglt309qKtePawB+8C1bdHhKRebt3SbXzzqRCfZvkcFxu7ZlMwnAta+
6um+tSLFE1n3ZdYLHNutbPN4unsSi5LJtmHaFG2Tfr1gSdWkEY6NKN2IBwbpSXGt
kcsRJjvlRdFMmCYkWqrPfsu/ase4FOxY7C4DgdDdA+1yW+blQ+JbCBYNAyNmsvkk
QQ18jSTReBHQk8jojdqcqt7dPQPYLX0M1irCbkKn2ieMVR2Q+gc=
=CQWh
-----END PGP SIGNATURE-----
pgpSwpawCOU3J.pgp
Description: PGP signature
--- End Message ---