aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2025-09-12 21:33:34 +0200
committerFlorian Weimer <fweimer@redhat.com>2025-09-19 09:19:17 +0200
commit46b4e37c9e0619d0cf065ba207c29996b326a06f (patch)
treef68ba7d8b33c41e3a4fa8de67ea5155dd090b478
parent1166170d95863e5a6f8121a5ca9d97713f524f49 (diff)
downloadglibc-46b4e37c9e0619d0cf065ba207c29996b326a06f.zip
glibc-46b4e37c9e0619d0cf065ba207c29996b326a06f.tar.gz
glibc-46b4e37c9e0619d0cf065ba207c29996b326a06f.tar.bz2
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 <collin.funk1@gmail.com> (cherry picked from commit 0fceed254559836b57ee05188deac649bc505d05)
-rw-r--r--NEWS1
-rw-r--r--nss/getXXbyYY_r.c18
2 files changed, 8 insertions, 11 deletions
diff --git a/NEWS b/NEWS
index 69aa600..06c27a8 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ The following bugs were resolved with this release:
[32994] stdlib: resolve a double lock init issue after fork
[33234] Use TLS initial-exec model for __libc_tsd_CTYPE_* thread variables
[33245] nptl: nptl: error in internal cancellation syscall handling
+ [33361] nss: Group merge does not react to ERANGE during merge
Version 2.42
diff --git a/nss/getXXbyYY_r.c b/nss/getXXbyYY_r.c
index eae6c34..2b0735f 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. */