You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by zh...@apache.org on 2017/03/23 01:52:08 UTC
ranger git commit: RANGER-1469:The user group would be duplicate
created if the user group existed during installing Ranger Policy Admin.
Repository: ranger
Updated Branches:
refs/heads/master a2291f0a8 -> 5d2f72376
RANGER-1469:The user group would be duplicate created if the user group existed during installing Ranger Policy Admin.
Signed-off-by: zhangqiang2 <zh...@zte.com.cn>
Project: http://git-wip-us.apache.org/repos/asf/ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/ranger/commit/5d2f7237
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/5d2f7237
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/5d2f7237
Branch: refs/heads/master
Commit: 5d2f72376ffec2572d2114515ffa7d7f1e096a36
Parents: a2291f0
Author: zhangqiang2 <zh...@zte.com.cn>
Authored: Wed Mar 22 21:43:35 2017 -0400
Committer: zhangqiang2 <zh...@zte.com.cn>
Committed: Wed Mar 22 21:50:16 2017 -0400
----------------------------------------------------------------------
security-admin/scripts/setup.sh | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ranger/blob/5d2f7237/security-admin/scripts/setup.sh
----------------------------------------------------------------------
diff --git a/security-admin/scripts/setup.sh b/security-admin/scripts/setup.sh
index bc94874..2e7752d 100755
--- a/security-admin/scripts/setup.sh
+++ b/security-admin/scripts/setup.sh
@@ -1245,8 +1245,15 @@ do_authentication_setup(){
#=====================================================================
setup_unix_user_group(){
log "[I] Setting up UNIX user : ${unix_user} and group: ${unix_group}";
- groupadd ${unix_group}
- check_ret_status_for_groupadd $? "Creating group ${unix_group} failed"
+
+ #create group if it does not exist
+ egrep "^$unix_group" /etc/group >& /dev/null
+ if [ $? -ne 0 ]
+ then
+ groupadd ${unix_group}
+ check_ret_status_for_groupadd $? "Creating group ${unix_group} failed"
+ fi
+
id -u ${unix_user} > /dev/null 2>&1
if [ $? -ne 0 ]
then