From ea26fc3dbc2a5e0f51587b04674338fb92b946f2 Mon Sep 17 00:00:00 2001 From: shixuantong Date: Thu, 16 Feb 2023 10:32:57 +0800 Subject: [PATCH] enable check --- backport-Support-new-kernel-namespace.patch | 78 +++++++++++++++++ ...nal_libreport-Sort-kernel-namespaces.patch | 86 +++++++++++++++++++ libreport.spec | 16 ++-- 3 files changed, 175 insertions(+), 5 deletions(-) create mode 100644 backport-Support-new-kernel-namespace.patch create mode 100644 backport-internal_libreport-Sort-kernel-namespaces.patch diff --git a/backport-Support-new-kernel-namespace.patch b/backport-Support-new-kernel-namespace.patch new file mode 100644 index 0000000..d63b2c3 --- /dev/null +++ b/backport-Support-new-kernel-namespace.patch @@ -0,0 +1,78 @@ +From ac7bcb6bf712600ae0cc0a6d9920b156f198829b Mon Sep 17 00:00:00 2001 +From: Ernestas Kulik +Date: Wed, 1 Apr 2020 12:12:34 +0200 +Subject: [PATCH] Support new kernel namespace + +Linux 5.6 introduces a new time namespace: +https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=769071ac9f20b6a447410c7eaa55d1a5233ef40c +--- + src/include/internal_libreport.h | 14 +++++++++++++- + tests/proc_helpers.at | 13 ++++++++++++- + 2 files changed, 25 insertions(+), 2 deletions(-) + +diff --git a/src/include/internal_libreport.h b/src/include/internal_libreport.h +index c48c25f..06efe57 100644 +--- a/src/include/internal_libreport.h ++++ b/src/include/internal_libreport.h +@@ -750,7 +750,19 @@ int get_env_variable(pid_t pid, const char *name, char **value); + #define PROC_NS_ID_USER 4 + #define PROC_NS_ID_UTS 5 + #define PROC_NS_ID_CGROUP 6 +-static const char * libreport_proc_namespaces[] = { "ipc", "mnt", "net", "pid", "uts", "user", "cgroup", "pid_for_children" }; ++#define PROC_NS_ID_TIME 8 ++static const char * libreport_proc_namespaces[] = { ++ "ipc", ++ "mnt", ++ "net", ++ "pid", ++ "uts", ++ "user", ++ "cgroup", ++ "pid_for_children", ++ "time", ++ "time_for_children", ++}; + + struct ns_ids { + ino_t nsi_ids[ARRAY_SIZE(libreport_proc_namespaces)]; +diff --git a/tests/proc_helpers.at b/tests/proc_helpers.at +index 4b118f3..86896e5 100644 +--- a/tests/proc_helpers.at ++++ b/tests/proc_helpers.at +@@ -950,6 +950,8 @@ void check_file_contents(const char *filename) + + char const *pid_for_children = "default"; + char const *cgroup = "default"; ++ const char *time = "default"; ++ const char *time_for_children = "default"; + + if (stat("/proc/self/ns/cgroup", &st) < 0 && errno == ENOENT) + cgroup = "unknown"; +@@ -957,6 +959,12 @@ void check_file_contents(const char *filename) + if (stat("/proc/self/ns/pid_for_children", &st) < 0 && errno == ENOENT) + pid_for_children = "unknown"; + ++ if (stat("/proc/self/ns/time", &st) < 0 && ENOENT == errno) ++ time = "unknown"; ++ ++ if (stat("/proc/self/ns/time_for_children", &st) < 0 && ENOENT == errno) ++ time_for_children = "unknown"; ++ + expected = xasprintf("ipc : default\n" + "mnt : default\n" + "net : default\n" +@@ -964,7 +972,10 @@ void check_file_contents(const char *filename) + "uts : default\n" + "user : default\n" + "cgroup : %s\n" +- "pid_for_children : %s\n", cgroup, pid_for_children); ++ "pid_for_children : %s\n" ++ "time : %s\n" ++ "time_for_children : %s\n", ++ cgroup, pid_for_children, time, time_for_children); + + char *file = xmalloc_xopen_read_close(filename, NULL); + TS_ASSERT_STRING_EQ(file, expected, "Namespaces"); +-- +2.27.0 + diff --git a/backport-internal_libreport-Sort-kernel-namespaces.patch b/backport-internal_libreport-Sort-kernel-namespaces.patch new file mode 100644 index 0000000..0136f18 --- /dev/null +++ b/backport-internal_libreport-Sort-kernel-namespaces.patch @@ -0,0 +1,86 @@ +From 0a475c549cdd4d0dca58f4e2294b70a3ad78ea0f Mon Sep 17 00:00:00 2001 +From: Ernestas Kulik +Date: Mon, 6 Apr 2020 17:37:12 +0200 +Subject: [PATCH] internal_libreport: Sort kernel namespaces +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Just easier to manage. Will break binary compatibility, but there are +other pending changes that will do the same, so let’s use the +opportunity. +--- + src/include/internal_libreport.h | 22 +++++++++++----------- + tests/proc_helpers.at | 10 +++++----- + 2 files changed, 16 insertions(+), 16 deletions(-) + +diff --git a/src/include/internal_libreport.h b/src/include/internal_libreport.h +index 06efe57..695f74b 100644 +--- a/src/include/internal_libreport.h ++++ b/src/include/internal_libreport.h +@@ -743,25 +743,25 @@ int get_env_variable_ext(int fd, char delim, const char *name, char **value); + int get_env_variable(pid_t pid, const char *name, char **value); + + #define PROC_NS_UNSUPPORTED ((ino_t)-1) +-#define PROC_NS_ID_IPC 0 +-#define PROC_NS_ID_MNT 1 +-#define PROC_NS_ID_NET 2 +-#define PROC_NS_ID_PID 3 +-#define PROC_NS_ID_USER 4 +-#define PROC_NS_ID_UTS 5 +-#define PROC_NS_ID_CGROUP 6 +-#define PROC_NS_ID_TIME 8 ++#define PROC_NS_ID_CGROUP 0 ++#define PROC_NS_ID_IPC 1 ++#define PROC_NS_ID_MNT 2 ++#define PROC_NS_ID_NET 3 ++#define PROC_NS_ID_PID 4 ++#define PROC_NS_ID_TIME 6 ++#define PROC_NS_ID_USER 8 ++#define PROC_NS_ID_UTS 9 + static const char * libreport_proc_namespaces[] = { ++ "cgroup", + "ipc", + "mnt", + "net", + "pid", +- "uts", +- "user", +- "cgroup", + "pid_for_children", + "time", + "time_for_children", ++ "user", ++ "uts", + }; + + struct ns_ids { +diff --git a/tests/proc_helpers.at b/tests/proc_helpers.at +index 86896e5..891eb11 100644 +--- a/tests/proc_helpers.at ++++ b/tests/proc_helpers.at +@@ -965,16 +965,16 @@ void check_file_contents(const char *filename) + if (stat("/proc/self/ns/time_for_children", &st) < 0 && ENOENT == errno) + time_for_children = "unknown"; + +- expected = xasprintf("ipc : default\n" ++ expected = xasprintf("cgroup : %s\n" ++ "ipc : default\n" + "mnt : default\n" + "net : default\n" + "pid : default\n" +- "uts : default\n" +- "user : default\n" +- "cgroup : %s\n" + "pid_for_children : %s\n" + "time : %s\n" +- "time_for_children : %s\n", ++ "time_for_children : %s\n" ++ "user : default\n" ++ "uts : default\n", + cgroup, pid_for_children, time, time_for_children); + + char *file = xmalloc_xopen_read_close(filename, NULL); +-- +2.27.0 + diff --git a/libreport.spec b/libreport.spec index e0919e4..cbc68e4 100644 --- a/libreport.spec +++ b/libreport.spec @@ -3,12 +3,15 @@ Name: libreport Version: 2.10.1 -Release: 10 +Release: 11 License: GPLv2+ Summary: Generic library for reporting various problems URL: https://abrt.readthedocs.org/ Source: https://github.com/abrt/%{name}/archive/%{version}/%{name}-%{version}.tar.gz +Patch1:backport-Support-new-kernel-namespace.patch +Patch2:backport-internal_libreport-Sort-kernel-namespaces.patch + Patch9000: fix-bug-delete-gtk-deprecation-warnings.patch BuildRequires: dbus-devel gtk3-devel curl-devel desktop-file-utils python2-devel python3-devel @@ -154,12 +157,12 @@ mkdir -p %{buildroot}/%{_datadir}/%{name}/workflows/ rm -f %{buildroot}/%{_infodir}/dir %check -#make check|| { +make check|| { # find and print the logs of failed test # do not cat tests/testsuite.log because it contains a lot of bloat - # find tests/testsuite.dir -name "testsuite.log" -print -exec cat '{}' \; - # exit 1 -# } + find tests/testsuite.dir -name "testsuite.log" -print -exec cat '{}' \; + exit 1 +} %post /sbin/ldconfig @@ -352,6 +355,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{_mandir}/man5/report_rhel.conf.5.* %changelog +* Thu Feb 16 2023 shixuantong - 2.10.1-11 +- enable check + * Wed Aug 25 2021 panxiaohe - 2.10.1-10 - Split filesystem package and add version limit for some provides symbol -- Gitee