hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colin Patrick McCabe (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-13079) Add -q to fs -ls to print non-printable characters
Date Tue, 03 May 2016 16:24:13 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-13079?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15268981#comment-15268981
] 

Colin Patrick McCabe commented on HADOOP-13079:
-----------------------------------------------

Thank you for the background information.  I wasn't aware that the default of suppressing
non-printing characters was "optional" according to POSIX.

I think the important thing is that we've established that:
* Suppressing non-printing characters by default fixes several serious security vulnerabilties,
including some that have CVEs,
* This suppression behavior is explicitly allowed by POSIX,
* The most popular UNIX system on Earth, Linux, implements this behavior, so nobody will be
surprised by it.

bq. Essentially interactive sessions with stdin redirected \[falsely show up as non-interactive
from Java\]

I guess my concern about adding a JNI dependency here is that it will make things too nondeterministic.
 I've seen too many clusters where JNI was improperly configured.

> Add -q to fs -ls to print non-printable characters
> --------------------------------------------------
>
>                 Key: HADOOP-13079
>                 URL: https://issues.apache.org/jira/browse/HADOOP-13079
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: John Zhuge
>            Assignee: John Zhuge
>              Labels: supportability
>
> Add option {{-q}} to "hdfs dfs -ls" to print non-printable characters as "?". Non-printable
characters are defined by [isprint(3)|http://linux.die.net/man/3/isprint] according to the
current locale.
> Default to {{-q}} behavior on terminal; otherwise, print raw characters. See the difference
in these 2 command lines:
> * {{hadoop fs -ls /dir}}
> * {{hadoop fs -ls /dir | od -c}}
> In C, {{isatty(STDOUT_FILENO)}} is used to find out whether the output is a terminal.
Since Java doesn't have {{isatty}}, I will use JNI to call C {{isatty()}} because the closest
test {{System.console() == null}} does not work in some cases.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


Mime
View raw message