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

Hyun Jay, Lee edited comment on AMBARI-19820 at 4/23/18 7:10 AM:
-----------------------------------------------------------------

I found forbidding codes of JS as follows.

[https://github.com/hortonworks/ambari-release/blob/AMBARI-2.5.2.0-298-tag/ambari-web/app/utils/validator.js#L181-L191]
{code:java}
$> vi /usr/lib/ambari-server/web/javascripts/app.js
…
190551   /**
190552    * validate key of configurations
190553    * allow spaces as prefix and suffix
190554    *
190555    * @param value
190556    * @return {Boolean}
190557    */
190558   isValidConfigKey: function(value) {
190559     var configKeyRegex = /^\s*[0-9a-z_\-\.\*\/]+\s*$/i;
190560     return configKeyRegex.test(value);
190561   },
…
{code}
And I tried after changing the above codes to allow '/' and found that it 
worked well.

However, it was applied to only the browser-side. And it didn't save the viewFS 
path to Ambari's database when I clicked 'Save' button.

I think other codes of server-side might still forbid user from setting '/'. :(

I'm not good at javascript and node.js. so, I hope some fluent user of node.js 
would resolve this.


was (Author: hyunjay.lee):
I found the forbidding code of JS as follows.
{code:java}
$> vi /usr/lib/ambari-server/web/javascripts/app.js
…
190551   /**
190552    * validate key of configurations
190553    * allow spaces as prefix and suffix
190554    *
190555    * @param value
190556    * @return {Boolean}
190557    */
190558   isValidConfigKey: function(value) {
190559     var configKeyRegex = /^\s*[0-9a-z_\-\.\*\/]+\s*$/i;
190560     return configKeyRegex.test(value);
190561   },
…
{code}
And I tried after changing the above codes and found that it worked well.

However, it was applied to only the browser-side. And it wasn't saved to 
Ambari's database when I clicked 'Save' button.

I think other codes of server-side would still forbid user from setting '/'. :(

I'm not good at node.js. so, I hope some fluent user of node.js would resolve 
this.

> ViewFS Support for Ambari
> -------------------------
>
>                 Key: AMBARI-19820
>                 URL: https://issues.apache.org/jira/browse/AMBARI-19820
>             Project: Ambari
>          Issue Type: Wish
>          Components: 2.2.1
>            Reporter: Keith Manthey
>            Priority: Minor
>
> Allow the creation of ViewFS mount points in the custom core-site.xml area 
> for HDFS.  Currently, the ViewFS mount points contain banned characters in 
> entry (/) for Ambari in the Key.  Example of a ViewFS mount point Key = 
> "fs.viewfs.mounttable.[zone].link./[mount]".  The value would be an IP / FQDN 
> with path ("hdfs://10.111.156.210:8020/user/")



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to