From 1de3c0e8b0923e306105cdf51f72873c840f5343 Mon Sep 17 00:00:00 2001 From: Judy Nash Date: Tue, 24 Feb 2015 00:29:53 -0800 Subject: [PATCH] [SPARK-5914] Enable spark-submit to run requiring only user permission on windows --- core/src/main/scala/org/apache/spark/util/Utils.scala | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 df21ed37e76b1..a3890e88b8e0a 100644 --- a/core/src/main/scala/org/apache/spark/util/Utils.scala +++ b/core/src/main/scala/org/apache/spark/util/Utils.scala @@ -439,7 +439,14 @@ private[spark] object Utils extends Logging { executeAndGetOutput(Seq("tar", "-xf", fileName), targetDir) } // Make the file executable - That's necessary for scripts - FileUtil.chmod(targetFile.getAbsolutePath, "a+x") + if(isWindows){ + // Windows does not grant read permission by default to non-admin users + // Add read permission to owner explicitly + FileUtil.chmod(targetFile.getAbsolutePath, "u+r") + FileUtil.chmod(targetFile.getAbsolutePath, "a+x") + } else { + FileUtil.chmod(targetFile.getAbsolutePath, "a+x") + } } /**