RANGER-505 : Fix column length for Service def config field Signed-off-by: Madhan Neethiraj <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/ec7ac830 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/ec7ac830 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/ec7ac830 Branch: refs/heads/ranger-0.5 Commit: ec7ac830af30fefd617f831d9f099bf58dc42a4b Parents: 115577a Author: Gautam Borad <[email protected]> Authored: Sat May 23 16:21:01 2015 +0530 Committer: Madhan Neethiraj <[email protected]> Committed: Sun May 24 03:07:51 2015 -0700 ---------------------------------------------------------------------- kms/scripts/dba_script.py | 2 ++ security-admin/db/mysql/patches/009-updated_schema.sql | 2 +- security-admin/db/oracle/patches/009-updated_schema.sql | 2 +- security-admin/db/postgres/xa_core_db_postgres.sql | 2 +- security-admin/db/sqlserver/xa_core_db_sqlserver.sql | 2 +- security-admin/scripts/db_setup.py | 1 + security-admin/scripts/dba_script.py | 2 ++ unixauthservice/scripts/ranger-usersync-services.sh | 4 +++- 8 files changed, 12 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/ec7ac830/kms/scripts/dba_script.py ---------------------------------------------------------------------- diff --git a/kms/scripts/dba_script.py b/kms/scripts/dba_script.py index 327d5ca..f2f3650 100644 --- a/kms/scripts/dba_script.py +++ b/kms/scripts/dba_script.py @@ -177,6 +177,7 @@ class MysqlConf(BaseDB): def create_rangerdb_user(self, root_user, db_user, db_password, db_root_password,dryMode): if self.check_connection('mysql', root_user, db_root_password): hosts_arr =["%", "localhost"] + hosts_arr.append(self.host) for host in hosts_arr: get_cmd = self.get_jisql_cmd(root_user, db_root_password, 'mysql') if self.verify_user(root_user, db_root_password, host, db_user, get_cmd,dryMode): @@ -269,6 +270,7 @@ class MysqlConf(BaseDB): def grant_xa_db_user(self, root_user, db_name, db_user, db_password, db_root_password, is_revoke,dryMode): hosts_arr =["%", "localhost"] + hosts_arr.append(self.host) ''' if is_revoke: for host in hosts_arr: http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/ec7ac830/security-admin/db/mysql/patches/009-updated_schema.sql ---------------------------------------------------------------------- diff --git a/security-admin/db/mysql/patches/009-updated_schema.sql b/security-admin/db/mysql/patches/009-updated_schema.sql index 4f58acc..c5aa728 100644 --- a/security-admin/db/mysql/patches/009-updated_schema.sql +++ b/security-admin/db/mysql/patches/009-updated_schema.sql @@ -300,7 +300,7 @@ CREATE TABLE `x_service_config_map` ( `upd_by_id` bigint(20) DEFAULT NULL, `service` bigint(20) NOT NULL, `config_key` varchar(1024) DEFAULT NULL, -`config_value` varchar(1024) DEFAULT NULL, +`config_value` varchar(4000) DEFAULT NULL, primary key (`id`), CONSTRAINT `x_service_config_map_FK_` FOREIGN KEY (`service`) REFERENCES `x_service` (`id`), CONSTRAINT `x_service_config_map_FK_added_by_id` FOREIGN KEY (`added_by_id`) REFERENCES `x_portal_user` (`id`), http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/ec7ac830/security-admin/db/oracle/patches/009-updated_schema.sql ---------------------------------------------------------------------- diff --git a/security-admin/db/oracle/patches/009-updated_schema.sql b/security-admin/db/oracle/patches/009-updated_schema.sql index 77a7d72..ef5ff3c 100644 --- a/security-admin/db/oracle/patches/009-updated_schema.sql +++ b/security-admin/db/oracle/patches/009-updated_schema.sql @@ -285,7 +285,7 @@ added_by_id NUMBER(20) DEFAULT NULL NULL, upd_by_id NUMBER(20) DEFAULT NULL NULL, service NUMBER(20) NOT NULL, config_key VARCHAR(1024) DEFAULT NULL NULL, -config_value VARCHAR(1024) DEFAULT NULL NULL, +config_value VARCHAR(4000) DEFAULT NULL NULL, primary key (id), CONSTRAINT x_service_conf_map_FK_service FOREIGN KEY (service) REFERENCES x_service (id), CONSTRAINT x_service_conf_map_FK_added_by FOREIGN KEY (added_by_id) REFERENCES x_portal_user (id), http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/ec7ac830/security-admin/db/postgres/xa_core_db_postgres.sql ---------------------------------------------------------------------- diff --git a/security-admin/db/postgres/xa_core_db_postgres.sql b/security-admin/db/postgres/xa_core_db_postgres.sql index 577f2a2..5a76442 100644 --- a/security-admin/db/postgres/xa_core_db_postgres.sql +++ b/security-admin/db/postgres/xa_core_db_postgres.sql @@ -734,7 +734,7 @@ added_by_id BIGINT DEFAULT NULL NULL, upd_by_id BIGINT DEFAULT NULL NULL, service BIGINT NOT NULL, config_key VARCHAR(1024) DEFAULT NULL NULL, -config_value VARCHAR(1024) DEFAULT NULL NULL, +config_value VARCHAR(4000) DEFAULT NULL NULL, primary key(id), CONSTRAINT x_service_conf_map_FK_service FOREIGN KEY(service) REFERENCES x_service(id), CONSTRAINT x_service_conf_map_FK_added_by FOREIGN KEY(added_by_id) REFERENCES x_portal_user(id), http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/ec7ac830/security-admin/db/sqlserver/xa_core_db_sqlserver.sql ---------------------------------------------------------------------- diff --git a/security-admin/db/sqlserver/xa_core_db_sqlserver.sql b/security-admin/db/sqlserver/xa_core_db_sqlserver.sql index 87b8171..25d374e 100644 --- a/security-admin/db/sqlserver/xa_core_db_sqlserver.sql +++ b/security-admin/db/sqlserver/xa_core_db_sqlserver.sql @@ -2056,7 +2056,7 @@ CREATE TABLE [dbo].[x_service_config_map] ( [upd_by_id] [bigint] DEFAULT NULL NULL, [service] [bigint] NOT NULL, [config_key] [varchar](1024) DEFAULT NULL NULL, - [config_value] [varchar](1024) DEFAULT NULL NULL, + [config_value] [varchar](4000) DEFAULT NULL NULL, PRIMARY KEY CLUSTERED ( [id] ASC http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/ec7ac830/security-admin/scripts/db_setup.py ---------------------------------------------------------------------- diff --git a/security-admin/scripts/db_setup.py b/security-admin/scripts/db_setup.py index e50421c..52ddeb1 100644 --- a/security-admin/scripts/db_setup.py +++ b/security-admin/scripts/db_setup.py @@ -181,6 +181,7 @@ class MysqlConf(BaseDB): def grant_audit_db_user(self, db_user, audit_db_name, audit_db_user, audit_db_password, db_password,TABLE_NAME): hosts_arr =["%", "localhost"] + hosts_arr.append(self.host) for host in hosts_arr: log("[I] ---------------Granting privileges TO '"+ audit_db_user + "' on '" + audit_db_name+"'-------------" , "info") get_cmd = self.get_jisql_cmd(db_user, db_password, audit_db_name) http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/ec7ac830/security-admin/scripts/dba_script.py ---------------------------------------------------------------------- diff --git a/security-admin/scripts/dba_script.py b/security-admin/scripts/dba_script.py index c37edbc..bf2a780 100644 --- a/security-admin/scripts/dba_script.py +++ b/security-admin/scripts/dba_script.py @@ -159,6 +159,7 @@ class MysqlConf(BaseDB): def create_rangerdb_user(self, root_user, db_user, db_password, db_root_password,dryMode): if self.check_connection('mysql', root_user, db_root_password): hosts_arr =["%", "localhost"] + hosts_arr.append(self.host) for host in hosts_arr: get_cmd = self.get_jisql_cmd(root_user, db_root_password, 'mysql') if self.verify_user(root_user, db_root_password, host, db_user, get_cmd,dryMode): @@ -251,6 +252,7 @@ class MysqlConf(BaseDB): def grant_xa_db_user(self, root_user, db_name, db_user, db_password, db_root_password, is_revoke,dryMode): hosts_arr =["%", "localhost"] + hosts_arr.append(self.host) ''' if is_revoke: for host in hosts_arr: http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/ec7ac830/unixauthservice/scripts/ranger-usersync-services.sh ---------------------------------------------------------------------- diff --git a/unixauthservice/scripts/ranger-usersync-services.sh b/unixauthservice/scripts/ranger-usersync-services.sh index 9099f7d..ea5c7e8 100644 --- a/unixauthservice/scripts/ranger-usersync-services.sh +++ b/unixauthservice/scripts/ranger-usersync-services.sh @@ -33,7 +33,9 @@ pidf=/var/run/ranger/usersync.pid if [ "${action}" == "START" ]; then #Export JAVA_HOME - . ${cdir}/conf/java_home.sh + if [ -f ${cdir}/conf/java_home.sh ]; then + . ${cdir}/conf/java_home.sh + fi for custom_env_script in `find ${cdir}/conf/ -name "ranger-usersync-env*"`; do if [ -f $custom_env_script ]; then
