hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chen Liang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-11557) Empty directories may be recursively deleted without being listable
Date Fri, 31 Mar 2017 18:24:41 GMT

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

Chen Liang commented on HDFS-11557:
-----------------------------------

Interesting to see there seems to be a difference between "rm -r" and "rmdir"...But it seem
to work in my CentOS environment....
{code}
[testuser@c6401 ~]$ mkdir test/empty
[testuser@c6401 ~]$ chmod 222 test/empty
[testuser@c6401 ~]$ ls test/empty/
ls: cannot open directory test/empty/: Permission denied
[testuser@c6401 ~]$ rm -r test/empty/
[testuser@c6401 ~]$ ls test/
{code}
So I guess this behaviour might be undefined even for Linux systems...I tracked the code a
bit further, this behaviour in HDFS has been there for several years, changing this might
cause compatibility issues. Also this should not cause any security concerns because this
happens only when the directory is already empty. So I would prefer to just leave it like
what it is now, and just be aware of this behaviour.

> Empty directories may be recursively deleted without being listable
> -------------------------------------------------------------------
>
>                 Key: HDFS-11557
>                 URL: https://issues.apache.org/jira/browse/HDFS-11557
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs
>    Affects Versions: 2.7.3
>            Reporter: David Tucker
>            Assignee: Chen Liang
>
> To reproduce, create a directory without read and/or execute permissions (i.e. 0666,
0333, or 0222), then call delete on it with can_recurse=True. Note that the delete succeeds
even though the client is unable to check for emptiness and, therefore, cannot otherwise know
that any/all children are deletable.



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

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


Mime
View raw message