[LTP] [PATCH 1/1] setregid: Fallback to `nogroup' group

Petr Vorel pvorel@suse.cz
Fri May 4 16:58:28 CEST 2018


Hi,

> Hi!
> > -	GET_GID(nobody);
> > +#define GET_GID_FALLBACK(group, group2) do { \
> > +	junk = getgrnam(#group); \
> > +	if (junk == NULL) { \
> > +		tst_resm(TINFO, "%s not found, trying fallback %s", #group, #group2); \
> > +		junk = getgrnam(#group2); \
> > +		if (junk == NULL) { \
> > +			tst_brkm(TBROK, NULL, "%s or %s must be a valid group", #group, #group2); \
> > +		} \
> > +	} \
> > +	GID16_CHECK(junk->gr_gid, setregid, NULL); \
> > +	group ## _gr = *(junk); \
> > +} while (0)
> > +
> > +	GET_GID_FALLBACK(nobody, nogroup);

> Uh this macros are ugly, but then the original is is ugly as well.

> So let's get this in for the release to keep the amount of changes
> minimal if you promise to clean it up after the release is finalized :-).
Agree, these tests needs to be rewritten + cleanup + remove duplicity.
Right, I'll do it :).
Thanks for ack.

Kind regards,
Petr


More information about the ltp mailing list