From c0e5d8db8ca894636f6580e77e213045897393d90ff6609851b4d76d1604e5f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Tue, 12 Nov 2024 12:19:39 +0100 Subject: [PATCH] Sync from SUSE:SLFO:Main umockdev revision 7615acd19e745060fc47f09b050c5605 --- ...ingle-handle-missing-selinux-context.patch | 60 +++++++++++++++++++ umockdev-0.17.18.tar.xz | 3 - umockdev-0.18.4.tar.xz | 3 + umockdev.changes | 43 +++++++++++++ umockdev.spec | 8 ++- 5 files changed, 111 insertions(+), 6 deletions(-) create mode 100644 0001-t_system_single-handle-missing-selinux-context.patch delete mode 100644 umockdev-0.17.18.tar.xz create mode 100644 umockdev-0.18.4.tar.xz diff --git a/0001-t_system_single-handle-missing-selinux-context.patch b/0001-t_system_single-handle-missing-selinux-context.patch new file mode 100644 index 0000000..1b5bc37 --- /dev/null +++ b/0001-t_system_single-handle-missing-selinux-context.patch @@ -0,0 +1,60 @@ +From f5c3a2e4ecbb2ab733b19b0bf84c8334cedd8ba2 Mon Sep 17 00:00:00 2001 +From: Eugenio Paolantonio +Date: Wed, 30 Oct 2024 14:15:30 +0100 +Subject: [PATCH] tests: umockdev-record: t_system_single: handle missing + SELinux context on /dev/null + +/sys/fs/selinux might exist, yet the checked path might have no +context defined. + +Drop the check for the selinux pseudo-fs, and check the eventual +errno if lgetfilecon() fails. + +On ENODATA (context doesn't exist, or the process can't access it), +ENOTSUP (extended attributes not supported/disabled) and ENOSYS +(lgetxattr syscall used by lgetfilecon() not available), ensure +__DEVCONTEXT is not there and continue. + +On every other error, fail the test case as before. + +Signed-off-by: Eugenio Paolantonio +--- + tests/test-umockdev-record.vala | 24 ++++++++++++++++++------ + 1 file changed, 18 insertions(+), 6 deletions(-) + +diff --git a/tests/test-umockdev-record.vala b/tests/test-umockdev-record.vala +index 8672ee1..2c362fa 100644 +--- a/tests/test-umockdev-record.vala ++++ b/tests/test-umockdev-record.vala +@@ -201,13 +201,25 @@ t_system_single () + assert_in("P: /devices/virtual/mem/null", sout); + assert_in("E: DEVNAME=/dev/zero", sout); + #if HAVE_SELINUX +- // we may run on a system without SELinux +- if (FileUtils.test("/sys/fs/selinux", FileTest.EXISTS)) { +- string context; +- assert_cmpint (Selinux.lgetfilecon ("/dev/null", out context), CompareOperator.GT, 0); +- assert_in("E: __DEVCONTEXT=" + context + "\n", sout); ++ string context; ++ int res = Selinux.lgetfilecon ("/dev/null", out context); ++ if (res > 0) { ++ assert_in ("E: __DEVCONTEXT=" + context + "\n", sout); ++ } else if (res == -1 && (Posix.errno == Posix.ENODATA || ++ Posix.errno == Posix.ENOTSUP || ++ Posix.errno == Posix.ENOSYS)) { ++ // If SELinux is not available, or is available but ++ // there is no context defined for /dev/null, ++ // we should skip this check as there is ++ // no context recorded. ++ // ++ // ENODATA: context doesn't exist, or the process ++ // can't access it ++ // ENOTSUP: extended attributes not supported/disabled ++ // ENOSYS: lgetxattr syscall not available ++ assert (!sout.contains("E: __DEVCONTEXT")); + } else { +- assert(!sout.contains("E: __DEVCONTEXT")); ++ assert_cmpint (res, CompareOperator.GT, 0); + } + #endif + } diff --git a/umockdev-0.17.18.tar.xz b/umockdev-0.17.18.tar.xz deleted file mode 100644 index 2a5eb9e..0000000 --- a/umockdev-0.17.18.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:466ad3e0c715e56f50ea6a965165823d073a84137acb8a1e39b66573648a985f -size 491668 diff --git a/umockdev-0.18.4.tar.xz b/umockdev-0.18.4.tar.xz new file mode 100644 index 0000000..4cd5266 --- /dev/null +++ b/umockdev-0.18.4.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:115306f17be78f8c99e20652e2deccdd48df38736bf00eb4f43fefc3809a319c +size 495284 diff --git a/umockdev.changes b/umockdev.changes index 96586a6..de3a85c 100644 --- a/umockdev.changes +++ b/umockdev.changes @@ -1,3 +1,46 @@ +------------------------------------------------------------------- +Thu Oct 31 14:19:29 UTC 2024 - Eugenio Paolantonio + +- Add 0001-t_system_single-handle-missing-selinux-context.patch: + * tests: umockdev-record: t_system_single: handle missing + SELinux context on /dev/null (Cherry-picked from commit + f5c3a2e4ecbb2ab733b19b0bf84c8334cedd8ba2) + * Fixes testsuite failure in SLFO. +- Move to the %autosetup macro + +------------------------------------------------------------------- +Mon Oct 7 21:38:00 UTC 2024 - Atri Bhattacharya + +- Update to version 0.18.4: + * Add ioctls for Chromium OS EC devices. + * Generate "remove" uevent in umockdev_testbed_remove_device(). + * Recursively remove children with uevents. + * preload: Fix sigmask block and restore race. + +------------------------------------------------------------------- +Wed Jul 17 06:30:18 UTC 2024 - Atri Bhattacharya + +- Update to version 0.18.3: + * preload: Re-fix time64 redirects for glibc < 2.39.9 +- Changes from version 0.18.2: + * preload: Fix time64 redirect for glibc 2.39.9 + +------------------------------------------------------------------- +Wed Apr 10 14:58:38 UTC 2024 - Atri Bhattacharya + +- Update to version 0.18.1: + * preload: Provide wrappers for functions specific to 64-bit + time_t. + * preload: Fix building with _FILE_OFFSET_BITS. + +------------------------------------------------------------------- +Sun Mar 17 09:46:28 UTC 2024 - Dirk Müller + +- update to 0.18.0: + * Record and restore SELinux context for mocked /dev nodes + * preload: wrap fstatfs() and statfs() on musl + * Fix build with meson 1.4 + ------------------------------------------------------------------- Thu Sep 7 20:55:27 UTC 2023 - Atri Bhattacharya diff --git a/umockdev.spec b/umockdev.spec index 39ba348..a738527 100644 --- a/umockdev.spec +++ b/umockdev.spec @@ -1,7 +1,7 @@ # # spec file for package umockdev # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,12 +19,14 @@ %define shlib libumockdev0 %define shlibpre libumockdev-preload0 Name: umockdev -Version: 0.17.18 +Version: 0.18.4 Release: 0 Summary: Mock hardware devices for creating unit tests and bug reporting License: LGPL-2.1-or-later URL: https://github.com/martinpitt/umockdev/ Source: https://github.com/martinpitt/umockdev/releases/download/%{version}/%{name}-%{version}.tar.xz +# PATCH-FIX-UPSTREAM 0001-t_system_single-handle-missing-selinux-context.patch gh#martinpitt/umockdev#256 eugenio.paolantonio@suse.com -- tests: umockdev-record: t_system_single: handle missing SELinux context on /dev/null +Patch1: 0001-t_system_single-handle-missing-selinux-context.patch BuildRequires: cmake BuildRequires: gtk-doc BuildRequires: meson @@ -90,7 +92,7 @@ This package provides the GObject Introspection bindings for the library umockdev. %prep -%setup -q +%autosetup -p1 %build %meson