Bug#848972: Fixed in Ubuntu
Control: tags -1 + patch
Ferenc Wágner <wferi@niif.hu> wrote (Mon, 26 Jun 2023 12:27:49 +0200):
> Control: tag + patch
>
> Hi,
>
> This issue was fixed in 1.178ubuntu12, as detailed at
> https://bugs.launchpad.net/ubuntu/+source/console-setup/+bug/1824227
> Please consider taking over the fix.
I have grabbed the changings from
https://git.launchpad.net/ubuntu/+source/console-setup/commit/?h=applied/ubuntu/disco&id=dc3395232928c2a3f53c7e5e29ad25a2638ddcae
Patch attached.
Any objections?
Holger
--
Holger Wansing <hwansing@mailbox.org>
PGP-Fingerprint: 496A C6E8 1442 4B34 8508 3529 59F1 87CA 156E B076
diff --git a/debian/changelog b/debian/changelog
index fb41ffd..ce2f43b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+console-setup (1.227) UNRELEASED; urgency=medium
+
+ * setupcon: use /run for tempfiles (and dump the various unnecessary
+ fallback paths), since /run is always mountable rw at least as early as
+ /tmp is and is guaranteed to be safe from tmpcleaners at boot. Only keep
+ /tmp as a fallback in case we have access to write to /tmp and to a
+ console, but not to /run. Closes: #848972
+
+ -- Holger Wansing <hwansing@mailbox.org> Sun, 11 Feb 2024 13:03:18 +0100
+
console-setup (1.226) unstable; urgency=medium
* Team upload
diff --git a/setupcon b/setupcon
index 04641c6..5d83433 100755
--- a/setupcon
+++ b/setupcon
@@ -60,11 +60,8 @@ trap 'rm -f $tempfiles >/dev/null 2>&1' 0
trap "exit 2" 1 2 3 13 15
tempfile () {
if \
- TMPFILE=`mktemp /tmp/tmpkbd.XXXXXX 2>/dev/null` \
- || TMPFILE=`mktemp /run/tmpkbd.XXXXXX 2>/dev/null` \
- || TMPFILE=`mktemp /dev/.tmpkbd.XXXXXX 2>/dev/null` \
- || TMPFILE=`mktemp /lib/init/rw/tmpkbd.XXXXXX 2>/dev/null` \
- || TMPFILE=`mktemp 2>/dev/null`
+ TMPFILE=`mktemp /run/tmpkbd.XXXXXX 2>/dev/null` \
+ || TMPFILE=`mktemp /tmp/tmpkbd.XXXXXX 2>/dev/null`
then
tempfiles="$tempfiles $TMPFILE"
return 0
Reply to: