From c95279917023ed6d35549c67b4cf6fc7c807e4ae3f68a8bc5fea1965b811ff4f Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 31 Oct 2023 16:34:51 +0000 Subject: [PATCH 1/2] Accepting request 1121456 from home:Guillaume_G:branches:Base:System - Add patch: * setterm-resize-uninit-flags.patch OBS-URL: https://build.opensuse.org/request/show/1121456 OBS-URL: https://build.opensuse.org/package/show/Base:System/util-linux?expand=0&rev=533 --- setterm-resize-uninit-flags.patch | 38 +++++++++++++++++++++++++++++++ util-linux.changes | 6 +++++ util-linux.spec | 2 ++ 3 files changed, 46 insertions(+) create mode 100644 setterm-resize-uninit-flags.patch diff --git a/setterm-resize-uninit-flags.patch b/setterm-resize-uninit-flags.patch new file mode 100644 index 0000000..db7ba8d --- /dev/null +++ b/setterm-resize-uninit-flags.patch @@ -0,0 +1,38 @@ +From: Chris Hofstaedtler +Date: Mon, 30 Oct 2023 22:59:33 +0100 +Subject: setterm: avoid restoring flags from uninitialized memory + +Depending on the used compiler and flags, previously either F_SETFL was called +with 0 or with a random value. Never with the intended previous flags. + +Signed-off-by: Chris Hofstaedtler +--- + term-utils/setterm.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/term-utils/setterm.c b/term-utils/setterm.c +index 22afc76..a477d5d 100644 +--- a/term-utils/setterm.c ++++ b/term-utils/setterm.c +@@ -846,7 +846,11 @@ static void tty_raw(struct termios *saved_attributes, int *saved_fl) + { + struct termios tattr; + +- fcntl(STDIN_FILENO, F_GETFL, saved_fl); ++ *saved_fl = fcntl(STDIN_FILENO, F_GETFL); ++ if (*saved_fl == -1) { ++ err(EXIT_FAILURE, _("fcntl failed: %s"), ++ strerror(errno)); ++ } + tcgetattr(STDIN_FILENO, saved_attributes); + fcntl(STDIN_FILENO, F_SETFL, O_NONBLOCK); + memcpy(&tattr, saved_attributes, sizeof(struct termios)); +@@ -898,7 +902,7 @@ static int resizetty(void) + ssize_t rc; + struct winsize ws; + struct termios saved_attributes; +- int saved_fl; ++ int saved_fl = 0; + + if (!isatty(STDIN_FILENO)) + errx(EXIT_FAILURE, _("stdin does not refer to a terminal")); diff --git a/util-linux.changes b/util-linux.changes index fcb2ca8..a4c23fc 100644 --- a/util-linux.changes +++ b/util-linux.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Oct 31 13:20:38 UTC 2023 - Guillaume GARDET + +- Add patch: + * setterm-resize-uninit-flags.patch + ------------------------------------------------------------------- Fri Sep 8 20:13:24 UTC 2023 - Antonio Teixeira diff --git a/util-linux.spec b/util-linux.spec index a2de2d2..370f1a4 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -116,6 +116,8 @@ Patch4: 0001-Revert-libblkid-try-LUKS2-first-when-probing.patch Patch5: util-linux-fix-tests-with-64k-pagesize.patch # https://github.com/util-linux/util-linux/pull/2100 Patch6: use-logind-not-utmp.patch +# https://salsa.debian.org/debian/util-linux/-/raw/master/debian/patches/debian/setterm-resize-uninit-flags.patch?inline=false +Patch7: setterm-resize-uninit-flags.patch BuildRequires: audit-devel BuildRequires: bc From 784cf574360870d220515734fc0794bf972963d6a1d968690dffe6286a9dc3c7 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 31 Oct 2023 16:39:09 +0000 Subject: [PATCH 2/2] move metadata together with the patches OBS-URL: https://build.opensuse.org/package/show/Base:System/util-linux?expand=0&rev=534 --- 0001-Revert-libblkid-try-LUKS2-first-when-probing.patch | 1 + make-sure-sbin-resp-usr-sbin-are-in-PATH.diff | 4 ++++ setterm-resize-uninit-flags.patch | 1 + use-logind-not-utmp.patch | 4 ++++ util-linux-bash-completion-su-chsh-l.patch | 5 +++++ util-linux.spec | 6 ------ 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/0001-Revert-libblkid-try-LUKS2-first-when-probing.patch b/0001-Revert-libblkid-try-LUKS2-first-when-probing.patch index cb36dc9..da6b46a 100644 --- a/0001-Revert-libblkid-try-LUKS2-first-when-probing.patch +++ b/0001-Revert-libblkid-try-LUKS2-first-when-probing.patch @@ -2,6 +2,7 @@ From 93ba7961779789217a1f814ce3110ff8c040c8c3 Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Wed, 12 Jul 2023 15:48:27 +0200 Subject: [PATCH] Revert "libblkid: try LUKS2 first when probing" +References: https://github.com/util-linux/util-linux/pull/2373 mdadm superblocks before 1.1 are placed at the end of the device, which means that the data contained inside the array starts at offset 0. For diff --git a/make-sure-sbin-resp-usr-sbin-are-in-PATH.diff b/make-sure-sbin-resp-usr-sbin-are-in-PATH.diff index 0a6116a..928dc21 100644 --- a/make-sure-sbin-resp-usr-sbin-are-in-PATH.diff +++ b/make-sure-sbin-resp-usr-sbin-are-in-PATH.diff @@ -1,3 +1,7 @@ +From: Werner Fink +Date: 2013-06-06 08:27:43+0000 +Subject: let `su' handle /sbin and /usr/sbin in path + Index: util-linux-2.31/login-utils/su-common.c =================================================================== --- util-linux-2.31.orig/login-utils/su-common.c diff --git a/setterm-resize-uninit-flags.patch b/setterm-resize-uninit-flags.patch index db7ba8d..6e99d4c 100644 --- a/setterm-resize-uninit-flags.patch +++ b/setterm-resize-uninit-flags.patch @@ -1,6 +1,7 @@ From: Chris Hofstaedtler Date: Mon, 30 Oct 2023 22:59:33 +0100 Subject: setterm: avoid restoring flags from uninitialized memory +References: https://salsa.debian.org/debian/util-linux/-/raw/master/debian/patches/debian/setterm-resize-uninit-flags.patch?inline=false Depending on the used compiler and flags, previously either F_SETFL was called with 0 or with a random value. Never with the intended previous flags. diff --git a/use-logind-not-utmp.patch b/use-logind-not-utmp.patch index 0527240..fdf36ac 100644 --- a/use-logind-not-utmp.patch +++ b/use-logind-not-utmp.patch @@ -1,3 +1,7 @@ +From: Thorsten Kukuk +Date: 2023-08-17 08:03:09+0000 +References: https://github.com/util-linux/util-linux/pull/2100 + diff --git a/configure.ac b/configure.ac index d631b062d2..17d3ab703b 100644 --- a/configure.ac diff --git a/util-linux-bash-completion-su-chsh-l.patch b/util-linux-bash-completion-su-chsh-l.patch index 89d0f81..8802818 100644 --- a/util-linux-bash-completion-su-chsh-l.patch +++ b/util-linux-bash-completion-su-chsh-l.patch @@ -1,3 +1,8 @@ +From: Stanislav Brabec +Date: 2022-03-03 03:22:45+0000 +References: bugzilla.suse.com/1172427 +Subject: Fix "su -s" bash completion. + su -s completion depends on "chsh -l" present in the util-linux implementation of chsh. But SUSE uses chsh from shadow package that does not include this feature. Use /etc/shells diff --git a/util-linux.spec b/util-linux.spec index 370f1a4..1b1a91b 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -104,19 +104,13 @@ Source14: runuser.pamd Source15: runuser-l.pamd Source16: su-l.pamd Source51: blkid.conf -# PATCH-EXTEND-UPSTREAM: Let `su' handle /sbin and /usr/sbin in path Patch0: make-sure-sbin-resp-usr-sbin-are-in-PATH.diff Patch1: libmount-print-a-blacklist-hint-for-unknown-filesyst.patch Patch2: Add-documentation-on-blacklisted-modules-to-mount-8-.patch -# PATCH-FIX-SUSE util-linux-bash-completion-su-chsh-l.patch bsc1172427 -- Fix "su -s" bash completion. Patch3: util-linux-bash-completion-su-chsh-l.patch -# https://github.com/util-linux/util-linux/pull/2373 Patch4: 0001-Revert-libblkid-try-LUKS2-first-when-probing.patch -# PATCH-FIX-UPSTREAM util-linux-fix-tests-with-64k-pagesize.patch -- fadvise: fix tests with 64k pagesize Patch5: util-linux-fix-tests-with-64k-pagesize.patch -# https://github.com/util-linux/util-linux/pull/2100 Patch6: use-logind-not-utmp.patch -# https://salsa.debian.org/debian/util-linux/-/raw/master/debian/patches/debian/setterm-resize-uninit-flags.patch?inline=false Patch7: setterm-resize-uninit-flags.patch BuildRequires: audit-devel