On Tue, Dec 28, 2010 at 02:17:00PM +0100, Alexander Krauth wrote:
> # HG changeset patch
> # User Alexander Krauth <[email protected]>
> # Date 1293542125 -3600
> # Node ID 91a8543708f10e5098f39b19f233c32d8fd11d67
> # Parent  cc7aa8b1f9a17e38e8e4d528f0481b7fca308886
> High: SAPDatabase: Fixed tr [:upper:] [:lower:] issue
> 
> Not quoting the parameters of the tr command sometimes let to shell 
> replacements, if certain files exist.
> 
> diff -r cc7aa8b1f9a1 -r 91a8543708f1 heartbeat/SAPDatabase
> --- a/heartbeat/SAPDatabase   Tue Dec 21 16:36:27 2010 +0100
> +++ b/heartbeat/SAPDatabase   Tue Dec 28 14:15:25 2010 +0100
> @@ -178,7 +178,7 @@
>  # listener_start: Start the given listener
>  #
>  listener_start() {
> -  orasid="ora`echo $SID | tr [:upper:] [:lower:]`"
> +  orasid="ora`echo $SID | tr '[:upper:]' '[:lower:]'`"
>    rc=$OCF_SUCCESS
>    output=`echo "lsnrctl start $NETSERVICENAME" | su - $orasid 2>&1`
>    if [ $? -eq 0 ]
> @@ -196,7 +196,7 @@
>  # listener_stop: Stop the given listener
>  #
>  listener_stop() {
> -  orasid="ora`echo $SID | tr [:upper:] [:lower:]`"
> +  orasid="ora`echo $SID | tr '[:upper:]' '[:lower:]'`"
>    rc=$OCF_SUCCESS
>    if
>        listener_status
> @@ -220,7 +220,7 @@
>  # listener_status: is the given listener running?
>  #
>  listener_status() {
> -  orasid="ora`echo $SID | tr [:upper:] [:lower:]`"
> +  orasid="ora`echo $SID | tr '[:upper:]' '[:lower:]'`"
>    # Note: ps cuts off it's output at column $COLUMNS, so "ps -ef" can not be 
> used here
>    # as the output might be to long.
>    cnt=`ps efo args --user $orasid | grep $NETSERVICENAME | grep -c tnslsnr`
> @@ -479,7 +479,7 @@
>  # db6udb_recover: try to recover DB/2 after a crash
>  #
>  db6udb_recover() {
> -  db2sid="db2`echo $SID | tr [:upper:] [:lower:]`"
> +  db2sid="db2`echo $SID | tr '[:upper:]' '[:lower:]'`"
>  
>  echo '#!/bin/sh
>  LOG=$HOME/recover.log
> @@ -729,11 +729,11 @@
>           SNUM=2
>           ;;
>      ORA) SEARCH="ora_[a-z][a-z][a-z][a-z]_"
> -         SUSER="ora`echo $SID | tr [:upper:] [:lower:]`"
> +         SUSER="ora`echo $SID | tr '[:upper:]' '[:lower:]'`"
>           SNUM=4
>           ;;
>      DB6) SEARCH="db2[a-z][a-z][a-z][a-z][a-z]"
> -         SUSER="db2`echo $SID | tr [:upper:] [:lower:]`"
> +         SUSER="db2`echo $SID | tr '[:upper:]' '[:lower:]'`"
>           SNUM=5
>           ;;
>    esac
> @@ -970,7 +970,7 @@
>    LD_LIBRARY_PATH=$DIR_EXECUTABLE${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
>    export LD_LIBRARY_PATH
>  fi
> -sidadm="`echo $SID | tr [:upper:] [:lower:]`adm"
> +sidadm="`echo $SID | tr '[:upper:]' '[:lower:]'`adm"
>  
>  # What kind of method was invoked?
>  case "$1" in

Applied with the summary modified slightly.

Thanks,

Dejan
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to