[LTP] [PATCH] setfsuid02: Rewrite using new LTP API

Avinesh Kumar akumar@suse.de
Thu Oct 27 09:47:48 CEST 2022


Hi Richie,

On Tuesday, October 25, 2022 1:29:36 PM IST Richard Palethorpe wrote:
> hello,
> 
> Avinesh Kumar <akumar@suse.de> writes:
> 
> > Rewrite using new API and add setfsuid(-1) call to verify that preceding
> > setfsuid() call with an invalid fsuid had failed.
> 
> Merged with a couple of changes.
> 
> > +	TST_EXP_VAL_SILENT(setfsuid(invalid_uid), current_uid);
> 
> Need to use the SETFSUID macro for 16-bit (as pvorel said).
> 
> > +	TST_EXP_VAL(setfsuid(-1), current_uid,
> > +				"setfsuid(invalid_fsuid) test for
> > expected failure:");
> 
> Substituted invalid_uid for -1 because -1 (UINT_MAX or USHORT_MAX) could
> be a valid UID AFAICT.

Thank you for review.
I used -1 as suggested in the manpage of setfsuid, which says setfsuid(-1) should
always fail. I have used the same for setfsgid test also.


Regards,
Avinesh







More information about the ltp mailing list