lede-packages-rs

git clone git://archive.git.mtrnord.blog/MTRNord/lede-packages-rs.git
Log | Files | Refs | README | LICENSE

commit e9215bf85d09963d8a1e56a928a7e54f77554441
parent 3a78fe047ab26879cf471df69e29faa183b726bb
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Sun, 31 Aug 2014 23:57:47 +0200

openconnect: set config variable on teardown and correctly pass the password

This addresses https://dev.openwrt.org/ticket/16634

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>

Diffstat:
Mnet/openconnect/Makefile | 3++-
Anet/openconnect/files/openconnect-wrapper | 14++++++++++++++
Mnet/openconnect/files/openconnect.sh | 4+++-
3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/net/openconnect/Makefile b/net/openconnect/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openconnect PKG_VERSION:=6.00 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/openconnect/ @@ -56,6 +56,7 @@ define Package/openconnect/install $(INSTALL_BIN) ./files/vpnc-script $(1)/lib/netifd/ $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/openconnect $(1)/usr/sbin/ + $(INSTALL_BIN) ./files/openconnect-wrapper $(1)/usr/sbin/ endef $(eval $(call BuildPackage,openconnect)) diff --git a/net/openconnect/files/openconnect-wrapper b/net/openconnect/files/openconnect-wrapper @@ -0,0 +1,14 @@ +#!/bin/sh + +# This script wraps openconnect in order to obtain the password +# file from cmd. + +# $1 password file +# $2... are passed to openconnect + +test -z "$1" && exit 1 + +pwfile=$1 +shift + +cat $pwfile|/usr/sbin/openconnect $* diff --git a/net/openconnect/files/openconnect.sh b/net/openconnect/files/openconnect.sh @@ -55,13 +55,15 @@ proto_openconnect_setup() { logger -t openconnect "executing 'openconnect $cmdline'" if [ -f "$pwfile" ];then - proto_run_command "$config" /usr/sbin/openconnect $cmdline <$pwfile + proto_run_command "$config" /usr/sbin/openconnect-wrapper $pwfile $cmdline else proto_run_command "$config" /usr/sbin/openconnect $cmdline fi } proto_openconnect_teardown() { + local config="$1" + pwfile="/var/run/openconnect-$config.passwd" rm -f $pwfile