-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56864/
-----------------------------------------------------------

(Updated 四月 7, 2017, 7:18 a.m.)


Review request for ranger, Alok Lal, Ankita Sinha, Don Bosco Durai, Colm O 
hEigeartaigh, Gautam Borad, Madhan Neethiraj, Ramesh Mani, Selvamohan 
Neethiraj, and Velmurugan Periasamy.


Changes
-------

Update the description


Bugs: RANGER-1398
    https://issues.apache.org/jira/browse/RANGER-1398


Repository: ranger


Description (updated)
-------

I checked the codes and found below codes will get 'minimumGroupId' from 
'ranger-ugsync-site.xml', but I can't find this parameter in this file after 
execute the shell script.
UnixUserGroupBuilder.java
public UnixUserGroupBuilder() {
        minimumUserId = Integer.parseInt(config.getMinUserId());
        minimumGroupId = Integer.parseInt(config.getMinGroupId());
      ......
}
UserGroupSyncConfig.java
public static final String  UGSYNC_MIN_GROUPID_PROP =   
"ranger.usersync.unix.minGroupId";
public static final String  DEFAULT_UGSYNC_MIN_GROUPID =   "0";
public String getMinGroupId() {
        String mgid = prop.getProperty(UGSYNC_MIN_GROUPID_PROP);
        if (mgid == null) {
            mgid = DEFAULT_UGSYNC_MIN_GROUPID;
        }
        return mgid;
}
I have changed the codes and we can set the value in 'ranger-ugsync-site.xml'. 
The reason why I default it as '500' is the values between 0 and 499 are 
typically reserved for 
system accounts. You can refer to below url:
http://www.archivum.info/[email protected]/2006-03/03888/Bug-333706-marked-as-done-(useradd-lacks-r-option).html


Diffs
-----

  unixauthservice/conf.dist/ranger-ugsync-default.xml 5ed5b89 
  unixauthservice/scripts/install.properties 13ae1e5 
  unixauthservice/scripts/templates/installprop2xml.properties 1a9bf36 
  unixauthservice/scripts/templates/ranger-ugsync-template.xml 0025dc8 


Diff: https://reviews.apache.org/r/56864/diff/1/


Testing
-------

Test steps:
1. Build ranger source codes.
2. Follow the steps in wiki and unzip ranger-0.7.0-SNAPSHOT-usersync.tar.gz .
3. Follow the steps in wiki to configure the settings in install.properties, 
then execute setup.sh .
4. Check the file 'ranger-ugsync-site.xml' and we will see 
'ranger.usersync.unix.minGroupId' has been set as 500.

$ git apply --stat 
0001-RANGER-1398-Missing-the-settings-for-ranger.usersync.patch
 .../conf.dist/ranger-ugsync-default.xml            |    4 ++++
 unixauthservice/scripts/install.properties         |    6 ++++++
 .../scripts/templates/installprop2xml.properties   |    1 +
 .../scripts/templates/ranger-ugsync-template.xml   |    4 ++++
 4 files changed, 15 insertions(+)
$ git am --signoff < 
0001-RANGER-1398-Missing-the-settings-for-ranger.usersync.patch
Applying: RANGER-1398:Missing the settings for ranger.usersync.unix.minGroupId 
in ranger usersync module


Thanks,

Qiang Zhang

Reply via email to