fateh288 opened a new pull request, #223:
URL: https://github.com/apache/ranger/pull/223

   …which caused command to return null instead of group info. Corrected the 
command usage
   
   Description of your changes
   Original command: String[] cmd = new String[] {"bash", "-c", command + " '" 
+ group + "'"};
   Results in: bash -c getent group test_group1 'test_group1' - incorrect
   
   New changed command: String[] cmd = new String[] {"bash", "-c", command };
   Results in: bash -c getent group test_group1 - correct
   
   ## How was this patch tested?
   ranger.usersync.group.enumerategroup property set to "root,wheel,daemon"
   Obtained logs suggest getent command successfully got executed:
   ```
   2023-03-01 21:11:58,625 DEBUG 
org.apache.ranger.unixusersync.process.UnixUserGroupBuilder: Executing: [bash, 
-c, getent group root]
   2023-03-01 21:11:58,630 DEBUG 
org.apache.ranger.unixusersync.process.UnixUserGroupBuilder: bash -c getent 
group root for group root returned root:x:0:
   2023-03-01 21:11:58,630 DEBUG 
org.apache.ranger.unixusersync.process.UnixUserGroupBuilder: Executing: [bash, 
-c, getent group wheel]
   2023-03-01 21:11:58,639 DEBUG 
org.apache.ranger.unixusersync.process.UnixUserGroupBuilder: bash -c getent 
group wheel for group wheel returned wheel:x:10:jenkins
   2023-03-01 21:11:58,639 DEBUG 
org.apache.ranger.unixusersync.process.UnixUserGroupBuilder: Executing: [bash, 
-c, getent group daemon]
   2023-03-01 21:11:58,647 DEBUG 
org.apache.ranger.unixusersync.process.UnixUserGroupBuilder: bash -c getent 
group daemon for group daemon returned daemon:x:2:
   2023-03-01 21:11:58,647 DEBUG 
org.apache.ranger.unixusersync.process.UnixUserGroupBuilder: Done adding extra 
groups 
   ```
   Verified the obtained log results by executing commands such as "bash -c 
getent group daemon" which returned consistent results as logs.
   


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

Reply via email to