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, 29 Nov 2018 11:32:40 -0500
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Masami Hiramatsu <mhiramat@...nel.org>
Cc:     linux-kselftest@...r.kernel.org, shuah@...nel.org,
        Tom Zanussi <zanussi@...nel.org>, linux-kernel@...r.kernel.org,
        Daniel Díaz 
        <daniel.diaz@...aro.org>
Subject: Re: [PATCH] sefltests/ftrace: Use /bin/echo for output with options

On Fri, 30 Nov 2018 00:07:43 +0900
Masami Hiramatsu <mhiramat@...nel.org> wrote:

> Use /bin/echo for console output with options like non
> newline (-n) and/or backslash escape (-e).
> 
> Tom Zanussi reported that when he tested ftracetest, it
> shows "-e" and "-n" options on the console, since a system
> which uses dash as the alias of /bin/sh, uses dash built-in
> echo command which doesn't accept "-e".
> 
> To avoid this issue, use /bin/echo instead of echo for
> the output with options.
> 
> Fixes: 8f381ac4d321 ("selftests/ftrace: Add color to the PASS / FAIL results")
> Link: http://lkml.kernel.org/r/cover.1542221862.git.tom.zanussi@linux.intel.com
> Reported-by: Tom Zanussi <zanussi@...nel.org>
> Suggested-by: Tom Zanussi <zanussi@...nel.org>
> Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
> ---
>  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..ba670b452bdb 100755
> --- a/tools/testing/selftests/ftrace/ftracetest
> +++ b/tools/testing/selftests/ftrace/ftracetest
> @@ -173,8 +173,8 @@ strip_esc() {
>  }
>  
>  prlog() { # messages
> -  echo -e "$@"
> -  [ "$LOG_FILE" ] && echo -e "$@" | strip_esc >> $LOG_FILE
> +  /bin/echo -e "$@"
> +  [ "$LOG_FILE" ] && /bin/echo -e "$@" | strip_esc >> $LOG_FILE
>  }
>  catlog() { #file
>    cat $1

I'm fine with this change but I wonder if we should have a $ECHO that
is defined to something that can be overwritten if need be.

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

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ