[LTP] [PATCH] setregid: use common user and group names.

Cyril Hrubis chrubis@suse.cz
Thu May 3 16:17:32 CEST 2018

> > FIY this seems cause failures on Debian 9 where I do get failures:
> > setregid03    1  TBROK  :  setregid03.c:198: nobody must be a valid group
> > setregid03    2  TBROK  :  setregid03.c:198: Remaining cases broken
> > setregid04    1  TBROK  :  setregid04.c:126: Couldn't find the `nobody' group
> > setregid04    2  TBROK  :  setregid04.c:126: Remaining cases broken
> Debian has nogroup as group for nobody. Sorry that I overlooked it in "1b7cf9474".
> > I guess that we need a fallback if nobody group does not exist.
> Check for "nogroup"?

Let's just change the code to fallback to nogroup if group nobody does
not exist for the release and then we can think of an more elaborate

> Or allow to overwrite the group name with env. variable?
> BTW I wonder why we need more users than just nobody/nobody or nobody/nogroup.
> I'd be for having env. variable TST_USER and TST_GROUP, with helper, which would check for
> them if they're not defined (similar we use in tst_net.sh), so user wouldn't have to care
> for it.

I would rather go for adding some API to the test library that would
supply the test with useable user and group ids. Something as
.needs_user_id and .needs_group_id to the tst_test structure and then
put all the logic to the test library.

> BTW: code in IDcheck.sh expect difference in Debian, but that's useless (just to report
> it):
> if ! fe "nobody" "$passwd" || ! (fe "nogroup" "$group" || fe "nobody" "$group")
> then
> fi

We should probably get rid of IDcheck.sh I doubt that it's up-to-date
enough to be useful.

Cyril Hrubis

More information about the ltp mailing list