Control: tags -1 + patch
Hi Chris,
On Tue, Apr 16, 2024 at 09:44:13AM +0200, Chris Hofstaedtler wrote:
> I think half of 2) exists now, but Conflicts: util-linux will
> probably end badly as you note. I'd welcome a patch implementing 3).
>
> Initially I favored 1), but then u-l will never make progress on
> moving the non-essential files.
Thanks for pinging me. I observe that util-linux-extra already had
mitigations except that preinst and postinst were swapped. Additionally,
it did not have Conflicts, which allow for unpacking an aliased
util-linux concurrently with a moved util-linux-extra despite the
protective diversions being removed. Since we want to avoid the
Conflicts, I've extended the protective diversions until postrm. In
trixie's postinst we can then remove them for good. Unfortunately, that
also means that we cannot use begin-remove-after magic.
Helmut
diff --minimal -Nru util-linux-2.40/debian/changelog
util-linux-2.40/debian/changelog
--- util-linux-2.40/debian/changelog2024-04-15 09:51:01.0 +0200
+++ util-linux-2.40/debian/changelog2024-04-26 07:32:56.0 +0200
@@ -1,3 +1,10 @@
+util-linux (2.40-6.1) UNRELEASED; urgency=medium
+
+ * Non-maintainer upload.
+ * Fix /usr-move mitigation. (Closes: #1069064)
+
+ -- Helmut Grohne Fri, 26 Apr 2024 07:32:56 +0200
+
util-linux (2.40-6) unstable; urgency=medium
* Add upstream patches fixing enosys on m68k, sh and dmesg -H output
diff --minimal -Nru util-linux-2.40/debian/util-linux-extra.lintian-overrides
util-linux-2.40/debian/util-linux-extra.lintian-overrides
--- util-linux-2.40/debian/util-linux-extra.lintian-overrides 1970-01-01
01:00:00.0 +0100
+++ util-linux-2.40/debian/util-linux-extra.lintian-overrides 2024-04-26
07:32:56.0 +0200
@@ -0,0 +1,2 @@
+# DEP17 P1 mitigation
+diversion-for-unknown-file sbin/* [preinst:*]
diff --minimal -Nru util-linux-2.40/debian/util-linux-extra.postinst
util-linux-2.40/debian/util-linux-extra.postinst
--- util-linux-2.40/debian/util-linux-extra.postinst2024-04-15
09:51:01.0 +0200
+++ util-linux-2.40/debian/util-linux-extra.postinst1970-01-01
01:00:00.0 +0100
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-set -e
-
-# begin-remove-after: released:trixie
-if test "$1" = upgrade || test "$1" = install; then
- dpkg-divert --no-rename --package util-linux-extra --divert
/sbin/fsck.cramfs.usr-is-merged --add /sbin/fsck.cramfs
- dpkg-divert --no-rename --package util-linux-extra --divert
/sbin/fsck.minix.usr-is-merged --add /sbin/fsck.minix
- dpkg-divert --no-rename --package util-linux-extra --divert
/sbin/mkfs.bfs.usr-is-merged --add /sbin/mkfs.bfs
- dpkg-divert --no-rename --package util-linux-extra --divert
/sbin/mkfs.cramfs.usr-is-merged --add /sbin/mkfs.cramfs
- dpkg-divert --no-rename --package util-linux-extra --divert
/sbin/mkfs.minix.usr-is-merged --add /sbin/mkfs.minix
-fi
-# end-remove-after
-
-#DEBHELPER#
diff --minimal -Nru util-linux-2.40/debian/util-linux-extra.postrm
util-linux-2.40/debian/util-linux-extra.postrm
--- util-linux-2.40/debian/util-linux-extra.postrm 1970-01-01
01:00:00.0 +0100
+++ util-linux-2.40/debian/util-linux-extra.postrm 2024-04-26
07:32:56.0 +0200
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+if test "$1" = remove || test "$1" = disappear; then
+ dpkg-divert --no-rename --package util-linux-extra --divert
/sbin/fsck.cramfs.usr-is-merged --remove /sbin/fsck.cramfs
+ dpkg-divert --no-rename --package util-linux-extra --divert
/sbin/fsck.minix.usr-is-merged --remove /sbin/fsck.minix
+ dpkg-divert --no-rename --package util-linux-extra --divert
/sbin/mkfs.bfs.usr-is-merged --remove /sbin/mkfs.bfs
+ dpkg-divert --no-rename --package util-linux-extra --divert
/sbin/mkfs.cramfs.usr-is-merged --remove /sbin/mkfs.cramfs
+ dpkg-divert --no-rename --package util-linux-extra --divert
/sbin/mkfs.minix.usr-is-merged --remove /sbin/mkfs.minix
+fi
+
+#DEBHELPER#
+
diff --minimal -Nru util-linux-2.40/debian/util-linux-extra.preinst
util-linux-2.40/debian/util-linux-extra.preinst
--- util-linux-2.40/debian/util-linux-extra.preinst 2024-04-15
09:51:01.0 +0200
+++ util-linux-2.40/debian/util-linux-extra.preinst 2024-04-26
07:32:56.0 +0200
@@ -2,15 +2,12 @@
set -e
-# begin-remove-after: released:trixie
-if test "$1" = configure; then
- dpkg-divert --no-rename --package util-linux-extra --divert
/sbin/fsck.cramfs.usr-is-merged --remove /sbin/fsck.cramfs
- dpkg-divert --no-rename --package util-linux-extra --divert
/sbin/fsck.minix.usr-is-merged --remove /sbin/fsck.minix
- dpkg-divert --no-rename --package util-linux-extra --divert
/sbin/mkfs.bfs.usr-is-merged --remove /sbin/mkfs.bfs
- dpkg-divert --no-rename --package util-linux-extra --divert
/sbin/mkfs.cramfs.usr-is-merged --remove /sbin/mkfs.cramfs
- dpkg-divert --no-rename --package util-linux-extra --divert
/sbin/mkfs.minix.usr-is-merged --remove /sbin/mkfs.minix
+if test "$1" = upgrade || test