From nobody Mon Apr 07 13:14:50 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZWV6z0DnYz5tG52; Mon, 07 Apr 2025 13:14:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZWV6y53kzz3GNP; Mon, 07 Apr 2025 13:14:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1744031690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nq4E8BsAsdf/UFRTdT/BE0+Oux486udswvTB1lA4EJ8=; b=jWZNUsEDB2ZRuY2Q8iX/+R/IJkRIB7pIwKdUo9K/kLR/zS+yuAj4+dM9MNUVzFwuZKKs8T PUJZULlDF3kqJEN9taci9YfDW4tDyDAAf4q/ypfYn0PUkD11TnP9EBeOxhVHdPCy1TP/eB h7PezBIPWj84fE5JQwUHEYqmVm4nEmOSkbRoFyHCKeI7CcgHJADJdzG176WIRic5TBWB2a 3MWXVKBq+c2pQKCw6FH1nXnk5j9/twVkG68Qc5OiTgxD3G84lxbH1gf5y6oeKfWqAIpqw2 l5J66L2Wt4qmAPFOIlMM5IG+pkUDYJEolUA0x0HPI40nVxoI0aohXDNtbDgMgw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1744031690; a=rsa-sha256; cv=none; b=GmPq/mlLt1S1F/91yfVYwA/yJd0SUcWCfOGtknspNDCuDKKLZS/j2uOen8sBj1bMt/QCSE l9+RVMpvDmrqUC+yBH3LOzXgGsHJGhWzZzr3tl9/bA1SGId1koN8rUJWl8SMbMLwbxhpqF udM7Rm3lkL8jhn8R//fy0qgqwSnkzk6OzOL7WQq7wktvfL4oP3HakKGCGfxTsRySv7m6j1 Zz3WVj+lyag0800YZ+foABCIDc7ugJZXX0ojIGrykcL9vCdcVgk8v3oHRAmx5DBTKnAg8H 1rJhNd2uJPILbFZXw7z3mFIoxlDwk08leCFvTootEtOpShOTf4SSdKf/pSRpmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1744031690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nq4E8BsAsdf/UFRTdT/BE0+Oux486udswvTB1lA4EJ8=; b=K+ne/Qv+VIihgd4AiQE1jd8AyDp47cT/AqsGxIhfWh4LGwxyBeJprcmlpDaD96QhbCwSAS Nue5L4YFjXG3kE3oL4mZsdxN3ukxPsUkoQtCXnwohwJegGaI8N8Ol3Gjv5yCISjJdW27sD pi9vEi7NDCiqmiL+HCC/jVimPG+KX04SS+rblpAe0Mm90CFsqDcNCJwAd8MaXP3mntJHXg du9Mn8lM0uBQVBLlIMkcfM8fFAB6Qxr346QBAhrGsO6EerQKFyApYcYi19EiAWLrKtAhy+ vhglvfxPiM+s4NaBSb9TuP/ut6aoQagxm6H9UMX7DSbt6h+rpnPivRClqaz2lA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ZWV6y3H91znp5; Mon, 07 Apr 2025 13:14:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 537DEorx088715; Mon, 7 Apr 2025 13:14:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 537DEo2s088712; Mon, 7 Apr 2025 13:14:50 GMT (envelope-from git) Date: Mon, 7 Apr 2025 13:14:50 GMT Message-Id: <202504071314.537DEo2s088712@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 49bc071f4088 - main - nsswitch.conf: Avoid modification after installation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 49bc071f40886af46eb90467dfef6cba5f95beec Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=49bc071f40886af46eb90467dfef6cba5f95beec commit 49bc071f40886af46eb90467dfef6cba5f95beec Author: Mark Johnston AuthorDate: 2025-04-07 12:42:08 +0000 Commit: Mark Johnston CommitDate: 2025-04-07 12:42:08 +0000 nsswitch.conf: Avoid modification after installation To implement WITHOUT_NIS, we have a hack in the build which modifies the installed nsswitch.conf to remove NIS compat providers and databases. This hack operates on the installed nsswitch.conf, which means that the installed file size won't match that listed in the metalog. One option would be to maintain two copies of nsswitch.conf, one for each configuration, but that would result in duplication and I don't see a clear way around that. Instead, stage a copy of nsswitch.conf in the libc objdir, and modify that one before installing, so that the version recorded in the metalog matches what actually gets installed. PR: 209718 Reviewed by: kevans, emaste Sponsored by: Klara, Inc. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49300 --- lib/libc/net/Makefile.inc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/libc/net/Makefile.inc b/lib/libc/net/Makefile.inc index 558cf7be5771..58c650b207cf 100644 --- a/lib/libc/net/Makefile.inc +++ b/lib/libc/net/Makefile.inc @@ -1,7 +1,7 @@ # machine-independent net sources .PATH: ${LIBC_SRCTOP}/net -CONFS+= net/hosts net/hosts.equiv net/networks net/nsswitch.conf net/protocols +CONFS+= net/hosts net/hosts.equiv net/networks ${.OBJDIR}/nsswitch.conf net/protocols SRCS+= base64.c ether_addr.c eui64.c \ gai_strerror.c getaddrinfo.c \ gethostbydns.c gethostbyht.c gethostbynis.c gethostnamadr.c \ @@ -176,9 +176,13 @@ MLINKS+=hesiod.3 hesiod_init.3 \ hesiod.3 hesiod_end.3 .endif -afterinstallconfig: modify-nsswitch-conf -modify-nsswitch-conf: .PHONY +all: ${.OBJDIR}/nsswitch.conf + +# Manually stage nsswitch.conf in the object directory so that we can edit it +# before installing. +${.OBJDIR}/nsswitch.conf: ${LIBC_SRCTOP}/net/nsswitch.conf + cp -f ${LIBC_SRCTOP}/net/nsswitch.conf ${.TARGET} .if ${MK_NIS} == "no" sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \ - ${DESTDIR}/etc/nsswitch.conf + ${.TARGET} .endif