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

Rushabh S Shah commented on HDFS-12974:
---------------------------------------

bq.  This class <em>does not</em> provide the stack trace for security purposes.
Thanks [~zhenyi] for pointing that out. I totally missed that line while going 
through that code yesterday.

Still thinking whether {{StringUtils#stringifyException}} is the right place to 
fix.
{code:title=Throwable.java|borderStyle=solid}
    public String toString() {
        String s = getClass().getName();
        String message = getLocalizedMessage();
        return (message != null) ? (s + ": " + message) : s;
    }
{code}
If we can call {{Throwable#toString()}} from 
{{AuthorizationException#printStackTrace}}, then we will get class name and 
message and not the whole stack trace.
Something like this:
{code:title=AuthorizationException.java|borderStyle=solid}
 @Override
  public void printStackTrace() {
    printStackTrace(System.err);
  }

  @Override
  public void printStackTrace(PrintStream s) {
    // Do not provide the stack-trace
    s.println(((Throwable)this));
  }

  @Override
  public void printStackTrace(PrintWriter s) {
    s.println(((Throwable)this));
  }
{code}
[~xiaochen]: what do you think ?

> Exception information can not be returned when I create transparent 
> encryption zone.
> ------------------------------------------------------------------------------------
>
>                 Key: HDFS-12974
>                 URL: https://issues.apache.org/jira/browse/HDFS-12974
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: encryption
>    Affects Versions: 3.0.0
>            Reporter: fang zhenyi
>            Assignee: fang zhenyi
>            Priority: Minor
>         Attachments: HDFS-12974.001.patch, HDFS-12974.002.patch, 
> HDFS-12974.003.patch, HDFS-12974.004.patch, HDFS-12974.005.patch, 
> HDFS-12974.006.patch
>
>
> When I add the following configuration to the kms-acl.xml file, I create 
> encrypted space and I can not get any exception information.
> <property>
>   <name>key.acl.key2.GENERATE_EEK</name>
>   <value>mr</value>
> </property>
> root@fangzhenyi01:~# hdfs crypto -createZone -keyName key2 -path /zone
> 2018-01-02 10:41:44,632 WARN util.NativeCodeLoader: Unable to load 
> native-hadoop library for your platform... using builtin-java classes where 
> applicable
> RemoteException: 
> root@fangzhenyi01:~# 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to