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

Colin Patrick McCabe updated HADOOP-10957:
------------------------------------------

    Attachment: HADOOP-10957.002.patch

v1 of this patch tried to remove the code described by this comment:
{code}
// If we get back only one result, this could be either a listing
// of a directory with one entry, or it could reflect the fact
// that what we listed resolved to a file.
//
// Unfortunately, we can't just compare the returned paths to
// figure this out.  Consider the case where you have /a/b, where
// b is a symlink to "..".  In that case, listing /a/b will give
// back "/a/b" again.  If we just went by returned pathname, we'd
// incorrectly conclude that /a/b was a file and should not match
// /a/*/*.  So we use getFileStatus of the path we just listed to
// disambiguate.
 {code}

Unfortunately, removing this code isn't possible.  In the presence of symlinks, 
the result of {{listStatus}} is simply ambiguous when it returns only one item. 
 Comparing paths won't work, because of the way symlinks play with paths.  The 
only way around this would be adding a new RPC (or a new option to the old 
{{listStatus}} RPC) that would let us know whether we listed a directory or 
file.

Anyway, v2 of the patch is super minimal.  It basically just adds a fix for the 
case where we tried to recurse into a file when handling a glob.  I also took 
the liberty of fixing two lines that had bad indentation in Globber.java, and 
avoiding the "no groups found for user" spew by adding this:

{code}
-      UserGroupInformation.createRemoteUser("myuser");
+    UserGroupInformation.createUserForTesting("myuser",
+        new String[] { "mygroup" });
{code}

> The globber will sometimes erroneously return a permission denied exception 
> when there is a non-terminal wildcard
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-10957
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10957
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 2.3.0
>            Reporter: Colin Patrick McCabe
>            Assignee: Colin Patrick McCabe
>         Attachments: HADOOP-10957.001.patch, HADOOP-10957.002.patch
>
>
> The globber will sometimes erroneously return a permission denied exception 
> when there is a non-terminal wildcard.  The existing unit tests don't catch 
> this, because it doesn't happen for superusers.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to