[ https://issues.apache.org/jira/browse/RANGER-4043?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17696273#comment-17696273 ]
Madhan Neethiraj commented on RANGER-4043: ------------------------------------------ Fix cherry-picked into ranger-2.4 branch: https://github.com/apache/ranger/commit/409a872aacee4fa2482029af07ba0d0e71ca54da > [ugsync]Enumerate Groups will give error on executing 'getent group' command > ---------------------------------------------------------------------------- > > Key: RANGER-4043 > URL: https://issues.apache.org/jira/browse/RANGER-4043 > Project: Ranger > Issue Type: Bug > Components: Ranger > Reporter: Abhishek Pal > Assignee: Fateh Singh > Priority: Major > Fix For: 3.0.0, 2.4.0 > > Time Spent: 40m > Remaining Estimate: 0h > > Currently in the Ranger usersync code for UnixUserSync the enumerate group > option accepts group as comma separated values. > Example: > {code:java} > ranger.usersync.group.enumerate: true > ranger.usersync.group.enumerategroup: test_group1,test_group2 > {code} > However in the code > *ugsync/src/main/java/org/apache/ranger/process* > *UnixUserGroupBuilder.java -> buildUnixGroupList()* > when {*}enumerateGroups is set{*}, the line: > {code:java} > String[] cmd = new String[] {"bash", "-c", command + " '" + group + "'"}; > {code} > will create the command as: > *bash -c getent group <group_name> '<group_name>'* > {code:java} > bash -c getent group test_group1 'test_group1' > {code} > which is an invalid command as *getent* takes one argument. > This will return an exit-code 2 with error. -- This message was sent by Atlassian Jira (v8.20.10#820010)