From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id KNB/KK78kGaqPgEAqHPOHw:P1 (envelope-from ) for ; Fri, 12 Jul 2024 09:51:42 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id KNB/KK78kGaqPgEAqHPOHw (envelope-from ) for ; Fri, 12 Jul 2024 11:51:42 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mg.wilsonb.com header.s=krs header.b=v3SpAoZm; dkim=fail ("headers rsa verify failed") header.d=wilsonb.com header.s=201703 header.b=rxCHjvMB; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1720777902; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=s81blLe+TkiiPP+RcFNIC8Cj9ooBI9BFu/vR2jo9XDA=; b=HhRxdb6lyixsN829BKsFzBTJv0C7CcK1o2EfTeUwo5n97Ub60aIRxQdB+NbKu0XFXO0LWc UtFrmBTwfVTt/m6jRYtjHiQx+Ez0xLbv2ixLT75UaHlHOFm6c0GytHnb/Pzr0j5bslahv1 IY6oiU5OfuoZ/DAdnt7wRryzxcQrYV/vQjtE0nowHaQaUIDGGRsuPD2BJ24YZfin6YewGh DxoRz5XoKoi6usGq9atbSCs4ueojHxbHFlbYZZ2x2x83CUAb5N7IcwmkSRia4um8X2VIpN Ash1YYbY+toqznCgcpfbVd+woU3gY1Ga2nS3xQHza4/PqjIWLxaaNOnVfsYmDg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mg.wilsonb.com header.s=krs header.b=v3SpAoZm; dkim=fail ("headers rsa verify failed") header.d=wilsonb.com header.s=201703 header.b=rxCHjvMB; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1720777902; a=rsa-sha256; cv=none; b=nYv/ZqVGKEOt5m1MDIobGd+OjbZdO6lvRMLKokqCnjk0fqRtfn56bTbAMKMuDy25KpcHIB aFo0F668QmIhqf6OOy4DrDeFFPJ9z5/PQsYN6XkHjlH9/LFgpURxvhBY3udv7fDTfAvK5i 1bqI28lekGAM40YGZ/Uik5mqVzo4YX0TTEf7yitSe4SFPt9/Y80OrquS+XNrF/gNOvcHwy kAQLcCSim/9Yrd69rgiBzh8QPELVAsF8Io7+xxcNPqerRw+VgskEPE7v/bf4ZZogTm6vc9 YO84rAW3A8fbt9DcYT2+f1R8siDModNY5eU02WrccRYNfStB7akLnxw2GxkxJg== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4923C663B1 for ; Fri, 12 Jul 2024 11:51:42 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSCvi-00088q-J0; Fri, 12 Jul 2024 05:51:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sSCve-00088M-Oe for guix-patches@gnu.org; Fri, 12 Jul 2024 05:51:02 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sSCvd-0003ZL-Ot for guix-patches@gnu.org; Fri, 12 Jul 2024 05:51:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sSCvd-0006Sg-Qx for guix-patches@gnu.org; Fri, 12 Jul 2024 05:51:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#72072] gnu: isc-dhcp: Patch dhclient to support resolvconf. Resent-From: "B. Wilson" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 12 Jul 2024 09:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 72072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 72072@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.172077785324818 (code B ref -1); Fri, 12 Jul 2024 09:51:01 +0000 Received: (at submit) by debbugs.gnu.org; 12 Jul 2024 09:50:53 +0000 Received: from localhost ([127.0.0.1]:53225 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sSCvU-0006SD-91 for submit@debbugs.gnu.org; Fri, 12 Jul 2024 05:50:52 -0400 Received: from lists.gnu.org ([209.51.188.17]:37400) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sSCvS-0006S6-9V for submit@debbugs.gnu.org; Fri, 12 Jul 2024 05:50:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sSCvR-00086m-Pa for guix-patches@gnu.org; Fri, 12 Jul 2024 05:50:49 -0400 Received: from m42-5.mailgun.net ([69.72.42.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sSCvN-0003Wh-8e for guix-patches@gnu.org; Fri, 12 Jul 2024 05:50:49 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.wilsonb.com; q=dns/txt; s=krs; t=1720777843; x=1720785043; h=Content-Type: MIME-Version: Message-Id: Subject: Subject: From: From: To: To: Date: Sender: Sender; bh=s81blLe+TkiiPP+RcFNIC8Cj9ooBI9BFu/vR2jo9XDA=; b=v3SpAoZmBScLG+AZskeW1mQpu+0Buwj+ReZ7QMs34uRl33/goBSR61FVcNIRinXdQPxjUd1YE2GzOSIowBqFhyec5ExrUKG5NIx3NWwsWPxX6vz13g51IdTitUE2ebdy+8BlZzcarTNLDXYjeZffO8cIh5xT4v4VYn5lCNPPyILIsi1RKVCdiPP+jHglHjhmXH+xC1R/mwT+V23jzlotWTZlBkGM6i4nX1n4zFCUxNLhEdGBYGQhdIbSKWJJyArCmTWrg6DyTwQjW6espN2fpDLI7sIZJECq7ZmOqGXd/iHFg4ow6Lbyuab1eub8ieAvMt9bOhWYVSvetHOe/N8SHw== X-Mailgun-Sending-Ip: 69.72.42.5 X-Mailgun-Sid: WyI5MmEzMyIsImd1aXgtcGF0Y2hlc0BnbnUub3JnIiwiMDg1NDdhIl0= Received: from wilsonb.com (wilsonb.com [104.199.203.42]) by 28a30437924b with SMTP id 6690fc73c143980835bdd703 (version=TLS1.3, cipher=TLS_AES_128_GCM_SHA256); Fri, 12 Jul 2024 09:50:43 GMT Received: from localhost (p1267142-ipngn3402fukuhanazo.fukushima.ocn.ne.jp [125.174.241.142]) by wilsonb.com (Postfix) with ESMTPSA id 394DCA1BBA for ; Fri, 12 Jul 2024 09:50:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wilsonb.com; s=201703; t=1720777841; bh=s81blLe+TkiiPP+RcFNIC8Cj9ooBI9BFu/vR2jo9XDA=; h=Date:To:From:Subject:From; b=rxCHjvMBN9jpMtsXusZbWYa6dUGoicg2Xl9iQgVMlqm0FSffUhCErtx4xku1k6+G7 xH6crR86M6v1/qaygpNPOZA26Sr2z+RXXe5HoIN7YCgxeRvG6uwZ+NkqQH6dRnS4Rk d7yuXP6pWG0LzHBMsFOd3Pv6pdz85rpOKFHDS2EvD0nl5xyOthUtaUSCm9coJWzT2J 8AP+5RDBXVnDOrlcVhB/E0oyhkhah6CgSL39evUnXGPgOm3yQH8BezzWprcQRuUvZd kWrmaqsaBfD0XRO6SFjXsbJwDrHZfaDwc2gHsGYtnQwTdkUrakNIb7f/vg5XQkIJIK +0TZ7QU+HOjBSRntbq/WrRSZNAjp4K1BloEcMk92dJVdmIiwv2xOh0MJ+6dWrKXb9I ij+LX+LBhU9ExZ00oo6McL14tYClarEimulawSJfx50PrFHan4StzGO1PhgACq9Q6D Ixuk8nMfNI83rLkC14aZ862i2ZAtbKR8FIZfS2sws+SH0R5e1dqk9xr/T75XF5Q7uE e+kBtVf7V6vRfbYDEJQAHWDNmd22XXoRZFEsT+XNaO1KfdNK+2sWOv5FSlVEmQQCd5 tjZXQ0t6axrSUWT4Ys3XRJ9rRWwQFsq+9OoPqoCF+YyztYwK6Myj5ZMvUvWr5JO/M1 Na99S+DzopkkdoNeukp9FY00= Date: Fri, 12 Jul 2024 18:50:39 +0900 Message-Id: <2PLKK1GND1Y65.3DPU3DJOTRHJH@wilsonb.com> User-Agent: mblaze/1.2 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_1a0f869b58f81bf57f260f57_=_" Received-SPF: pass client-ip=69.72.42.5; envelope-from=bounce+686de0.08547a-guix-patches=gnu.org@mg.wilsonb.com; helo=m42-5.mailgun.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: "B. Wilson" X-ACL-Warn: , "B. Wilson via Guix-patches" From: "B. Wilson via Guix-patches" via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 4923C663B1 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -7.10 X-Spam-Score: -7.10 X-TUID: GDAHvfA+Et8d This is a multipart message in MIME format. ------_=_1a0f869b58f81bf57f260f57_=_ Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey Guix, This patch updates libexec/dhclient-script to use resolvconf instead of directly editing /etc/resolv.conf, similar to dhcpcd and friends. This allows dhclient to play nicely with other clients which may want to contend for /etc/resolv.conf control. My particular use case is running a l= ocal dnsmasq instance, configured to allow using the various DNS servers of mult= iple simultaneous VPN connections. Ideally, this would be an upstream patch, but ISC announced end of maintena= nce in 2022, so until we migrate dhcp-client-service-type to something else, I believe it makes sense to have the patch here. Using a bare-bones.scm VM, I have confirmed that this transparently works i= n the default case where no /etc/resolvconf.conf is setup. In a separate patc= h, I will be sharing my resolvconf-service-type definition that enables the dnsm= asq integration I mention. Note, however, that switching to this via a system reconfigure has the possibility of nuking DNS until the next time dhclient tries to update them= =2E Simply restarting the networking service is enough to force this, though. Thoughts? ------_=_1a0f869b58f81bf57f260f57_=_ Content-Disposition: attachment; filename*0*=UTF-8''0001-gnu-isc-dhcp-Patch-dhclient-to-support-resolvcon; filename*1*=f.patch Content-Type: text/x-diff Content-Transfer-Encoding: quoted-printable =46rom c96e6489117b2087db86161cc2b3fe0e813ac09f Mon Sep 17 00:00:00 2001 =46rom: "B. Wilson" =44ate: Fri, 12 Jul 2024 18:03:48 +0900 =53ubject: [PATCH] gnu: isc-dhcp: Patch dhclient to support resolvconf. =0A* gnu/packages/patches/dhclient-script-resolvconf-support.patch: New pat= =63h. =2A gnu/local.mk (dist_patch_DATA): Add it. =2A gnu/packages/admin.scm (isc-dhcp): Patch dhclient-script and update wra= =70per. =2D-- =20gnu/local.mk | 1 + =20gnu/packages/admin.scm | 21 ++++--- =20.../dhclient-script-resolvconf-support.patch | 58 +++++++++++++++++++ =203 files changed, 72 insertions(+), 8 deletions(-) =20create mode 100644 gnu/packages/patches/dhclient-script-resolvconf-suppo= =72t.patch =0Adiff --git a/gnu/local.mk b/gnu/local.mk =69ndex ea4cc251ae..e574154ef3 100644 =2D-- a/gnu/local.mk =2B++ b/gnu/local.mk =40@ -1116,6 +1116,7 @@ dist_patch_DATA =3D \ =20 %D%/packages/patches/debops-debops-defaults-fall-back-to-less.patch \ =20 %D%/packages/patches/dee-vapi.patch \ =20 %D%/packages/patches/dfu-programmer-fix-libusb.patch \ =2B %D%/packages/patches/dhclient-script-resolvconf-support.patch \ =20 %D%/packages/patches/diffutils-fix-signal-processing.patch \ =20 %D%/packages/patches/directfb-davinci-glibc-228-compat.patch \ =20 %D%/packages/patches/dkimproxy-add-ipv6-support.patch \ =64iff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm =69ndex f0aa6adc85..509dfaba20 100644 =2D-- a/gnu/packages/admin.scm =2B++ b/gnu/packages/admin.scm =40@ -1477,7 +1477,9 @@ (define-public isc-dhcp =20 version "/dhcp-" version ".tar.gz"))= =0A (sha256 =20 (base32 =2D "1ivkvhhvqxap6c51cli7pa6xn76ngxri1zbl45ishz4ranxidi0a"= =29))) =2B "1ivkvhhvqxap6c51cli7pa6xn76ngxri1zbl45ishz4ranxidi0a"= =29) =2B (patches (search-patches =2B "dhclient-script-resolvconf-support.patch")))= =29 =20 (build-system gnu-build-system) =20 (arguments =20 `(#:parallel-build? #f =40@ -1571,12 +1573,13 @@ (define-public isc-dhcp =20 (lambda* (#:key inputs outputs #:allow-other-keys) =20 ;; Install the dhclient script for GNU/Linux and make sur= =65 =20 ;; if finds all the programs it needs. =2D (let* ((out (assoc-ref outputs "out")) =2D (libexec (string-append out "/libexec")) =2D (coreutils (assoc-ref inputs "coreutils*")) =2D (inetutils (assoc-ref inputs "inetutils")) =2D (grep (assoc-ref inputs "grep*")) =2D (sed (assoc-ref inputs "sed*")) =2B (let* ((out (assoc-ref outputs "out")) =2B (libexec (string-append out "/libexec")) =2B (coreutils (assoc-ref inputs "coreutils*")) =2B (inetutils (assoc-ref inputs "inetutils")) =2B (grep (assoc-ref inputs "grep*")) =2B (resolvconf (assoc-ref inputs "resolvconf*")) =2B (sed (assoc-ref inputs "sed*")) =20 (debianutils (assoc-ref inputs "debianutils"))) =20 (substitute* "client/scripts/linux" =20 (("/sbin/ip") =40@ -1592,7 +1595,8 @@ (define-public isc-dhcp =20 ,(map (lambda (dir) =20 (string-append dir "/bin:" =20 dir "/sbin")) =2D (list inetutils coreutils grep sed debianutil= =73)))))))))) =2B (list inetutils coreutils grep sed resolvconf= =0A+ debianutils)))))))))) =20= =20 (native-inputs =20 (list config perl file)) =40@ -1621,6 +1625,7 @@ (define-public isc-dhcp =20= =20 ("coreutils*" ,coreutils) =20 ("grep*" ,grep) =2B ("resolvconf*" ,openresolv) =20 ("sed*" ,sed))) =20= =20 (home-page "https://www.isc.org/dhcp/") =64iff --git a/gnu/packages/patches/dhclient-script-resolvconf-support.patc= =68 b/gnu/packages/patches/dhclient-script-resolvconf-support.patch =6Eew file mode 100644 =69ndex 0000000000..e4fd8f649e =2D-- /dev/null =2B++ b/gnu/packages/patches/dhclient-script-resolvconf-support.patch =40@ -0,0 +1,58 @@ =2BImplement resolvconf support =2B =2BDue to the potential for multiple sources contenting for /etc/resol.conf= =0A+control, this patch replaces direct file munging with resolvconf indire= =63tion. =2B =2B--- a/client/scripts/linux 1970-01-01 09:00:01.000000000 +0900 =2B+++ b/client/scripts/linux 1970-01-01 09:00:01.000000000 +0900 =2B@@ -36,11 +36,11 @@ =2B # This updated version mostly follows Debian script by Andrew Pollock e= =74 al. =2B make_resolv_conf() { =2B local new_resolv_conf =2B+ new_resolv_conf=3D$(mktemp) =2B=20 =2B # DHCPv4 =2B if [ -n "$new_domain_search" ] || [ -n "$new_domain_name" ] || =2B- [ -n "$new_domain_name_servers" ]; then =2B- new_resolv_conf=3D/etc/resolv.conf.dhclient-new =2B+ [ -n "$new_domain_name_servers" ]; then =2B rm -f $new_resolv_conf =2B=20 =2B if [ -n "$new_domain_name" ]; then =2B@@ -70,17 +70,12 @@ =2B echo nameserver $nameserver >>$new_resolv_conf =2B done =2B else # keep 'old' nameservers =2B- sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p /etc= =2Fresolv.conf >>$new_resolv_conf =2B+ resolvconf -l "$interface.dhcp" | sed -n /^\w*[Nn][Aa][Mm][= =45e][Ss][Ee][Rr][Vv][Ee][Rr]/p >>$new_resolv_conf =2B fi =2B=20 =2B- if [ -f /etc/resolv.conf ]; then =2B- chown --reference=3D/etc/resolv.conf $new_resolv_conf =2B- chmod --reference=3D/etc/resolv.conf $new_resolv_conf =2B- fi =2B- mv -f $new_resolv_conf /etc/resolv.conf =2B+ resolvconf -a "$interface.dhpc" <"$new_resolv_conf" =2B # DHCPv6 =2B elif [ -n "$new_dhcp6_domain_search" ] || [ -n "$new_dhcp6_name_ser= =76ers" ]; then =2B- new_resolv_conf=3D/etc/resolv.conf.dhclient-new =2B rm -f $new_resolv_conf =2B=20 =2B if [ -n "$new_dhcp6_domain_search" ]; then =2B@@ -97,14 +92,10 @@ =2B echo nameserver $nameserver >>$new_resolv_conf =2B done =2B else # keep 'old' nameservers =2B- sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p /etc= =2Fresolv.conf >>$new_resolv_conf =2B+ resolvconf -l "$interface.dhcp6" | sed -n /^\w*[Nn][Aa][Mm]= =5BEe][Ss][Ee][Rr][Vv][Ee][Rr]/p >>$new_resolv_conf =2B fi =2B=20 =2B- if [ -f /etc/resolv.conf ]; then =2B- chown --reference=3D/etc/resolv.conf $new_resolv_conf =2B- chmod --reference=3D/etc/resolv.conf $new_resolv_conf =2B- fi =2B- mv -f $new_resolv_conf /etc/resolv.conf =2B+ resolvconf -a "$interface.dhpc6" <"$new_resolv_conf" =2B fi =2B } =2B=20 =2D-=20 =32.45.2 =0A= ------_=_1a0f869b58f81bf57f260f57_=_--