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

Pierre Villard commented on HDFS-11391:
---------------------------------------

Hi [~yzhangal],

No problem, I updated the PR.

Regarding the tests:

- *Before patch (with property modified to allow numerical user names)*

{noformat}
$ curl -i -X PUT 
"http://mynode:50070/webhdfs/v1/tmp/test.txt?op=CREATE&user.name=123";
HTTP/1.1 307 TEMPORARY_REDIRECT
Cache-Control: no-cache
Expires: Sat, 04 Feb 2017 10:19:38 GMT
Date: Sat, 04 Feb 2017 10:19:38 GMT
Pragma: no-cache
Expires: Sat, 04 Feb 2017 10:19:38 GMT
Date: Sat, 04 Feb 2017 10:19:38 GMT
Pragma: no-cache
X-FRAME-OPTIONS: SAMEORIGIN
Set-Cookie: 
hadoop.auth="u=123&p=123&t=simple&e=1486239578624&s=UrzCjP0SPpPKDJnSYB5BsKuQVKc=";
 Path=/; HttpOnly
Location: 
http://mynode:50075/webhdfs/v1/tmp/test.txt?op=CREATE&user.name=123&namenoderpcaddress=mynode:8020&createflag=&createparent=true&overwrite=false
Content-Type: application/octet-stream
Content-Length: 0

$ curl -i -X PUT -T test.txt 
"http://mynode:50075/webhdfs/v1/tmp/test.txt?op=CREATE&user.name=123&namenoderpcaddress=mynode:8020&createflag=&createparent=true&overwrite=false";
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
Content-Length: 209
Connection: close

{"RemoteException":{"exception":"IllegalArgumentException","javaClassName":"java.lang.IllegalArgumentException","message":"Invalid
 value: \"123\" does not belong to the domain ^[A-Za-z_][A-Za-z0-9._-]*[$]?$"}}
{noformat}

- *After patch (with property modified to allow numerical user names)*

{noformat}
$ curl -i -X PUT 
"http://mynode:50070/webhdfs/v1/tmp/test.txt?op=CREATE&user.name=123";
HTTP/1.1 307 TEMPORARY_REDIRECT
Cache-Control: no-cache
Expires: Sat, 04 Feb 2017 20:25:15 GMT
Date: Sat, 04 Feb 2017 20:25:15 GMT
Pragma: no-cache
Expires: Sat, 04 Feb 2017 20:25:15 GMT
Date: Sat, 04 Feb 2017 20:25:15 GMT
Pragma: no-cache
X-FRAME-OPTIONS: SAMEORIGIN
Set-Cookie: 
hadoop.auth="u=123&p=123&t=simple&e=1486275915563&s=te9ylMEmTuFswBr2sK9kH6qj8eE=";
 Path=/; HttpOnly
Location: 
http://mynode:50075/webhdfs/v1/tmp/test.txt?op=CREATE&user.name=123&namenoderpcaddress=mynode:8020&createflag=&createparent=true&overwrite=false
Content-Type: application/octet-stream
Content-Length: 0

$ curl -i -X PUT -T test.txt 
"http://mynode:50075/webhdfs/v1/tmp/test.txt?op=CREATE&user.name=123&namenoderpcaddress=mynode:8020&createflag=&createparent=true&overwrite=false";
HTTP/1.1 100 Continue

HTTP/1.1 201 Created
Location: hdfs://mynode:8020/tmp/test.txt
Content-Length: 0
Connection: close
{noformat}

Let me know if you need something else.

> Numeric usernames do no work with WebHDFS FS (write access)
> -----------------------------------------------------------
>
>                 Key: HDFS-11391
>                 URL: https://issues.apache.org/jira/browse/HDFS-11391
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: webhdfs
>    Affects Versions: 2.7.3
>            Reporter: Pierre Villard
>
> In HDFS-4983, a property has been introduced to configure the pattern 
> validating name of users interacting with WebHDFS because default pattern was 
> excluding names starting with numbers.
> Problem is that this fix works only for read access. In case of write access 
> against data node, the default pattern is still applied whatever the 
> configuration is.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to