Skip to contentSkip to conversation

Call init script helpers with explicit path (./)

PATCH In review Gert Doering 1 participant 2 messages Jul 8, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Call init script helpers with explicit path (./)

The provided OpenVPN init scripts scan /etc/openvpn for *.conf and run an OpenVPN process for each, and if a .sh script with the same base name exists, this is run before openvpn. Change from running "$name.sh" to "./$name.sh" - depending on the shell used, the script won't be found otherwise, and ensuring that the script isn't searched in $PATH is the right thing anyway.

Reported in trac #423

---
 distro/rpm/openvpn.init.d.rhel | 2 +-
 distro/rpm/openvpn.init.d.suse | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
distro/rpm/openvpn.init.d.rhel +1 -1
index 821abd5..cdf3e9d 100755
@@ -148,7 +148,7 @@ case "$1" in
 	for c in `/bin/ls *.conf 2>/dev/null`; do
 	    bn=${c%%.conf}
 	    if [ -f "$bn.sh" ]; then
-		. $bn.sh
+		. ./$bn.sh
 	    fi
 	    rm -f $piddir/$bn.pid
 	    $openvpn --daemon --writepid $piddir/$bn.pid --config $c --cd $work
distro/rpm/openvpn.init.d.suse +1 -1
index 2bac7f3..270024e 100644
@@ -161,7 +161,7 @@ case "$1" in
 	for c in `/bin/ls *.conf 2>/dev/null`; do
 	    bn=${c%%.conf}
 	    if [ -f "$bn.sh" ]; then
-		. $bn.sh
+		. ./$bn.sh
 	    fi
 	    rm -f $piddir/$bn.pid
 	    $openvpn --daemon --writepid $piddir/$bn.pid --config $c --cd $work
Signature · 1 line
1.8.5.5
#1 lore raw

Patch has been applied to the master and release/2.3 branches.

commit cf31d5f32197159691fa9e3e4afcfc35307702d6 (master) commit 75c3a82e8085233306107495d6b1e0b1ab19eccf (release/2.3)

Author: Gert Doering
Date:   Tue Jul 8 09:20:54 2014 +0200
     Call init script helpers with explicit path (./)

     Signed-off-by: Gert Doering <[email protected]...>
     Acked-by: David Sommerseth <[email protected]...>
     Message-Id: <[email protected]...>
     URL: http://article.gmane.org/gmane.network.openvpn.devel/8858

--
kind regards,

Gert Doering