[
https://issues.apache.org/jira/browse/HDFS-9875?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15177352#comment-15177352
]
Costin Leau commented on HDFS-9875:
-----------------------------------
1. I haven't tried {webhdfs}} simply because it is not an option; for stronger
guarantees, the code is based on {{FileContext}} and {{hdfs://}} instead of
{{webhdfs://}}, even more so since it might not be always enabled.
2. It's posted in the description link:
{code}
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1016)
at org.apache.hadoop.util.Shell.runCommand(Shell.java:486)
at org.apache.hadoop.util.Shell.run(Shell.java:456)
at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:722)
at org.apache.hadoop.util.Shell.isSetsidSupported(Shell.java:391)
at org.apache.hadoop.util.Shell.<clinit>(Shell.java:381)
{code}
The current problematic field is
[{{isSetsidAvailable}}|https://github.com/apache/hadoop/blob/0fa54d45b1cf8a29f089f64d24f35bd221b4803f/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java#L728]
> HDFS client requires compromising permission when running under JVM security
> manager
> ------------------------------------------------------------------------------------
>
> Key: HDFS-9875
> URL: https://issues.apache.org/jira/browse/HDFS-9875
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: hdfs-client, security
> Affects Versions: 2.7.2
> Environment: Linux
> Reporter: Costin Leau
>
> HDFS _client_ requires dangerous permission, in particular _execute_ on _all
> files_ despite only trying to connect to an HDFS cluster.
> A full list (for both Hadoop 1 and 2) is available here along with the place
> in code where they occur.
> While it is understandable for some permissions to be used, requiring
> {{FilePermission <<ALL FILES>> execute}} to simply initialize a class field
> [Shell|https://github.com/apache/hadoop/blob/0fa54d45b1cf8a29f089f64d24f35bd221b4803f/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java#L728]
> which in the end is not used (since it's just a client) simply *compromises*
> the entire security system.
> To make matters worse, the code is executed to initialize a field so in case
> the permissions is not granted, the VM fails with {{InitializationError}}
> which is unrecoverable.
> Ironically enough, on Windows this problem does not appear since the code
> simply bypasses it and initializes the field with a fall back value
> ({{false}}).
> A quick fix would be to simply take into account that the JVM
> {{SecurityManager}} might be active and the permission not granted or that
> the external process fails and use a fall back value.
> A proper and long-term fix would be to minimize the use of permissions for
> hdfs client since it is simply not required. A client should be as light as
> possible and not have the server requirements leaked onto.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)