[ 
https://issues.apache.org/jira/browse/HDFS-12873?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Raeanne J Marks updated HDFS-12873:
-----------------------------------
    Description: 
Start with a fresh deployment of HDFS.
1. `Mkdirs '/x/y/z'`
2. use `GetFileInfo` to get y's inode number
3. `Mkdirs '/.reserved/.inodes/<y's inode number>/z/../foo'`

Expectation: The path in step 3 is rejected as invalid (exception thrown) OR 
`foo` would be created under `y`.

Observation: This created a directory called `..` under `z` and `foo` under 
that `..` directory instead of consolidating the path to `/x/y/foo` or throwing 
an exception. `GetListing` on `/.reserved/.inodes/<z's inode number>` shows 
`..`, while `GetListing` on `/x/y` does not.

`Mkdirs` INotify events were reported with the following paths, in order:
```
/x
/x/y
/x/y/z
/x/y/z/..
/x/y/z/../foo
```
I can also chain these dotdot directories and make them as deep as I want. 
`Mkdirs` works with the following paths appended to the inode path for 
directory `y`: `/z/../../../foo`, `/z/../../../../../`, 
`/z/../../../foo/bar/../..` etc, and it constructs all the `..` directories as 
if they weren't special names.


  was:
Start with a fresh deployment of HDFS.
1. Mkdirs '/x/y/z'
2. use GetFileInfo to get y's inode number
3. Mkdirs '/.reserved/.inodes/<y's inode number>/z/../foo'

Expectation: The path in step 3 is rejected as invalid (exception thrown) OR 
foo would be created under y.

Observation: This created a directory called '..' under z and 'foo' under that 
'..' directory instead of consolidating the path to '/x/y/foo' or throwing an 
exception. GetListing on '/.reserved/.inodes/<z's inode number>' shows '..', 
while GetListing on '/x/y' does not.

Mkdirs INotify events were reported with the following paths, in order:
/x
/x/y
/x/y/z
/x/y/z/..
/x/y/z/../foo

I can also chain these dotdot directories and make them as deep as I want. 
Mkdirs works with the following paths appended to the inode path for directory 
y: '/z/../../../foo', '/z/../../../../../', '/z/../../../foo/bar/../..' etc, 
and it constructs all the '..' directories as if they weren't special names.



> Creating a '..' directory is possible using inode paths
> -------------------------------------------------------
>
>                 Key: HDFS-12873
>                 URL: https://issues.apache.org/jira/browse/HDFS-12873
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs, namenode
>    Affects Versions: 2.8.0
>         Environment: Apache NameNode running in a Docker container on a 
> Fedora 25 workstation.
>            Reporter: Raeanne J Marks
>
> Start with a fresh deployment of HDFS.
> 1. `Mkdirs '/x/y/z'`
> 2. use `GetFileInfo` to get y's inode number
> 3. `Mkdirs '/.reserved/.inodes/<y's inode number>/z/../foo'`
> Expectation: The path in step 3 is rejected as invalid (exception thrown) OR 
> `foo` would be created under `y`.
> Observation: This created a directory called `..` under `z` and `foo` under 
> that `..` directory instead of consolidating the path to `/x/y/foo` or 
> throwing an exception. `GetListing` on `/.reserved/.inodes/<z's inode 
> number>` shows `..`, while `GetListing` on `/x/y` does not.
> `Mkdirs` INotify events were reported with the following paths, in order:
> ```
> /x
> /x/y
> /x/y/z
> /x/y/z/..
> /x/y/z/../foo
> ```
> I can also chain these dotdot directories and make them as deep as I want. 
> `Mkdirs` works with the following paths appended to the inode path for 
> directory `y`: `/z/../../../foo`, `/z/../../../../../`, 
> `/z/../../../foo/bar/../..` etc, and it constructs all the `..` directories 
> as if they weren't special names.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
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