From 3dec37a49a660adbbf6394bf1b16651e990e0f6a Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Mon, 4 May 2026 17:20:06 +0200 Subject: [PATCH] Adjust support/tst-support_descriptors for running under Konflux Resolves: RHEL-152856 --- glibc-RHEL-152856.patch | 72 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 glibc-RHEL-152856.patch diff --git a/glibc-RHEL-152856.patch b/glibc-RHEL-152856.patch new file mode 100644 index 0000000..da4e251 --- /dev/null +++ b/glibc-RHEL-152856.patch @@ -0,0 +1,72 @@ +commit 55873e86e1861ffe010a83455ac7eb5df239ec3e +Author: Florian Weimer +Date: Mon May 4 17:18:38 2026 +0200 + + support: Improve tst-support_descriptors compatibility with containers + + If /dev/null is bind-mounted, /dev and /dev/null are on different + devices, so the expected failure has an additional line describe + the device change. + + Reviewed-by: Carlos O'Donell + +diff --git a/support/tst-support_descriptors.c b/support/tst-support_descriptors.c +index 97d7284c69..d25cb7d67a 100644 +--- a/support/tst-support_descriptors.c ++++ b/support/tst-support_descriptors.c +@@ -128,21 +128,48 @@ test_run (void) + support_capture_subprocess_free (&proc); + free (expected); + +- expected = xasprintf ("\nDifferences:\n" +- "error: descriptor %d changed from \"/dev/null\"" +- " to \"/dev\"\n" +- "error: descriptor %d changed ino ", +- free_descriptor, free_descriptor); + good = good && !support_record_failure_is_failed (); + proc = support_capture_subprocess (&subprocess_changed_descriptor, NULL); + good = good && support_record_failure_is_failed (); + support_record_failure_reset (); /* Discard the reported error. */ + report_subprocess_output ("subprocess_changed_descriptor", &proc); +- TEST_VERIFY (strstr (proc.out.buffer, expected) != NULL); ++ ++ expected = xasprintf ("\nDifferences:\n" ++ "error: descriptor %d changed from \"/dev/null\"" ++ " to \"/dev\"\n" ++ "error: descriptor %d changed ino ", ++ free_descriptor, free_descriptor); ++ if (strstr (proc.out.buffer, expected) != NULL) ++ { ++ /* No change of device. */ ++ free (expected); ++ } ++ else ++ { ++ /* The device changed in addition to the inode number. This ++ happens if /dev/null is bind-mounted from another file ++ system, so that /dev is on a difference device. */ ++ expected = xasprintf ("\nDifferences:\n" ++ "error: descriptor %d changed from \"/dev/null\"" ++ " to \"/dev\"\n" ++ "error: descriptor %d changed device ", ++ free_descriptor, free_descriptor); ++ TEST_VERIFY (strstr (proc.out.buffer, expected) != NULL); ++ free (expected); ++ ++ /* We assume that the inode number changes, although in theory ++ it is possible that the directory happens to have the same ++ inode number as the null device because it is on a different ++ file system. */ ++ expected = xasprintf ("\nerror: descriptor %d changed ino ", ++ free_descriptor); ++ TEST_VERIFY (strstr (proc.out.buffer, expected) != NULL); ++ free (expected); ++ } ++ + support_capture_subprocess_check (&proc, "subprocess_changed_descriptor", + 0, sc_allow_stdout); + support_capture_subprocess_free (&proc); +- free (expected); + } + + static int