Abhishek Pal created RANGER-4043:
------------------------------------
Summary: [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
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)