The child process of the tst-env-setuid process was failing correctly
with EXIT_UNSUPPORTED but the parent did not carry that status forward
and failed instead. This patch fixes this so that tests on nosuid
/tmp fails gracefully with UNSUPPORTED. Tested by making my tmpfs
nosuid.
* elf/tst-env-setuid.c (do_execve): Return EXIT_UNSUPPORTED in
parent if child exited in that manner. Print WEXITSTATUS
instead of the raw status.
(do_test_prep): Rename to do_test.
(do_test): Return the result of run_executable_sgid.
(TEST_FUNCTION_ARGV): Adjust.
+2017-02-04 Siddhesh Poyarekar <siddhesh@sourceware.org>
+
+ * elf/tst-env-setuid.c (do_execve): Return EXIT_UNSUPPORTED in
+ parent if child exited in that manner. Print WEXITSTATUS
+ instead of the raw status.
+ (do_test_prep): Rename to do_test.
+ (do_test): Return the result of run_executable_sgid.
+ (TEST_FUNCTION_ARGV): Adjust.
+
2017-02-03 Alexandre Oliva <aoliva@redhat.com>
Florian Weimer <fweimer@redhat.com>
Carlos O'Donell <carlos@redhat.com>
2017-02-03 Alexandre Oliva <aoliva@redhat.com>
Florian Weimer <fweimer@redhat.com>
Carlos O'Donell <carlos@redhat.com>
+ if (WEXITSTATUS (status) == EXIT_UNSUPPORTED)
+ return EXIT_UNSUPPORTED;
+
if (!WIFEXITED (status) || WEXITSTATUS (status) != CHILD_STATUS)
{
printf ("Unexpected exit status %d from child process\n",
if (!WIFEXITED (status) || WEXITSTATUS (status) != CHILD_STATUS)
{
printf ("Unexpected exit status %d from child process\n",
-do_test_prep (int argc, char **argv)
+do_test (int argc, char **argv)
{
/* Setgid child process. */
if (argc == 2 && strcmp (argv[1], SETGID_CHILD) == 0)
{
/* Setgid child process. */
if (argc == 2 && strcmp (argv[1], SETGID_CHILD) == 0)
- if (run_executable_sgid (target) == 0)
- exit (0);
+ return run_executable_sgid (target);
}
/* Something went wrong and our argv was corrupted. */
_exit (1);
}
}
/* Something went wrong and our argv was corrupted. */
_exit (1);
}
-#define TEST_FUNCTION_ARGV do_test_prep
+#define TEST_FUNCTION_ARGV do_test
#include <support/test-driver.c>
#include <support/test-driver.c>