Kimahriman commented on a change in pull request #35085:
URL: https://github.com/apache/spark/pull/35085#discussion_r786892744



##########
File path: core/src/main/scala/org/apache/spark/util/Utils.scala
##########
@@ -2742,6 +2743,16 @@ private[spark] object Utils extends Logging {
     new File(path.getAbsolutePath + "." + UUID.randomUUID())
   }
 
+  /**
+   * Creates a file with group write permission.
+   */
+  def createFileAsGroupWritable(file: File): Unit = {
+    val perms = PosixFilePermissions.fromString("rw-rw----")
+    val path = file.toPath
+    Files.createFile(path)
+    Files.setPosixFilePermissions(path, perms)

Review comment:
       Think I figured it out while testing this out in our env. Java has no 
way to set or keep the setgid bit when setting file permissions, so you lose 
the setgid bit with any of these methods of setting file permissions. I'm 
trying to figure out how yarn creates these folders since it manages to keep 
the bit, but it looks like it's doing it all through a local FileContext, which 
seems to be not keeping the setgid bit when making directories, so I'm not sure 
how that works.
   
   Will keep investigating but will probably use the existing method to create 
the 770 folder




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to