[ 
https://issues.apache.org/jira/browse/HADOOP-3953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662135#action_12662135
 ] 

Tsz Wo (Nicholas), SZE commented on HADOOP-3953:
------------------------------------------------

- The changes in FSDirectory should be reverted since the case is already taken 
care in INodeFile.

- For the unit tests, leaving empty catch block is generally a bad practice 
since there might be some unexpected exceptions.  For example, in the codes 
below, it is correct only if ioe is a sticky bit related exception.  It is 
incorrect if some other IOException like FileNotFoundException is thrown.
{code}
+      try {
+        hdfs.rename(file, new Path(tmpPath2, "renamed"));
+        fail("Shouldn't be able to rename someone else's file with SB on");
+      } catch (IOException ioe) {
+        // Correct
+      }
{code}
It would be great if you can combine some of them together, so that they take 
less execution time.  I am fine if you don't want to change the tests although 
I strongly recommend to do so.

Sorry for not seeing these problems in my previous review.

> Sticky bit for directories
> --------------------------
>
>                 Key: HADOOP-3953
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3953
>             Project: Hadoop Core
>          Issue Type: Improvement
>          Components: dfs
>            Reporter: Koji Noguchi
>            Assignee: Jakob Homan
>         Attachments: HADOOP-3953.patch, HADOOP-3953.patch, HADOOP-3953.patch
>
>
> Our users (especially Pig) heavily use /tmp for temporary storage. 
> Permission are set to 777.
> However, this means any users can rename and also remove (by moving to 
> .Trash) other users directories and files.
> It would be nice if we can have a sticky bit like unix. 
> Copy&Pasted from manpage.
> STICKY DIRECTORIES
>        When  the  sticky  bit  is set on a directory, files in that directory 
> may be unlinked or renamed only by
>        root or their owner.  Without the sticky bit, anyone able to write to 
> the directory can delete or  rename
>        files.  The sticky bit is commonly found on directories, such as /tmp, 
> that are world-writable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to