summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2024-03-04 02:50:27 +0000
committerSam James <sam@gentoo.org>2024-03-04 02:51:32 +0000
commita25cf19d6f0dd41643c17cdfebbd87fde5e0e336 (patch)
tree32ad0e765830073e52172c5567a51c889897b4d8 /sys-apps/systemd
parentapp-text/mdbook: Stabilize 0.4.37 x86, #926115 (diff)
downloadgentoo-a25cf19d6f0dd41643c17cdfebbd87fde5e0e336.tar.gz
gentoo-a25cf19d6f0dd41643c17cdfebbd87fde5e0e336.tar.bz2
gentoo-a25cf19d6f0dd41643c17cdfebbd87fde5e0e336.zip
sys-apps/systemd: backport another stringop-truncation fix
No revbump as this is a false positive (the stringop-* warnings are known to be noisy/flaky). Closes: https://bugs.gentoo.org/916518 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-apps/systemd')
-rw-r--r--sys-apps/systemd/files/255-install-format-overflow.patch43
-rw-r--r--sys-apps/systemd/systemd-255.4.ebuild1
2 files changed, 44 insertions, 0 deletions
diff --git a/sys-apps/systemd/files/255-install-format-overflow.patch b/sys-apps/systemd/files/255-install-format-overflow.patch
new file mode 100644
index 000000000000..3dca7d8e8ec7
--- /dev/null
+++ b/sys-apps/systemd/files/255-install-format-overflow.patch
@@ -0,0 +1,43 @@
+https://github.com/systemd/systemd-stable/commit/f85d2c6d1023b1fe558142440b1d63c4fc5f7c98
+https://github.com/systemd/systemd/issues/30448
+https://bugs.gentoo.org/916518
+
+From f85d2c6d1023b1fe558142440b1d63c4fc5f7c98 Mon Sep 17 00:00:00 2001
+From: Luca Boccassi <bluca@debian.org>
+Date: Sat, 24 Feb 2024 12:05:44 +0000
+Subject: [PATCH] install: fix compiler warning about empty directive argument
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+On ppc64el with gcc 13.2 on Ubuntu 24.04:
+
+3s In file included from ../src/basic/macro.h:386,
+483s from ../src/basic/alloc-util.h:10,
+483s from ../src/shared/install.c:12:
+483s ../src/shared/install.c: In function ‘install_changes_dump’:
+483s ../src/shared/install.c:432:64: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
+483s 432 | err = log_error_errno(changes[i].type, "Failed to %s unit, unit %s does not exist.",
+483s | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+483s ../src/shared/install.c:432:75: note: format string is defined here
+483s 432 | err = log_error_errno(changes[i].type, "Failed to %s unit, unit %s does not exist.",
+
+(cherry picked from commit 8040fa55a1cbc34dede3205a902095ecd26c21e3)
+--- a/src/shared/install.c
++++ b/src/shared/install.c
+@@ -340,9 +340,12 @@ void install_changes_dump(int r, const char *verb, const InstallChange *changes,
+ assert(verb || r >= 0);
+
+ for (size_t i = 0; i < n_changes; i++) {
+- if (changes[i].type < 0)
+- assert(verb);
+ assert(changes[i].path);
++ /* This tries to tell the compiler that it's safe to use 'verb' in a string format if there
++ * was an error, but the compiler doesn't care and fails anyway, so strna(verb) is used
++ * too. */
++ assert(verb || changes[i].type >= 0);
++ verb = strna(verb);
+
+ /* When making changes here, make sure to also change install_error() in dbus-manager.c. */
+
+
diff --git a/sys-apps/systemd/systemd-255.4.ebuild b/sys-apps/systemd/systemd-255.4.ebuild
index 183166373f1d..c1d288b695d5 100644
--- a/sys-apps/systemd/systemd-255.4.ebuild
+++ b/sys-apps/systemd/systemd-255.4.ebuild
@@ -248,6 +248,7 @@ src_unpack() {
src_prepare() {
local PATCHES=(
+ "${FILESDIR}"/255-install-format-overflow.patch
)
if ! use vanilla; then