From df55530e131e3faf6a7224108b16191cab254908 Mon Sep 17 00:00:00 2001 From: Arjun Shankar Date: Fri, 19 Sep 2025 15:19:29 +0200 Subject: [PATCH] nss: Fix incorrect/empty results when merging groups (RHEL-114265) Resolves: RHEL-114265 --- glibc-RHEL-114265.patch | 45 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 glibc-RHEL-114265.patch diff --git a/glibc-RHEL-114265.patch b/glibc-RHEL-114265.patch new file mode 100644 index 0000000..15cf58d --- /dev/null +++ b/glibc-RHEL-114265.patch @@ -0,0 +1,45 @@ +commit 0fceed254559836b57ee05188deac649bc505d05 +Author: Florian Weimer +Date: Fri Sep 12 21:33:34 2025 +0200 + + nss: Group merge does not react to ERANGE during merge (bug 33361) + + The break statement in CHECK_MERGE is expected to exit the surrounding + while loop, not the do-while loop with in the macro. Remove the + do-while loop from the macro. It is not needed to turn the macro + expansion into a single statement due to the way CHECK_MERGE is used + (and the statement expression would cover this anyway). + + Reviewed-by: Collin Funk + +diff --git a/nss/getXXbyYY_r.c b/nss/getXXbyYY_r.c +index eae6c3480e..2b0735fb6a 100644 +--- a/nss/getXXbyYY_r.c ++++ b/nss/getXXbyYY_r.c +@@ -157,19 +157,15 @@ __merge_einval (LOOKUP_TYPE *a, + + #define CHECK_MERGE(err, status) \ + ({ \ +- do \ ++ if (err) \ + { \ +- if (err) \ +- { \ +- __set_errno (err); \ +- if (err == ERANGE) \ +- status = NSS_STATUS_TRYAGAIN; \ +- else \ +- status = NSS_STATUS_UNAVAIL; \ +- break; \ +- } \ ++ __set_errno (err); \ ++ if (err == ERANGE) \ ++ status = NSS_STATUS_TRYAGAIN; \ ++ else \ ++ status = NSS_STATUS_UNAVAIL; \ ++ break; \ + } \ +- while (0); \ + }) + + /* Type of the lookup function we need here. */