diff options
author | Florian Weimer <fweimer@redhat.com> | 2025-05-22 14:36:37 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2025-06-20 11:56:25 +0200 |
commit | 80401002011f470d9c6eb604bf734715e9b3a8c2 (patch) | |
tree | e05c4591a8cec1fb31c3cf6f0b4e898f2add570c /stdlib/tst-secure-getenv.c | |
parent | c6ec750be51643479f2a9d474bdcead930907646 (diff) | |
download | glibc-release/2.35/master.zip glibc-release/2.35/master.tar.gz glibc-release/2.35/master.tar.bz2 |
Fix error reporting (false negatives) in SGID testsrelease/2.35/master
And simplify the interface of support_capture_subprogram_self_sgid.
Use the existing framework for temporary directories (now with
mode 0700) and directory/file deletion. Handle all execution
errors within support_capture_subprogram_self_sgid. In particular,
this includes test failures because the invoked program did not
exit with exit status zero. Existing tests that expect exit
status 42 are adjusted to use zero instead.
In addition, fix callers not to call exit (0) with test failures
pending (which may mask them, especially when running with --direct).
Fixes commit 35fc356fa3b4f485bd3ba3114c9f774e5df7d3c2
("elf: Fix subprocess status handling for tst-dlopen-sgid (bug 32987)").
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit 3a3fb2ed83f79100c116c824454095ecfb335ad7)
Diffstat (limited to 'stdlib/tst-secure-getenv.c')
-rw-r--r-- | stdlib/tst-secure-getenv.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/stdlib/tst-secure-getenv.c b/stdlib/tst-secure-getenv.c index 69719a8..ed4728c 100644 --- a/stdlib/tst-secure-getenv.c +++ b/stdlib/tst-secure-getenv.c @@ -57,13 +57,7 @@ do_test (void) exit (1); } - int status = support_capture_subprogram_self_sgid (MAGIC_ARGUMENT); - - if (WEXITSTATUS (status) == EXIT_UNSUPPORTED) - return EXIT_UNSUPPORTED; - - if (!WIFEXITED (status)) - FAIL_EXIT1 ("Unexpected exit status %d from child process\n", status); + support_capture_subprogram_self_sgid (MAGIC_ARGUMENT); return 0; } @@ -82,6 +76,7 @@ alternative_main (int argc, char **argv) if (secure_getenv ("PATH") != NULL) FAIL_EXIT (4, "PATH variable not filtered out\n"); + support_record_failure_barrier (); exit (EXIT_SUCCESS); } } |