diff --git a/0001-Fix-borked-error-check.patch b/0001-Fix-borked-error-check.patch new file mode 100644 index 0000000000000000000000000000000000000000..46b759fcdf725cfa37f0d87828bbadfd1d82fe46 --- /dev/null +++ b/0001-Fix-borked-error-check.patch @@ -0,0 +1,22 @@ +From ef090ee5a913f2c68e0fbed2600bfe38dfe55029 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Sun, 24 Jan 2021 21:12:22 +0100 +Subject: [PATCH 1/2] Fix borked error check + +--- + rtkit-daemon.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rtkit-daemon.c b/rtkit-daemon.c +index 3ecc1f7840..a15e84f8f5 100644 +--- a/rtkit-daemon.c ++++ b/rtkit-daemon.c +@@ -1463,7 +1463,7 @@ static DBusHandlerResult dbus_handler(DBusConnection *c, DBusMessage *m, void *u + if (strcmp(interface, "org.freedesktop.RealtimeKit1") == 0) { + assert_se(r = dbus_message_new_method_return(m)); + +- if (!handle_dbus_prop_get(property, r) < 0) { ++ if (handle_dbus_prop_get(property, r) < 0) { + dbus_message_unref(r); + assert_se(r = dbus_message_new_error_printf( + m, diff --git a/format-security.patch b/format-security.patch new file mode 100644 index 0000000000000000000000000000000000000000..994bebf84d1eb4a45451241203ee12cdda1021f6 --- /dev/null +++ b/format-security.patch @@ -0,0 +1,13 @@ +diff -ruN rtkit-0.11.orig/Makefile.am rtkit-0.11/Makefile.am +--- rtkit-0.11.orig/Makefile.am 2017-05-12 12:56:52.245623657 -0400 ++++ rtkit-0.11/Makefile.am 2017-05-12 13:24:27.206304970 -0400 +@@ -18,6 +18,8 @@ + AM_CFLAGS = $(WARNINGFLAGS) $(PTHREAD_CFLAGS) + AM_LDFLAGS = $(GCLDFLAGS) + ++CFLAGS += -Wno-error=format-security ++ + ACLOCAL_AMFLAGS = -I m4 + + policykitdir = $(datadir)/polkit-1/actions/ +Binary files rtkit-0.11.orig/.Makefile.am.swp and rtkit-0.11/.Makefile.am.swp differ diff --git a/rtkit.spec b/rtkit.spec index a5d52a2cc70ef8a9d02e571aff7eb89bf7cc3a40..b12b22309aa1a119415de617ac73258bc39c819b 100644 --- a/rtkit.spec +++ b/rtkit.spec @@ -1,4 +1,4 @@ -%define anolis_release 4 +%define anolis_release 5 Summary: REALTIMEKIT Realtime Policy and Watchdog Daemon Name: rtkit @@ -9,13 +9,15 @@ Release: %{anolis_release}%{?dist} # The daemon itself is GPL3 licensed, and the client library is BSD licensed. License: GPLv3+ and BSD URL: http://git.0pointer.net/%{name}.git/ -Source0: https://0pointer.de/public/%{name}-%{version}.tar.xz +Source0: http://0pointer.de/public/rtkit-0.11.tar.xz +Source1: rtkit.sysusers BuildRequires: autoconf automake libtool make BuildRequires: dbus-devel >= 1.2 BuildRequires: libcap-devel BuildRequires: polkit-devel >= 0.92 BuildRequires: systemd-devel +BuildRequires: systemd-rpm-macros Requires: dbus Requires: polkit >= 0.92 @@ -30,6 +32,8 @@ Patch3: 0003-format-security.patch Patch4: 0004-Fix-borked-error-check.patch Patch5: 0005-systemd-update-sd-daemon.-ch.patch Patch6: 0006-Remove-bundled-copy-of-sd-daemon.-ch.patch +Patch7: format-security.patch +Patch8: 0001-Fix-borked-error-check.patch %description RealtimeKit is a D-Bus system service that changes the @@ -103,6 +107,9 @@ dbus-send --system --type=method_call --dest=org.freedesktop.DBus / org.freedesk %doc README rtkit.c rtkit.h %changelog +* Wed Sep 03 2025 wenyuzifang - 0.11-5 +- Avoid build failures caused by format-security warnings treated as errors. +- Fixes a critical logic error, ensures correct error handling, prevents potential crashes and incorrect responses. * Thu Jun 8 2023 Liwei Ge - 1:0.11-4 - fix useradd in pre script diff --git a/rtkit.sysusers b/rtkit.sysusers new file mode 100644 index 0000000000000000000000000000000000000000..83b292a32ebc6c1e02a91ff0571a4faf540ac21d --- /dev/null +++ b/rtkit.sysusers @@ -0,0 +1,2 @@ +#Type Name ID GECOS Home directory Shell +u rtkit 172 "RealtimeKit" / /sbin/nologin