From patchwork Mon Aug 28 15:56:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeroen Roovers X-Patchwork-Id: 806648 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xgxQZ5mDDz9s7v for ; Tue, 29 Aug 2017 02:03:50 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 8C5EF88B09; Mon, 28 Aug 2017 16:03:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HB9BTdN26L3v; Mon, 28 Aug 2017 16:03:44 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id F387E88B11; Mon, 28 Aug 2017 16:03:43 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 1A2361C232E for ; Mon, 28 Aug 2017 16:03:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 1230586E71 for ; Mon, 28 Aug 2017 16:03:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q-X6RGlldhRT for ; Mon, 28 Aug 2017 16:03:40 +0000 (UTC) X-Greylist: delayed 00:07:10 by SQLgrey-1.7.6 Received: from lb1-smtp-cloud7.xs4all.net (lb1-smtp-cloud7.xs4all.net [194.109.24.24]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 87D9A86C65 for ; Mon, 28 Aug 2017 16:03:40 +0000 (UTC) Received: from localhost.localdomain ([212.238.182.54]) by smtp-cloud7.xs4all.net with ESMTPA id mMOjdB2hqAr7rmMOpdr0kR; Mon, 28 Aug 2017 17:56:28 +0200 From: Jeroen Roovers To: buildroot@buildroot.org Date: Mon, 28 Aug 2017 17:56:04 +0200 Message-Id: <20170828155604.24229-1-jer@airfi.aero> X-Mailer: git-send-email 2.14.1 X-CMAE-Envelope: MS4wfHZP2D5uKk5dFlEc/pk07J99nlzzusiEIvteoYZfhrKRs61jKzGNjN9/wBVo0XRMnQnWqx3x/T4W4jMnUsECWmnULzQzsIVDSAwnIl3j3a33JkUOapQX ElHh/neVqQTPGTgGNJWgZ7CZijyvDNU5OMkjH966S0N10rkZ/rMTcc6ne6rG8LzLyNR8Blg61S/W2Q== Subject: [Buildroot] [PATCH] pppd: Do not overwrite /etc/resolv.conf X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" With option usepeerdns, pppd by default writes to /etc/ppp/resolv.conf, which is not very useful and might be impossible. However, when more than one interface can be used for DNS resolution, pppd will overwrite any existing entries when /etc/resolv.conf is used instead, which is bad. Fix this by setting the path to a place we assume is always writeable, /tmp/ppp-resolv.conf, and which does not interfere with other mechanisms that write DNS resolver configurations. --- package/pppd/pppd.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/pppd/pppd.mk b/package/pppd/pppd.mk index 6139c5b085..47937730d5 100644 --- a/package/pppd/pppd.mk +++ b/package/pppd/pppd.mk @@ -36,10 +36,10 @@ PPPD_POST_EXTRACT_HOOKS += PPPD_DROP_INTERNAL_IF_PPOL2TP_H # pppd defaults to /etc/ppp/resolv.conf, which not be writable and is # definitely not useful since the C library only uses -# /etc/resolv.conf. Therefore, we change pppd to use /etc/resolv.conf +# /etc/resolv.conf. Therefore, we change pppd to use /tmp/ppp-resolv.conf # instead. define PPPD_SET_RESOLV_CONF - $(SED) 's,ppp/resolv.conf,resolv.conf,' $(@D)/pppd/pathnames.h + $(SED) 's,/etc/ppp/resolv.conf,/tmp/ppp-resolv.conf,' $(@D)/pppd/pathnames.h endef PPPD_POST_EXTRACT_HOOKS += PPPD_SET_RESOLV_CONF