openvpn: fix arguments passing to wrapped up and down scripts

With the introduction of the generic OpenVPN hotplug mechanism, wrapped
--up and --down scripts got the wrong amount and order of arguments passed,
breaking existing configurations and functionality.

Fix this issue by passing the same amount of arguments in the same expected
order as if the scripts were executed by the OpenVPN daemon directly.

Ref: https://github.com/openwrt/openwrt/pull/1596#issuecomment-668935156
Fixes: 8fe9940db6 ("openvpn: add generic hotplug mechanism")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2020-08-05 09:25:41 +02:00
parent 34553e8cc9
commit b92f54b919
2 changed files with 3 additions and 2 deletions

View File

@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=openvpn PKG_NAME:=openvpn
PKG_VERSION:=2.4.9 PKG_VERSION:=2.4.9
PKG_RELEASE:=3 PKG_RELEASE:=4
PKG_SOURCE_URL:=\ PKG_SOURCE_URL:=\
https://build.openvpn.net/downloads/releases/ \ https://build.openvpn.net/downloads/releases/ \

View File

@ -13,7 +13,8 @@
case "$ACTION" in case "$ACTION" in
up|down) up|down)
if get_openvpn_option "$config" command "$ACTION"; then if get_openvpn_option "$config" command "$ACTION"; then
exec /bin/sh -c "$command $ACTION $INSTANCE $*" shift
exec /bin/sh -c "$command $*"
fi fi
;; ;;
esac esac