[LTP] [PATCH v2] setreuid04.c: Rewrite using new LTP API

Richard Palethorpe rpalethorpe@suse.de
Mon Jan 23 10:30:14 CET 2023


Hello,

Avinesh Kumar <akumar@suse.de> writes:

> +		TST_EXP_PASS(SETREUID(nobody_uid, nobody_uid));
>  
> -static void uid_verify(struct passwd *ru, struct passwd *eu, char *when)
> -{
> -	if ((getuid() != ru->pw_uid) || (geteuid() != eu->pw_uid)) {
> -		tst_resm(TFAIL, "ERROR: %s real uid = %d; effective uid = %d",
> -			 when, getuid(), geteuid());
> -		tst_resm(TINFO, "Expected: real uid = %d; effective uid = %d",
> -			 ru->pw_uid, eu->pw_uid);
> +		TST_EXP_EQ_LI(getuid(), nobody_uid);
> +		TST_EXP_EQ_LI(geteuid(), nobody_uid);

Forgot to use the macros for 16bit UIDS again. However we can fix that
before merge.

Reviewed-by: Richard Palethorpe <rpalethorpe@suse.com>

-- 
Thank you,
Richard.


More information about the ltp mailing list