Bug 6030 - "karaf" script invokes /bin/sh but requires /bin/bash functions 71/40071/2
authorAlexis de Talhouët <adetalhouet@inocybe.com>
Wed, 8 Jun 2016 21:05:39 +0000 (17:05 -0400)
committerAlexis de Talhouët <adetalhouet@inocybe.com>
Thu, 9 Jun 2016 13:15:20 +0000 (13:15 +0000)
The bin/karaf script uses the "local" command which is a shell builtin of bash
and similar shells, but is not required for POSIX-compliance in sh.

On most flavors of linux, this resolves to bash or dash which probably runs in
a restricted environment after checking to see that its $0 is sh. But on Solaris's
/bin/sh is actually ksh93 for backwards compatibility.

Change-Id: Ifdd0e9fe798e881df01e7d2b586bc7e7142c0730
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
karaf/opendaylight-karaf-resources/src/main/resources/bin/instance [changed mode: 0644->0755]
karaf/opendaylight-karaf-resources/src/main/resources/bin/karaf

old mode 100644 (file)
new mode 100755 (executable)
index 32a8854..ca6f334
@@ -162,7 +162,7 @@ setupNativePath() {
 }
 
 pathCanonical() {
 }
 
 pathCanonical() {
-    local dst="${1}"
+    dst="${1}"
     while [ -h "${dst}" ] ; do
         ls=`ls -ld "${dst}"`
         link=`expr "$ls" : '.*-> \(.*\)$'`
     while [ -h "${dst}" ] ; do
         ls=`ls -ld "${dst}"`
         link=`expr "$ls" : '.*-> \(.*\)$'`
@@ -172,8 +172,8 @@ pathCanonical() {
             dst="`dirname "${dst}"`/$link"
         fi
     done
             dst="`dirname "${dst}"`/$link"
         fi
     done
-    local bas=`basename "${dst}"`
-    local dir=`dirname "${dst}"`
+    bas=`basename "${dst}"`
+    dir=`dirname "${dst}"`
     if [ "$bas" != "$dir" ]; then
         dst="`pathCanonical "$dir"`/$bas"
     fi
     if [ "$bas" != "$dir" ]; then
         dst="`pathCanonical "$dir"`/$bas"
     fi
index 53906c6b3f98d03cd5a9a8bc542d78153c4c48b7..58392996e947ee293291b1039787acf582615ff2 100755 (executable)
@@ -169,7 +169,7 @@ setupNativePath() {
 }
 
 pathCanonical() {
 }
 
 pathCanonical() {
-    local dst="${1}"
+    dst="${1}"
     while [ -h "${dst}" ] ; do
         ls=`ls -ld "${dst}"`
         link=`expr "$ls" : '.*-> \(.*\)$'`
     while [ -h "${dst}" ] ; do
         ls=`ls -ld "${dst}"`
         link=`expr "$ls" : '.*-> \(.*\)$'`
@@ -179,8 +179,8 @@ pathCanonical() {
             dst="`dirname "${dst}"`/$link"
         fi
     done
             dst="`dirname "${dst}"`/$link"
         fi
     done
-    local bas=`basename "${dst}"`
-    local dir=`dirname "${dst}"`
+    bas=`basename "${dst}"`
+    dir=`dirname "${dst}"`
     if [ "$bas" != "$dir" ]; then
       dst="`pathCanonical "$dir"`/$bas"
     fi
     if [ "$bas" != "$dir" ]; then
       dst="`pathCanonical "$dir"`/$bas"
     fi