Skip to content

Commit 51a6f90

Browse files
judynashsrowen
authored andcommitted
[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 <[email protected]> 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
1 parent e43139f commit 51a6f90

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/src/main/scala/org/apache/spark/util/Utils.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,12 @@ private[spark] object Utils extends Logging {
440440
}
441441
// Make the file executable - That's necessary for scripts
442442
FileUtil.chmod(targetFile.getAbsolutePath, "a+x")
443+
444+
// Windows does not grant read permission by default to non-admin users
445+
// Add read permission to owner explicitly
446+
if (isWindows) {
447+
FileUtil.chmod(targetFile.getAbsolutePath, "u+r")
448+
}
443449
}
444450

445451
/**

0 commit comments

Comments
 (0)