Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2323D11EAF for ; Wed, 30 Apr 2014 19:26:25 +0000 (UTC) Received: (qmail 33175 invoked by uid 500); 30 Apr 2014 19:26:22 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 33066 invoked by uid 500); 30 Apr 2014 19:26:22 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 32943 invoked by uid 99); 30 Apr 2014 19:26:21 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Apr 2014 19:26:21 +0000 Date: Wed, 30 Apr 2014 19:26:21 +0000 (UTC) From: "Hadoop QA (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-6165) "hdfs dfs -rm -r" and "hdfs -rmdir" commands can't remove empty directory MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-6165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13985954#comment-13985954 ] Hadoop QA commented on HDFS-6165: --------------------------------- {color:red}-1 overall{color}. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12642655/HDFS-6165.006.patch against trunk revision . {color:green}+1 @author{color}. The patch does not contain any @author tags. {color:green}+1 tests included{color}. The patch appears to include 3 new or modified test files. {color:green}+1 javac{color}. The applied patch does not increase the total number of javac compiler warnings. {color:green}+1 javadoc{color}. There were no new javadoc warning messages. {color:green}+1 eclipse:eclipse{color}. The patch built with eclipse:eclipse. {color:green}+1 findbugs{color}. The patch does not introduce any new Findbugs (version 1.3.9) warnings. {color:green}+1 release audit{color}. The applied patch does not increase the total number of release audit warnings. {color:red}-1 core tests{color}. The patch failed these unit tests in hadoop-common-project/hadoop-common hadoop-hdfs-project/hadoop-hdfs: org.apache.hadoop.metrics2.impl.TestMetricsSystemImpl {color:green}+1 contrib tests{color}. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/6777//testReport/ Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/6777//console This message is automatically generated. > "hdfs dfs -rm -r" and "hdfs -rmdir" commands can't remove empty directory > -------------------------------------------------------------------------- > > Key: HDFS-6165 > URL: https://issues.apache.org/jira/browse/HDFS-6165 > Project: Hadoop HDFS > Issue Type: Bug > Components: hdfs-client > Affects Versions: 2.3.0 > Reporter: Yongjun Zhang > Assignee: Yongjun Zhang > Priority: Minor > Attachments: HDFS-6165.001.patch, HDFS-6165.002.patch, HDFS-6165.003.patch, HDFS-6165.004.patch, HDFS-6165.004.patch, HDFS-6165.005.patch, HDFS-6165.006.patch, HDFS-6165.006.patch > > > Given a directory owned by user A with WRITE permission containing an empty directory owned by user B, it is not possible to delete user B's empty directory with either "hdfs dfs -rm -r" or "hdfs dfs -rmdir". Because the current implementation requires FULL permission of the empty directory, and throws exception. > On the other hand, on linux, "rm -r" and "rmdir" command can remove empty directory as long as the parent directory has WRITE permission (and prefix component of the path have EXECUTE permission), For the tested OSes, some prompt user asking for confirmation, some don't. > Here's a reproduction: > {code} > [root@vm01 ~]# hdfs dfs -ls /user/ > Found 4 items > drwxr-xr-x - userabc users 0 2013-05-03 01:55 /user/userabc > drwxr-xr-x - hdfs supergroup 0 2013-05-03 00:28 /user/hdfs > drwxrwxrwx - mapred hadoop 0 2013-05-03 00:13 /user/history > drwxr-xr-x - hdfs supergroup 0 2013-04-14 16:46 /user/hive > [root@vm01 ~]# hdfs dfs -ls /user/userabc > Found 8 items > drwx------ - userabc users 0 2013-05-02 17:00 /user/userabc/.Trash > drwxr-xr-x - userabc users 0 2013-05-03 01:34 /user/userabc/.cm > drwx------ - userabc users 0 2013-05-03 01:06 /user/userabc/.staging > drwxr-xr-x - userabc users 0 2013-04-14 18:31 /user/userabc/apps > drwxr-xr-x - userabc users 0 2013-04-30 18:05 /user/userabc/ds > drwxr-xr-x - hdfs users 0 2013-05-03 01:54 /user/userabc/foo > drwxr-xr-x - userabc users 0 2013-04-30 16:18 /user/userabc/maven_source > drwxr-xr-x - hdfs users 0 2013-05-03 01:40 /user/userabc/test-restore > [root@vm01 ~]# hdfs dfs -ls /user/userabc/foo/ > [root@vm01 ~]# sudo -u userabc hdfs dfs -rm -r -skipTrash /user/userabc/foo > rm: Permission denied: user=userabc, access=ALL, inode="/user/userabc/foo":hdfs:users:drwxr-xr-x > {code} > The super user can delete the directory. > {code} > [root@vm01 ~]# sudo -u hdfs hdfs dfs -rm -r -skipTrash /user/userabc/foo > Deleted /user/userabc/foo > {code} > The same is not true for files, however. They have the correct behavior. > {code} > [root@vm01 ~]# sudo -u hdfs hdfs dfs -touchz /user/userabc/foo-file > [root@vm01 ~]# hdfs dfs -ls /user/userabc/ > Found 8 items > drwx------ - userabc users 0 2013-05-02 17:00 /user/userabc/.Trash > drwxr-xr-x - userabc users 0 2013-05-03 01:34 /user/userabc/.cm > drwx------ - userabc users 0 2013-05-03 01:06 /user/userabc/.staging > drwxr-xr-x - userabc users 0 2013-04-14 18:31 /user/userabc/apps > drwxr-xr-x - userabc users 0 2013-04-30 18:05 /user/userabc/ds > -rw-r--r-- 1 hdfs users 0 2013-05-03 02:11 /user/userabc/foo-file > drwxr-xr-x - userabc users 0 2013-04-30 16:18 /user/userabc/maven_source > drwxr-xr-x - hdfs users 0 2013-05-03 01:40 /user/userabc/test-restore > [root@vm01 ~]# sudo -u userabc hdfs dfs -rm -skipTrash /user/userabc/foo-file > Deleted /user/userabc/foo-file > {code} > Using "hdfs dfs -rmdir" command: > {code} > bash-4.1$ hadoop fs -lsr / > lsr: DEPRECATED: Please use 'ls -R' instead. > drwxr-xr-x - hdfs supergroup 0 2014-03-25 16:29 /user > drwxr-xr-x - hdfs supergroup 0 2014-03-25 16:28 /user/hdfs > drwxr-xr-x - usrabc users 0 2014-03-28 23:39 /user/usrabc > drwxr-xr-x - abc abc 0 2014-03-28 23:39 /user/usrabc/foo-empty1 > [root@vm01 usrabc]# su usrabc > [usrabc@vm01 ~]$ hdfs dfs -rmdir /user/usrabc/foo-empty1 > rmdir: Permission denied: user=usrabc, access=ALL, inode="/user/usrabc/foo-empty1":abc:abc:drwxr-xr-x > {code} -- This message was sent by Atlassian JIRA (v6.2#6252)