Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions core/src/main/scala/org/apache/spark/util/Utils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,6 @@ private[spark] object Utils extends Logging {
dir = new File(root, namePrefix + "-" + UUID.randomUUID.toString)
if (dir.exists() || !dir.mkdirs()) {
dir = null
} else {
// Restrict file permissions via chmod if available.
// For Windows this step is ignored.
if (!isWindows && !chmod700(dir)) {
dir.delete()
dir = null
}
}
} catch { case e: SecurityException => dir = null; }
}
Expand Down Expand Up @@ -702,7 +695,9 @@ private[spark] object Utils extends Logging {
try {
val rootDir = new File(root)
if (rootDir.exists || rootDir.mkdirs()) {
Some(createDirectory(root).getAbsolutePath())
val dir = createDirectory(root)
chmod700(dir)
Some(dir.getAbsolutePath)
} else {
logError(s"Failed to create dir in $root. Ignoring this directory.")
None
Expand Down