[arch-commits] Commit in vpnc/trunk (3 files)

Levente Polyak anthraxx at archlinux.org
Wed Aug 21 21:12:12 UTC 2019


    Date: Wednesday, August 21, 2019 @ 21:12:11
  Author: anthraxx
Revision: 360537

upgpkg: vpnc 1:0.5.3.r462.r78-1 dns fixes and unit file improvements

upstream release

- fix detection of systemd-resolved FS#59018
- improve unit file with restart=always and network.target FS#63321

Added:
  vpnc/trunk/vpnc-systemd-resolved.patch
Modified:
  vpnc/trunk/PKGBUILD
  vpnc/trunk/vpnc at .service

-----------------------------+
 PKGBUILD                    |   17 +++++++++++------
 vpnc-systemd-resolved.patch |   38 ++++++++++++++++++++++++++++++++++++++
 vpnc at .service               |    2 ++
 3 files changed, 51 insertions(+), 6 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-08-21 21:02:40 UTC (rev 360536)
+++ PKGBUILD	2019-08-21 21:12:11 UTC (rev 360537)
@@ -3,9 +3,9 @@
 # Contributor: Thomas Baechler <thomas at archlinux.org>
 
 pkgname=vpnc
-_vpnc_commit=6ad8c2c03b0ba5c47dcca8ece4415e19575e3ef3
-_vpncscripts_commit=33b5d8198b5f375418379e483031d3ec9019225d
-pkgver=0.5.3.r460.r73
+_vpnc_commit=101208be5b74039ea70b9e007ce0d6c9fbe44d82
+_vpncscripts_commit=c84fb8e5a523a647a01a1229a9104db934e19f00
+pkgver=0.5.3.r462.r78
 pkgrel=1
 epoch=1
 pkgdesc='VPN client for cisco3000 VPN Concentrators'
@@ -19,11 +19,13 @@
 source=("vpnc::git+https://github.com/streambinder/vpnc#commit=${_vpnc_commit}"
         "vpnc-scripts::git://git.infradead.org/users/dwmw2/vpnc-scripts.git#commit=${_vpncscripts_commit}"
         vpnc.conf
-        vpnc at .service)
+        vpnc at .service
+        vpnc-systemd-resolved.patch)
 sha512sums=('SKIP'
             'SKIP'
             'ac70712192c01ff638a9badc5cff7105bee5c4fed5d3a3b728e9597661952d156041c82fe1e544e2bab602d193d4105d3689c79c46d964623f6ce38dd89f0ea7'
-            '3acb21ed11c7658915d38d8b6a9df9716eadfd85d3c4895045bbaaabfa217bd40cb21d08086c4196bb06153ad0be80b1dde4ef6b516f3840e26ee19874a75058')
+            'cafcab676986c1a2e49441f01d61997f1c6b54bbb68661b9af007d4816f8e76eee6b7ac2dfab55b55965fa407e8331c663cf11aa79384c30b0c9049c1477b791'
+            '3383783a0e4848ccff2247c5c7c99bcfeb3f7a7756d000fdb4627a73c82dd7ac8106183160d07dc77339df70efc4819ea89327e9da1d7c885d675d1dc84d4df1')
 
 pkgver() {
   cd ${pkgname}
@@ -33,7 +35,10 @@
 }
 
 prepare() {
-  cd ${pkgname}
+  cd vpnc-scripts
+  patch -Np1 < ../vpnc-systemd-resolved.patch
+
+  cd ../${pkgname}
   # Build hybrid support
   sed 's|^#OPENSSL|OPENSSL|g' -i Makefile
   # fix resolvconf location for community/openresolv

Added: vpnc-systemd-resolved.patch
===================================================================
--- vpnc-systemd-resolved.patch	                        (rev 0)
+++ vpnc-systemd-resolved.patch	2019-08-21 21:12:11 UTC (rev 360537)
@@ -0,0 +1,38 @@
+Use systemd-resolve to check if resolved is running
+
+resolved may be included in nsswitch.conf even though systemd-resolved
+is not running. E.g. Arch Linux includes resolved in nsswitch.conf by
+default, but systemd-resolved is not enabled by default, which causes
+this script to fail updating dns.
+
+This patch uses the systemd-resolve command, which is included with
+systemd, to check if systemd-resolved is actually running.
+---
+ vpnc-script | 3 +--
+ 1 file changed, 1 insertion(+), 8 deletions(-)
+
+diff --git a/vpnc-script b/vpnc-script
+index 6a55546..b00dbb9 100755
+--- a/vpnc-script
++++ b/vpnc-script
+@@ -117,19 +117,12 @@
+ 	ifconfig_syntax_ptpv6=""
+ fi
+ 
+-grep ^hosts /etc/nsswitch.conf 2>/dev/null|grep resolve >/dev/null 2>&1
+-if [ $? = 0 ];then
+-	RESOLVEDENABLED=1
+-else
+-	RESOLVEDENABLED=0
+-fi
+-
+ if [ -r /etc/openwrt_release ] && [ -n "$OPENWRT_INTERFACE" ]; then
+         . /etc/functions.sh
+ 	include /lib/network
+ 	MODIFYRESOLVCONF=modify_resolvconf_openwrt
+ 	RESTORERESOLVCONF=restore_resolvconf_openwrt
+-elif [ -x /usr/bin/busctl ] && [ ${RESOLVEDENABLED} = 1 ]; then  # For systemd-resolved (version 229 and above)
++elif [ -x /usr/bin/busctl ] && grep -qs '^hosts.*resolve' /etc/nsswitch.conf && systemd-resolve --status >/dev/null 2>&1; then # For systemd-resolved (version 229 and above)
+ 	MODIFYRESOLVCONF=modify_resolved_manager
+ 	RESTORERESOLVCONF=restore_resolved_manager
+ elif [ -x /sbin/resolvconf ]; then # Optional tool on Debian, Ubuntu, Gentoo and FreeBSD

Modified: vpnc at .service
===================================================================
--- vpnc at .service	2019-08-21 21:02:40 UTC (rev 360536)
+++ vpnc at .service	2019-08-21 21:12:11 UTC (rev 360537)
@@ -1,10 +1,12 @@
 [Unit]
 Description=VPNC connection to %i
+After=network.target
 
 [Service]
 Type=forking
 ExecStart=/usr/bin/vpnc --pid-file=/run/vpnc@%i.pid /etc/vpnc/%i.conf
 PIDFile=/run/vpnc@%i.pid
+Restart=always
 
 [Install]
 WantedBy=multi-user.target



More information about the arch-commits mailing list