[LTP] [PATCH v2] syscalls/setregid02: Fix retrieving a group of user "nobody"
Yuriy Kolerov
Yuriy.Kolerov at synopsys.com
Tue Oct 6 13:45:47 UTC 2015
Oh god. Sorry, I've sent this patch to the wrong mailing list. Ignore it please.
Regards,
Yuriy Kolerov
> -----Original Message-----
> From: Yuriy Kolerov [mailto:yuriy.kolerov at synopsys.com]
> Sent: Tuesday, October 06, 2015 4:42 PM
> To: uclibc at uclibc.org
> Cc: chrubis at suse.cz; Vineet Gupta; Alexey Brodkin; Anton Kolesov; Yuriy
> Kolerov
> Subject: [LTP] [PATCH v2] syscalls/setregid02: Fix retrieving a group of user
> "nobody"
>
>
> In setup this test sets UID and GID of the user "nobody". Then it expects that
> user "nobody" is in group "nobody" and tries to retrive a structure for group
> "nobody" using getgrnam(). However some Linux distributions use group
> "nogroup" for user "nobody".
> Thus it's necessary to retrieve a group of user "nobody" not by hardcoded
> name but by its GID. It's necessary because group "nobody" may not exist.
>
> I've replaced a variable "nobody" by more generic "ltpgroup".
> Then I've created 2 functions get_group_by_name and get_group_by_gid
> which are used instead of GET_GID macros.
>
> On my test system I have user "nobody" in group "nogroup". So I've got this
> error messages for this test:
>
> ----------->8----------
> setregid02.c:160: getgrnam("nobody") failed: errno=SUCCESS(0): Success
> setregid02.c:160: Remaining cases broken
> ----------->8----------
>
> Signed-off-by: Yuriy Kolerov <yuriy.kolerov at synopsys.com>
> ---
> testcases/kernel/syscalls/setregid/setregid02.c | 53 +++++++++++++++-----
> -----
> 1 file changed, 32 insertions(+), 21 deletions(-)
More information about the uClibc
mailing list