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]
Date:   Thu, 21 Feb 2019 19:24:37 -0500
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Shuah Khan <shuahkhan@...il.com>
Cc:     Masami Hiramatsu <mhiramat@...nel.org>,
        Juerg Haefliger <juerg.haefliger@...onical.com>,
        linux-kernel@...r.kernel.org, mingo@...hat.com,
        Juerg Haefliger <juergh@...onical.com>
Subject: Re: [PATCH] selftests/ftrace: Handle the absence of tput

On Fri, 22 Feb 2019 09:05:34 +0900
Masami Hiramatsu <mhiramat@...nel.org> wrote:

> On Wed, 20 Feb 2019 16:37:06 +0100
> Juerg Haefliger <juerg.haefliger@...onical.com> wrote:
> 
> > In environments where tput is not availbale, we get the following
> > error
> > $ ./ftracetest: 163: [: Illegal number:
> > because ncolors is an empty string. Fix that by setting it to 0 if the
> > tput command fails.
> > 
> > Signed-off-by: Juerg Haefliger <juergh@...onical.com>  
> 
> Looks good to me.
> 
> Acked-by: Masami Hiramatsu <mhiramat@...nel.org>

Acked-by: Steven Rostedt (VMware) <rostedt@...dmis.org>

Shuah,

Want to take this?

 https://lore.kernel.org/lkml/20190220153706.24686-1-juergh@canonical.com/T/#u

-- Steve

> 
> Thank you!
> 
> > ---
> >  tools/testing/selftests/ftrace/ftracetest | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
> > index 75244db70331..fc755e1b50f1 100755
> > --- a/tools/testing/selftests/ftrace/ftracetest
> > +++ b/tools/testing/selftests/ftrace/ftracetest
> > @@ -154,13 +154,13 @@ fi
> >  
> >  # Define text colors
> >  # Check available colors on the terminal, if any
> > -ncolors=`tput colors 2>/dev/null`
> > +ncolors=`tput colors 2>/dev/null || echo 0`
> >  color_reset=
> >  color_red=
> >  color_green=
> >  color_blue=
> >  # If stdout exists and number of colors is eight or more, use them
> > -if [ -t 1 -a "$ncolors" -a "$ncolors" -ge 8 ]; then
> > +if [ -t 1 -a "$ncolors" -ge 8 ]; then
> >    color_reset="\e[0m"
> >    color_red="\e[31m"
> >    color_green="\e[32m"
> > -- 
> > 2.19.1
> >   
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ