gengliangwang commented on code in PR #36315:
URL: https://github.com/apache/spark/pull/36315#discussion_r855746240


##########
core/src/main/scala/org/apache/spark/security/ShellBasedGroupsMappingProvider.scala:
##########
@@ -38,8 +38,10 @@ private[spark] class ShellBasedGroupsMappingProvider extends 
GroupMappingService
 
   // shells out a "bash -c id -Gn username" to get user groups
   private def getUnixGroups(username: String): Set[String] = {
-    val cmdSeq = Seq("bash", "-c", "id -Gn " + username)
+    val idPath = Utils.executeAndGetOutput("which" :: "id" :: Nil).stripLineEnd

Review Comment:
   I am not familiar with this. How can `executeAndGetOutput` avoid injection?



-- 
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