HyukjinKwon commented on code in PR #36315:
URL: https://github.com/apache/spark/pull/36315#discussion_r855751736
##########
core/src/main/scala/org/apache/spark/security/ShellBasedGroupsMappingProvider.scala:
##########
@@ -36,10 +36,12 @@ private[spark] class ShellBasedGroupsMappingProvider
extends GroupMappingService
userGroups
}
- // shells out a "bash -c id -Gn username" to get user groups
+ // shells out a "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:
We can do .. I wanted to keep the behavior as much as possible (e.g., bash
might point a different `id`) .. but probably I was overthinking. Directly
invoking `id` would be better.
--
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]