From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 89AF91FF09F for ; Tue, 01 Dec 2026 16:34:10 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 35E5A2095B; Tue, 01 Dec 2026 16:34:07 +0100 (CET) From: Filip Schauer To: pve-devel@lists.proxmox.com Subject: [PATCH lxc v3 1/2] patch dhclient-script to allow ignoring DNS settings Date: Tue, 1 Dec 2026 16:33:43 +0100 Message-ID: <20261201153346.163922-2-f.schauer@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261201153346.163922-1-f.schauer@proxmox.com> References: <20261201153346.163922-1-f.schauer@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1796139242530 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.153 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: K37B6H4FPDHSHBBTSSKCZ2AJ7L64WXWM X-Message-ID-Hash: K37B6H4FPDHSHBBTSSKCZ2AJ7L64WXWM X-MailFrom: f.schauer@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Patch dhclient-script such that DNS settings offered by the DHCP server can be ignored. Signed-off-by: Filip Schauer --- ...fig-deny-rw-mounting-of-sys-and-proc.patch | 2 +- ...-PVE-Config-attach-always-use-getent.patch | 2 +- ...-script-set-RFC3442-classless-routes.patch | 2 +- ...4-dhclient-script-allow-ignoring-dns.patch | 63 +++++++++++++++++++ debian/patches/series | 1 + 5 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 debian/patches/pve/0004-dhclient-script-allow-ignoring-dns.patch diff --git a/debian/patches/pve/0001-PVE-Config-deny-rw-mounting-of-sys-and-proc.patch b/debian/patches/pve/0001-PVE-Config-deny-rw-mounting-of-sys-and-proc.patch index d2194d6..9096f72 100644 --- a/debian/patches/pve/0001-PVE-Config-deny-rw-mounting-of-sys-and-proc.patch +++ b/debian/patches/pve/0001-PVE-Config-deny-rw-mounting-of-sys-and-proc.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Wed, 9 Nov 2016 09:14:26 +0100 -Subject: [PATCH 1/3] PVE: [Config] deny rw mounting of /sys and /proc +Subject: [PATCH 1/4] PVE: [Config] deny rw mounting of /sys and /proc Note that we don't actually make use of this anymore, since we switched to the generated profiles which already do this. diff --git a/debian/patches/pve/0002-PVE-Config-attach-always-use-getent.patch b/debian/patches/pve/0002-PVE-Config-attach-always-use-getent.patch index 190837d..7a09d52 100644 --- a/debian/patches/pve/0002-PVE-Config-attach-always-use-getent.patch +++ b/debian/patches/pve/0002-PVE-Config-attach-always-use-getent.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Tue, 13 Aug 2019 13:57:22 +0200 -Subject: [PATCH 2/3] PVE: [Config] attach: always use getent +Subject: [PATCH 2/4] PVE: [Config] attach: always use getent In debian buster, some libnss plugins (if installed) can cause getpwent to segfault instead of erroring out cleanly. diff --git a/debian/patches/pve/0003-dhclient-script-set-RFC3442-classless-routes.patch b/debian/patches/pve/0003-dhclient-script-set-RFC3442-classless-routes.patch index 9dd2fb9..d466c76 100644 --- a/debian/patches/pve/0003-dhclient-script-set-RFC3442-classless-routes.patch +++ b/debian/patches/pve/0003-dhclient-script-set-RFC3442-classless-routes.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Filip Schauer Date: Wed, 3 Dec 2025 15:03:50 +0100 -Subject: [PATCH 3/3] dhclient-script: set RFC3442 classless routes +Subject: [PATCH 3/4] dhclient-script: set RFC3442 classless routes Due to the removal of hooks in the LXC fork of dhclient-script, the rfc3442-classless-routes hook did not run. As a result, classless static diff --git a/debian/patches/pve/0004-dhclient-script-allow-ignoring-dns.patch b/debian/patches/pve/0004-dhclient-script-allow-ignoring-dns.patch new file mode 100644 index 0000000..249044d --- /dev/null +++ b/debian/patches/pve/0004-dhclient-script-allow-ignoring-dns.patch @@ -0,0 +1,63 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Filip Schauer +Date: Tue, 1 Dec 2026 15:28:13 +0100 +Subject: [PATCH 4/4] dhclient-script: allow ignoring DNS settings + +IF IGNORE_DHCP_SEARCHDOMAINS or IGNORE_DHCP_NAMESERVERS are set in the +environment of the script, ignore the respective DNS settings offered by +the DHCP server. + +Signed-off-by: Filip Schauer +--- + hooks/dhclient-script | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +diff --git a/hooks/dhclient-script b/hooks/dhclient-script +index c87792707..627a5d575 100755 +--- a/hooks/dhclient-script ++++ b/hooks/dhclient-script +@@ -45,11 +45,30 @@ make_resolv_conf() { + local resolv_conf="${ROOTFS}/etc/resolv.conf" + local new_resolv_conf="${ROOTFS}/etc/resolv.conf.dhclient-new" + ++ local old_search="" ++ if [ -n "$IGNORE_DHCP_SEARCHDOMAINS" ]; then ++ if [ -f "$resolv_conf" ]; then ++ old_search=$(sed -n '/^[[:space:]]*\(search\|domain\)[[:space:]]/p' "$resolv_conf") ++ fi ++ local new_domain_name="" ++ local new_domain_search="" ++ local new_dhcp6_domain_search="" ++ fi ++ ++ if [ -n "$IGNORE_DHCP_NAMESERVERS" ]; then ++ local new_domain_name_servers="" ++ local new_dhcp6_name_servers="" ++ fi ++ + # DHCPv4 + if [ -n "$new_domain_search" ] || [ -n "$new_domain_name" ] || + [ -n "$new_domain_name_servers" ]; then + rm -f $new_resolv_conf + ++ if [ -n "$old_search" ]; then ++ echo "$old_search" >>$new_resolv_conf ++ fi ++ + if [ -n "$new_domain_name" ]; then + echo domain ${new_domain_name%% *} >>$new_resolv_conf + fi +@@ -89,6 +108,10 @@ make_resolv_conf() { + elif [ -n "$new_dhcp6_domain_search" ] || [ -n "$new_dhcp6_name_servers" ]; then + rm -f $new_resolv_conf + ++ if [ -n "$old_search" ]; then ++ echo "$old_search" >>$new_resolv_conf ++ fi ++ + if [ -n "$new_dhcp6_domain_search" ]; then + echo "search ${new_dhcp6_domain_search}" >> $new_resolv_conf + fi +-- +2.47.3 + diff --git a/debian/patches/series b/debian/patches/series index 8a37d9b..0025afb 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,5 +3,6 @@ apparmor/0002-apparmor-use-abi-directive-in-apparmor-profiles.patch pve/0001-PVE-Config-deny-rw-mounting-of-sys-and-proc.patch pve/0002-PVE-Config-attach-always-use-getent.patch pve/0003-dhclient-script-set-RFC3442-classless-routes.patch +pve/0004-dhclient-script-allow-ignoring-dns.patch cgroupv1-warnings/0001-PVE-Revert-lxc-conf-drop-cgroup1-config-options-lxc..patch cgroupv1-warnings/0002-PVE-ignore-cgroupv1-settings-with-a-warning.patch -- 2.47.3