aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorJudy Nash <judynash@microsoft.com>2015-02-26 11:14:37 +0000
committerSean Owen <sowen@cloudera.com>2015-02-26 11:15:27 +0000
commit51a6f9097bb475cb518ca766a46c7226640cf58e (patch)
tree6b63b5ceb6a41b805635fa8f624211d65c911995 /core
parente43139f40309995b1133c7ef2936ab858b7b44fc (diff)
downloadspark-51a6f9097bb475cb518ca766a46c7226640cf58e.tar.gz
spark-51a6f9097bb475cb518ca766a46c7226640cf58e.tar.bz2
spark-51a6f9097bb475cb518ca766a46c7226640cf58e.zip
[SPARK-5914] to run spark-submit requiring only user perm on windows
Because windows on-default does not grant read permission to jars except to admin, spark-submit would fail with "ClassNotFound" exception if user runs slave service with only user permission. This fix is to add read permission to owner of the jar (which would be the slave service account in windows ) Author: Judy Nash <judynash@microsoft.com> Closes #4742 from judynash/SPARK-5914 and squashes the following commits: e288e56 [Judy Nash] Fix spacing and refactor code 1de3c0e [Judy Nash] [SPARK-5914] Enable spark-submit to run requiring only user permission on windows
Diffstat (limited to 'core')
-rw-r--r--core/src/main/scala/org/apache/spark/util/Utils.scala6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/src/main/scala/org/apache/spark/util/Utils.scala b/core/src/main/scala/org/apache/spark/util/Utils.scala
index 4803ff9403..1396f167eb 100644
--- a/core/src/main/scala/org/apache/spark/util/Utils.scala
+++ b/core/src/main/scala/org/apache/spark/util/Utils.scala
@@ -440,6 +440,12 @@ private[spark] object Utils extends Logging {
}
// Make the file executable - That's necessary for scripts
FileUtil.chmod(targetFile.getAbsolutePath, "a+x")
+
+ // Windows does not grant read permission by default to non-admin users
+ // Add read permission to owner explicitly
+ if (isWindows) {
+ FileUtil.chmod(targetFile.getAbsolutePath, "u+r")
+ }
}
/**