[
https://issues.apache.org/jira/browse/HDFS-4983?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13838019#comment-13838019
]
Andrew Wang commented on HDFS-4983:
-----------------------------------
Hey Yongjun, thanks for providing the patch. A few review comments, mostly
nitty stuff, otherwise looks good.
It's worth checking out
http://blog.cloudera.com/blog/2013/05/how-to-configure-eclipse-for-hadoop-contributions/
to get the eclipse auto-formatter if you aren't using it yet, then these
things are mostly done for you:
{code}
//set user pattern based on configuration file
{code}
Usually we put a space between the slashes and the comment. I see the comment
below also lacks a space, you could add one there too if you like.
{code}
public static final String USER_PATTERN_KEY
= "webhdfs.user.provider.user.pattern";
/** Default user name pattern value */
public static final String USER_PATTERN_DEFAULT
= "^[A-Za-z_][A-Za-z0-9._-]*[$]?$";
{code}
We normally double indent wrapped lines.
In the new proxy user test, I think we can chop out the not-superuser and
permission stuff copied from the other test. Basically, doing any WebHDFS
operation with a numeric proxy user should suffice (but please do verify!).
> 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
>
>
> 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)