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

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

bq. I don't think it makes sense to have this configurable in httpfs, but not 
in webhdfs. It would make it hard for people to migrate between the two when 
they need to. So I would argue that we should make this configurable for 
webhdfs as well. What do you think?

At the end of the day both of them are writing to HDFS using a DFSClient, thus 
their user patterns must be a subset of the patterns that HDFS allows.

Httpfs is a proxy, so it might make sense for the administrators to configure a 
more restrictive pattern.

WebHDFS, however, should be seen as a DFSClient that speaks HTTP protocol. It 
should follow the exact behavior of HDFS. Furthermore,  the new pattern is more 
generic than the default value of httpfs.user.provider.user.pattern, I doubt 
that someone will ever hit this issue during migration in practice. Does it 
make sense to you?

> 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