[PATCH] tunables: Fail tests correctly when setgid does not work

Carlos O'Donell carlos@redhat.com
Sat Feb 4 01:07:00 GMT 2017


On Thu, Feb 2, 2017 at 1:31 PM, Siddhesh Poyarekar
<siddhesh@sourceware.org> wrote:
> 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.

This works as expected.

Both tests are now UNSUPPORTED on my system where /tmp is mounted as nosuid.

For this test to pass I need to use a TMPDIR which is not nosuid.

Cheers,
Carlos.



More information about the Libc-alpha mailing list