Repository: spark
Updated Branches:
  refs/heads/master e43139f40 -> 51a6f9097


[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 <judyn...@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


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/51a6f909
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/51a6f909
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/51a6f909

Branch: refs/heads/master
Commit: 51a6f9097bb475cb518ca766a46c7226640cf58e
Parents: e43139f
Author: Judy Nash <judyn...@microsoft.com>
Authored: Thu Feb 26 11:14:37 2015 +0000
Committer: Sean Owen <so...@cloudera.com>
Committed: Thu Feb 26 11:15:27 2015 +0000

----------------------------------------------------------------------
 core/src/main/scala/org/apache/spark/util/Utils.scala | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/51a6f909/core/src/main/scala/org/apache/spark/util/Utils.scala
----------------------------------------------------------------------
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 4803ff9..1396f16 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")
+    }
   }
 
   /**


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to