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

Haohui Mai commented on HDFS-4983:
----------------------------------

My concern is why the flexibility is required in WebHDFS at all. Particularly, 
I'm concerned that the users hang themselves when they get this configuration 
wrong. For example, what does it mean if I making this configuration empty? 
Isn't a empty regex will reject all non-empty username? Suddenly the client 
can't create any files. In summary, I think that this change does bring in some 
configuration burdens.

Although I can definitely see that the value of using numbers as the usernames, 
as well as other use cased mentioned in HDFS-4733, I'm yet to be convinced that 
placing additional restrictions inside it. As I said before, WebHDFS is 
basically a DFSClient speaks HTTP protocols, its behavior should stay as close 
as the original DFSClient.

What about removing the checks from WebHDFS, and create a separate jira to 
support the user pattern in HDFS? I'm not worried about special characters 
since jersey takes care of all the escaping / unescaping automatically. It 
seems that this requires minimal amount of work, and it should solve all the 
use cases you guys have in mind.

> Numeric usernames do not work with WebHDFS FS
> ---------------------------------------------
>
>                 Key: HDFS-4983
>                 URL: https://issues.apache.org/jira/browse/HDFS-4983
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: webhdfs
>    Affects Versions: 2.0.0-alpha
>            Reporter: Harsh J
>            Assignee: Yongjun Zhang
>              Labels: patch
>         Attachments: HDFS-4983.001.patch, HDFS-4983.002.patch, 
> HDFS-4983.003.patch
>
>
> Per the file 
> hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/resources/UserParam.java,
>  the DOMAIN pattern is set to: {{^[A-Za-z_][A-Za-z0-9._-]*[$]?$}}.
> Given this, using a username such as "123" seems to fail for some reason 
> (tried on insecure setup):
> {code}
> [123@host-1 ~]$ whoami
> 123
> [123@host-1 ~]$ hadoop fs -fs webhdfs://host-2.domain.com -ls /
> -ls: Invalid value: "123" does not belong to the domain 
> ^[A-Za-z_][A-Za-z0-9._-]*[$]?$
> Usage: hadoop fs [generic options] -ls [-d] [-h] [-R] [<path> ...]
> {code}



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to