All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 2/2] Add chdir() test for unprivileged user
Date: Fri, 24 Jul 2020 17:32:05 +0200	[thread overview]
Message-ID: <20200724153205.GA28471@dell5510> (raw)
In-Reply-To: <08409821-c9d4-d8a6-3393-b33dfa79fea4@suse.cz>

Hi Martin,

> >> +++ b/runtest/syscalls
> >> @@ -54,6 +54,7 @@ capset04 capset04
> >>  cacheflush01 cacheflush01

> >>  chdir01 chdir01
> >> +chdir02 chdir02
> >>  chdir01A symlink01 -T chdir01
> >>  chdir04 chdir04
> > You missed to add chdir02 to runtest/quickhit. I guess this was deliberate,
> > right?
> > (I wonder if we really need runtest/quickhit anyway).

> Yes, this was deliberate since only chdir02 was there originally (the
> one that was checking only chdir("/"); and chdir("/etc");.
Understand, thanks for info.

> > I like both tests (nice work, thanks!), just don't like the duplicity. Isn't
> > there a way to use getopt parameter for one of the variants and have just single
> > test? But understand if you don't bother with it (maybe better duplicity but
> > simpler code).

> > Other that that LGTM.
> > Reviewed-by: Petr Vorel <pvorel@suse.cz>

> I could add a second set of expected values to the test case list and do
> it like this:

> static void run(unsigned int n) {
> 	TEST(chdir(tc->name));
> 	/* result validation here */
> 	SAFE_SETEUID(ltpuser->pw_uid);
> 	TEST(chdir(tc->name));
> 	SAFE_SETEUID(0);
> 	/* result validation here */
> }
LGTM, thank you!

> Should I resubmit that as v3?
Yes, please.

Kind regards,
Petr

      reply	other threads:[~2020-07-24 15:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-24 12:50 [LTP] [PATCH v2 1/2] Convert chdir01 to the new API Martin Doucha
2020-07-24 12:50 ` [LTP] [PATCH v2 2/2] Add chdir() test for unprivileged user Martin Doucha
2020-07-24 13:32   ` Petr Vorel
2020-07-24 14:47     ` Martin Doucha
2020-07-24 15:32       ` Petr Vorel [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=20200724153205.GA28471@dell5510 \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.