Skip to content

Commit

Permalink
[SPARK-5914] to run spark-submit requiring only user perm on windows
Browse files Browse the repository at this point in the history
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 <[email protected]>

Closes apache#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
  • Loading branch information
judynash authored and srowen committed Feb 26, 2015
1 parent e43139f commit 51a6f90
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/src/main/scala/org/apache/spark/util/Utils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}

/**
Expand Down

0 comments on commit 51a6f90

Please sign in to comment.