Skip to content

Commit

Permalink
[SPARK-5914] Enable spark-submit to run requiring only user permissio…
Browse files Browse the repository at this point in the history
…n on windows
  • Loading branch information
judynash committed Feb 24, 2015
1 parent 1ed5708 commit 1de3c0e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/src/main/scala/org/apache/spark/util/Utils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}

/**
Expand Down

0 comments on commit 1de3c0e

Please sign in to comment.