hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiao Chen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-13030) KMS startup script failed to handle special characters
Date Mon, 18 Apr 2016 02:47:25 GMT

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

Xiao Chen commented on HADOOP-13030:
------------------------------------

Attached patch 01 to fix the issue.
Generally the problem is two fold:
- The {{sed}} line need to escape its sed-special chars({{\/&}}). 
- Since the output is an XML, xml-special chars also need to be escaped({{&'"<>}}).

The tarball attached is how I verified the fix. ({{test.sh}} contains only the relevant part
of the {{kms.sh}} script in patch 01)
Step I used to verify:
- extract tarball and cd to the dir
- {{source ./test-source.sh}}
- {{./test.sh}}
- Open up {{conf/ssl-server.xml}} in a browser and compare that to the passwords given in
test-source.sh. They're identical.

Special thanks to [~yoderme] for helping explain the issue and provide test data + fun reproduction.

> KMS startup script failed to handle special characters
> ------------------------------------------------------
>
>                 Key: HADOOP-13030
>                 URL: https://issues.apache.org/jira/browse/HADOOP-13030
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: kms
>    Affects Versions: 2.6.0
>            Reporter: Xiao Chen
>            Assignee: Xiao Chen
>         Attachments: HADOOP-13030-repro.tar.gz, HADOOP-13030.01.patch
>
>
> {{kms.sh}} currently cannot handle special characters.
> {code}
>  sed -e 's/_kms_ssl_keystore_pass_/'${KMS_SSL_KEYSTORE_PASS}'/g' \
>         -e 's/_kms_ssl_truststore_pass_/'${KMS_SSL_TRUSTSTORE_PASS}'/g' \
>         "${HADOOP_CATALINA_HOME}/conf/ssl-server.xml.conf" \
>         > "${HADOOP_CATALINA_HOME}/conf/ssl-server.xml"
> {code}



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

Mime
View raw message