ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sneet...@apache.org
Subject git commit: ARGUS-47:Patch to encrypt plain text passwords should be run with Oracle also
Date Wed, 22 Oct 2014 06:01:39 GMT
Repository: incubator-argus
Updated Branches:
  refs/heads/master 43d5e8d05 -> 1fd51cdf0


ARGUS-47:Patch to encrypt plain text passwords should be run with Oracle also

Signed-off-by: sneethiraj <sneethir@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-argus/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-argus/commit/1fd51cdf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-argus/tree/1fd51cdf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-argus/diff/1fd51cdf

Branch: refs/heads/master
Commit: 1fd51cdf088700d222a42fc9b3de1ea75607bce0
Parents: 43d5e8d
Author: vperiasamy <vperiasamy@hortonworks.com>
Authored: Wed Oct 22 01:07:24 2014 -0400
Committer: sneethiraj <sneethir@apache.org>
Committed: Wed Oct 22 02:01:33 2014 -0400

----------------------------------------------------------------------
 security-admin/scripts/install.sh | 41 ++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/1fd51cdf/security-admin/scripts/install.sh
----------------------------------------------------------------------
diff --git a/security-admin/scripts/install.sh b/security-admin/scripts/install.sh
index 9648fc4..db4c77d 100755
--- a/security-admin/scripts/install.sh
+++ b/security-admin/scripts/install.sh
@@ -1301,6 +1301,47 @@ execute_java_patches(){
 			fi
 		done
 	fi
+	if [ "${DB_FLAVOR}" == "ORACLE" ]
+	then
+		dt=`date '+%s'`
+		tempFile=/tmp/sql_${dt}_$$.sql
+		javaFiles=`ls -1 $app_home/WEB-INF/classes/com/xasecure/patch/Patch*.class 2> /dev/null
| awk -F/ '{ print $NF }' | awk -F_J '{ print $2, $0 }' | sort -k1 -n | awk '{ printf("%s\n",$2)
; }'`
+		for javaPatch in ${javaFiles}
+		do
+			if test -f "$app_home/WEB-INF/classes/com/xasecure/patch/$javaPatch"; then
+				className=$(basename "$javaPatch" .class)
+				version=`echo ${className} | awk -F'_' '{ print $2 }'`
+				if [ "${version}" != "" ]
+				then
+					result2=`${SQL_COMMAND_INVOKER} -L -S "${db_user}"/"\"${db_password}\""@"${DB_HOST}"
<<< "select version from x_db_version_h where version = '${version}' and active =
'Y';"`
+					#does not contains record so insert
+					if test "${result2#*$version}" == "$result2"
+					then
+						log "[I] patch ${javaPatch} is being applied..";
+						msg=`java -cp "$app_home/WEB-INF/:$app_home/META-INF/:$app_home/WEB-INF/lib/*:$app_home/WEB-INF/classes/:$app_home/WEB-INF/classes/META-INF/"
com.xasecure.patch.${className}`
+						check_ret_status $? "Unable to apply patch:$javaPatch"
+						touch ${tempFile}
+						echo >> ${tempFile}
+						echo "insert into x_db_version_h (id,version, inst_at, inst_by, updated_at, updated_by)
values ( X_DB_VERSION_H_SEQ.nextval,'${version}', sysdate, '${db_user}', sysdate, '${db_user}')
;" >> ${tempFile}
+						result3=`echo "exit"|${SQL_COMMAND_INVOKER} -L -S "${db_user}"/"\"${db_password}\""@"${DB_HOST}"
 @$tempFile`
+						if test "${result3#*$strError}" == "$result3"
+						then
+							log "[I] patch ${javaPatch} has been applied!!";
+						else
+							log "[E] patch ${javaPatch} has failed."
+						fi
+						rm -f ${tempFile}
+					elif test "${result2#*$strError}" != "$result2"
+					then
+						log "[E] - patch [${javaPatch}] could not applied. Skipping ..."
+						exit 1
+					else
+						log "[I] - patch [${javaPatch}] is already applied. Skipping ..."
+					fi
+				fi
+			fi
+		done
+	fi
 }
 init_logfiles
 log " --------- Running XASecure PolicyManager Web Application Install Script --------- "


Mime
View raw message