[PATCH 2/2] io: Add setuid tests for faccessat
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Wed Nov 6 17:26:05 GMT 2024
On 06/11/24 12:13, Siddhesh Poyarekar wrote:
> On 2024-11-06 10:09, Adhemerval Zanella Netto wrote:
>>
>>
>> On 16/10/24 16:21, Siddhesh Poyarekar wrote:
>>> Add a new test tst-faccessat-setuid that iterates through real and
>>> effective UID/GID combination and tests the faccessat() interface for
>>> default and AT_EACCESS flags.
>>>
>>> Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
>>> ---
>>> io/Makefile | 4 +
>>> io/tst-faccessat-setuid.c | 163 ++++++++++++++++++++++++++++++++++++++
>>> 2 files changed, 167 insertions(+)
>>> create mode 100644 io/tst-faccessat-setuid.c
>>>
>>> diff --git a/io/Makefile b/io/Makefile
>>> index a8d575e9ce..3ae26a5aa3 100644
>>> --- a/io/Makefile
>>> +++ b/io/Makefile
>>> @@ -232,6 +232,10 @@ tests := \
>>> tst-utimes \
>>> # tests
>>> +xtests := \
>>> + tst-faccessat-setuid \
>>> + #xtests
>>> +
>>
>> Can't we use support_become_root and make it a container test? It became
>> moot to add a new xtests, since it is not usually tested on make check
>> and not everyone knows about the make xcheck.
>>
>
> The test needs multiple user and group combinations, which doesn't seem to be something tests-container can provide. Does it make sense instead to add this as a `test` and bail out as UNSUPPORTED if it's not run as root? That way users know that the test is being skipped over, similar to how we do setuid tests.
Right, I was hoping that it would be easier but it seems that we will
need to add some support on test-container for extra uid/gid mapping.
Bailing as unsupported in this case is fine.
More information about the Libc-alpha
mailing list