openvpn: fix quoting and deprecated option filtering
authorChen Minqiang <redacted>
Thu, 26 Mar 2026 16:40:04 +0000 (00:40 +0800)
committerFlorian Eckert <redacted>
Fri, 27 Mar 2026 13:56:22 +0000 (14:56 +0100)
commitbd524c0a7a1cf13f254a42888bc92b2e305ca08b
tree83ba121766426cc65fdf69c5ddf71d289a10500f
parent00e9d734687616fb7f7e5bdc978ba58f6d7aafdd
openvpn: fix quoting and deprecated option filtering

This patch fixes two issues in the netifd protocol script:

1. Fix logic error in deprecated option filtering:
   Previously, ${f%%:*} was called before checking for the deprecated
   flag (:d). This stripped the suffix and made the check [ "${f#*:}" = "d" ]
   always fail. The cleaning of $f is now deferred until after this check.

2. Improve parameter quoting for specific options:
   - Adds single quotes to --push and --push-remove parameters to handle
     spaces (e.g., "route 10.0.0.0 255.255.255.0").
   - Unifies quoting for 'file' type options to improve shell safety.
   - Refactors the build logic using a case statement for better
     extensibility.

Signed-off-by: Chen Minqiang <redacted>
net/openvpn/Makefile
net/openvpn/files/lib/netifd/proto/openvpn.sh
git clone https://git.99rst.org/PROJECT