From 3860fd89726e74946c9de660c885f60cacc1fda6 Mon Sep 17 00:00:00 2001 From: Oyvind Albrigtsen Date: Mon, 29 Aug 2016 17:33:01 +0200 Subject: [PATCH] oracle: add quotes for monuser and monpassword and inform user to start monuser with C## if it's a container database --- heartbeat/oracle | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/heartbeat/oracle b/heartbeat/oracle index da322a7..6fad5bc 100755 --- a/heartbeat/oracle +++ b/heartbeat/oracle @@ -291,7 +291,7 @@ dbasql() { runsql "connect / as sysdba" $* } monsql() { - runsql "connect $MONUSR/\"$MONPWD\"" $* + runsql "connect \"$MONUSR\"/\"$MONPWD\"" $* } # use dbasql_one if the query should result in a single line output # at times people stuff commands in oracle .profile @@ -379,19 +379,19 @@ show_mon_user() { } mk_mon_user() { cat</dev/null; then return 0 + elif echo "$output" | grep ORA-65096 >/dev/null 2>&1; then + ocf_exit_reason "monuser must start with C## for container databases" + return $OCF_ERR_CONFIGURED else ocf_exit_reason "could not create $MONUSR oracle user" ocf_log err "sqlplus output: $output" @@ -757,7 +760,7 @@ MONUSR=${OCF_RESKEY_monuser:-$OCF_RESKEY_monuser_default} MONPWD=${OCF_RESKEY_monpassword:-$OCF_RESKEY_monpassword_default} MONPROFILE=${OCF_RESKEY_monprofile:-$OCF_RESKEY_monprofile_default} -MONUSR=$(echo $MONUSR | awk '{print toupper($0)}') +MONUSR=$(echo "$MONUSR" | awk '{print toupper($0)}') MONPROFILE=$(echo "$MONPROFILE" | awk '{print toupper($0)}') OCF_REQUIRED_PARAMS="sid" OCF_REQUIRED_BINARIES="sqlplus"