lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YNIjtOSoj+aWnQns@kernel.org>
Date:   Tue, 22 Jun 2021 14:53:56 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Ian Rogers <irogers@...gle.com>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Song Liu <songliubraving@...com>,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
        bpf@...r.kernel.org
Subject: Re: [PATCH v2 1/3] perf test: Pass the verbose option to shell tests

Em Tue, Jun 22, 2021 at 02:45:51PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Mon, Jun 21, 2021 at 02:56:46PM -0700, Ian Rogers escreveu:
> > Having a verbose option will allow shell tests to provide extra failure
> > details when the fail or skip.
> > 
> > Signed-off-by: Ian Rogers <irogers@...gle.com>
> > ---
> >  tools/perf/tests/builtin-test.c | 7 +++++--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> > 
> > diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
> > index cbbfe48ab802..e1ed60567b2f 100644
> > --- a/tools/perf/tests/builtin-test.c
> > +++ b/tools/perf/tests/builtin-test.c
> > @@ -577,10 +577,13 @@ struct shell_test {
> >  static int shell_test__run(struct test *test, int subdir __maybe_unused)
> >  {
> >  	int err;
> > -	char script[PATH_MAX];
> > +	char script[PATH_MAX + 3];
> 
> This looks strange, i.e. if it is a _path_ _MAX_, why add 3 chars past
> that max when generating a _path_? I'll drop the above hunk and keep the
> rest, ok?

Oh well, its not a path after all, its something that is passed to
system(), the use of PATH_MAX seems arbitrary, so your patch wasn't
wrong, but since it is arbitrary, I'll keep it at PATH_MAX and reduce
the patch size 8-)

- Arnaldo

> >  	struct shell_test *st = test->priv;
> >  
> > -	path__join(script, sizeof(script), st->dir, st->file);
> > +	path__join(script, sizeof(script) - 3, st->dir, st->file);
> > +
> > +	if (verbose)
> > +		strncat(script, " -v", sizeof(script) - strlen(script) - 1);
> >  
> >  	err = system(script);
> >  	if (!err)

-- 

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ