From: Avinesh Kumar <akumar@suse.de>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] setfsgid01: Rewrite using new LTP API
Date: Tue, 25 Oct 2022 12:07:29 +0530 [thread overview]
Message-ID: <2663736.mvXUDI8C0e@localhost> (raw)
In-Reply-To: <Y1MkHzCOXZYzomH/@pevik>
Hi Petr,
On Saturday, October 22, 2022 4:28:39 AM IST Petr Vorel wrote:
> Hi Avinesh,
>
> > Rewrite using new API and add test setfsgid(-1) which will always
> > fail but will determine if the preceding setfsgid() call changed
> > the filesystem group ID as expected.
> +1
>
> Thanks, merged with fix below.
>
> > - gid = getegid();
> > - GID16_CHECK(gid, setfsgid, cleanup);
> > -
> > - TEST(SETFSGID(cleanup, gid));
> > -
> > - if (TEST_RETURN == -1) {
> > - tst_resm(TFAIL | TTERRNO,
> > - "setfsgid() failed unexpectedly");
> > - continue;
> > - }
> > -
> > - if (TEST_RETURN != gid) {
> > - tst_resm(TFAIL, "setfsgid() returned %ld, expected %d",
> > - TEST_RETURN, gid);
> > - } else {
> > - tst_resm(TPASS,
> > - "setfsgid() returned expected value : %ld",
> > - TEST_RETURN);
> > - }
> > - }
> ...
> > + gid = getegid();
> > + GID16_CHECK(gid, setfsgid);
>
> > -static void cleanup(void)
> > -{
> > + SAFE_SETEUID(0);
> > + TST_EXP_VAL(setfsgid(nobody_gid), gid);
> > + TST_EXP_VAL(setfsgid(-1), nobody_gid);
> > + TST_EXP_VAL_SILENT(setfsgid(gid), nobody_gid);
>
> NOTE: all of these needed to be SETFSGID(), otherwise setfsgid01_16 would
> happily test 32-bit version instead of 16-bit version.
Thank you for this correction, will keep 16-bit thing in mind.
>
> Kind regards,
> Petr
>
Regards,
Avinesh
--
Mailing list info: https://lists.linux.it/listinfo/ltp
prev parent reply other threads:[~2022-10-25 6:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-12 6:49 [LTP] [PATCH] setfsgid01: Rewrite using new LTP API Avinesh Kumar
2022-10-21 22:58 ` Petr Vorel
2022-10-25 6:37 ` Avinesh Kumar [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2663736.mvXUDI8C0e@localhost \
--to=akumar@suse.de \
--cc=ltp@lists.linux.it \
--cc=pvorel@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox