openvpn: fix arguments passing to wrapped up and down scripts
authorJo-Philipp Wich <jo@mein.io>
Wed, 5 Aug 2020 07:25:41 +0000 (09:25 +0200)
committerJo-Philipp Wich <jo@mein.io>
Thu, 6 Aug 2020 06:34:31 +0000 (08:34 +0200)
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>
package/network/services/openvpn/Makefile
package/network/services/openvpn/files/etc/hotplug.d/openvpn/01-user

index 8126b3a7c7087cb0a27e10787d7f6b2fcd1ba2a4..9482e9ce391e1c26c5e5ee55512b3948c1ead849 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=openvpn
 
 PKG_VERSION:=2.4.9
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE_URL:=\
        https://build.openvpn.net/downloads/releases/ \
index 86be69e80574497ab46fc80583f5262fbdad3f5e..f93823e5c55559be61352b096995b9a828e45fdd 100644 (file)
@@ -13,7 +13,8 @@
 case "$ACTION" in
        up|down)
                if get_openvpn_option "$config" command "$ACTION"; then
-                       exec /bin/sh -c "$command $ACTION $INSTANCE $*"
+                       shift
+                       exec /bin/sh -c "$command $*"
                fi
        ;;
 esac