From nobody Wed Nov 02 09:31:45 2022 X-Original-To: dev-commits-src-all@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 4N2M8x31z6z4ggTL; Wed, 2 Nov 2022 09:31:45 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4N2M8x2bW6z3qmS; Wed, 2 Nov 2022 09:31:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667381505; 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=/Q4xG2XRyFIY+jWySCpHMOZvoBbQJa/j2CkBXcaFQyc=; b=Dr7t/9a0YZtQbuc7M6ZqgXGd0tm5Xm4ENlvk6RIb1LxpDILMsMkRik6vBSAqcDXObx37Pi ek+HiKIlQGIQiqJ/Pp4sQ1FGRr6owzc67y0b8Ltt62xgV6YuzbyONWYq0Ih3S0OACfAaml tGFdlPuuYC5qAYyKweZJzZC1QOKdeYjsAAC89hd6hIWpRLbbYhiHfrLA3VPgh1HWmmdezA ZmWAy3IPo5Q/5hb2XK3AAhh7/AM/fpDld7y/JlLP4T10tr1AwvR/JVT30mVKh8UQRyOZIQ dKtSlfWhFfhRTfG5YzSyWKG47MeRV2Cz0yap8I83+g+CQmNyyPK5fqE+sUtP6A== 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 4N2M8x1j8qzqxD; Wed, 2 Nov 2022 09:31:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2A29VjUe025278; Wed, 2 Nov 2022 09:31:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A29VjvH025277; Wed, 2 Nov 2022 09:31:45 GMT (envelope-from git) Date: Wed, 2 Nov 2022 09:31:45 GMT Message-Id: <202211020931.2A29VjvH025277@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: 540add272df6 - stable/13 - sh: read more profile files. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 540add272df643f53e1bd7786c6eee75fda5317b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667381505; 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=/Q4xG2XRyFIY+jWySCpHMOZvoBbQJa/j2CkBXcaFQyc=; b=LmjJPz+P3w0eo0dKhmQhQk4BuXU0o6GoZrv4v9ZD3o3imIvbC6ZS6+CBn/Yfx02TABRdhC 5MjRNtvX/Xjcrw/ik1OHsJaWhm7IF/31MHE1P4beW3dFuHbd8cJrEMp6Zp6WOnweRX4O7I tj9YaiChfhIP9u1m7Mjm/eykoCLukz1wh5ZhwwuDT5CxqZAsbuH0hE27GSx3C6DqJKGHe5 MAh+W8eCr+wU6CmEkcpv6mfC+IKP4pcThkUSwRktajjxQGJofDgj0Rbp6KnDpTpu5ZgvfD TTz8c9+S64sg/unaqimioKleisCt8w38RNZmveNNflKu4D/OCm1FPA6HJ6tikg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667381505; a=rsa-sha256; cv=none; b=J7lkJ0bBmBtjAP0xKjuTQlbMv07R/GaedNZmPiZQrop3iXyjUMwF7gSFn3aMFgzS6gfzNM gHoZqA4cYLgMcnzTU8kl7VgkzEB3NA+j2uzCWSB1dH5jHWQ1iccT3Qo+WgXTEJ1vx50a12 jb6FvcdRHYbxwBRl0XTEgQ90dP/UpTIUOu4UY0DBmQ3Twvr3jT4+YLufjwxmodIYokcHis 7KsmCFZL7mlXBjxBE1spTriJSQIuuCL5ecHbUD5OUjw74HN4YVEA8uzKfaoMNddjfoL/48 tN6maUZC80A6J4ZMk0A7AWrXgzn0jHR2nyQv6PVWIXx3CJE4jNDAzcapR32YyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=540add272df643f53e1bd7786c6eee75fda5317b commit 540add272df643f53e1bd7786c6eee75fda5317b Author: Dag-Erling Smørgrav AuthorDate: 2022-09-09 13:08:43 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2022-11-02 09:30:41 +0000 sh: read more profile files. Differential Revision: https://reviews.freebsd.org/D36505 MFC after: 1 month (cherry picked from commit 497cdf9673ec53d59634bb78862cd8dea3d5c155) sh: when loading profile, skip obvious scratch files. Differential Revision: https://reviews.freebsd.org/D36856 (cherry picked from commit d3890a547d201d1f5043e51baa406ac9d5d3a60a) sh: when loading profile, read only .sh files. Reviewers: jilles, eugen_grosbein.net, cy Subscribers: imp Differential Revision: https://reviews.freebsd.org/D37034 (cherry picked from commit 8d7221ca2dd5e0b6c633761b314cffed82ddca72) --- bin/sh/profile | 20 ++++++++++++++++++++ etc/mtree/BSD.root.dist | 2 ++ 2 files changed, 22 insertions(+) diff --git a/bin/sh/profile b/bin/sh/profile index b77c8787c79d..5b8a57d4b7b2 100644 --- a/bin/sh/profile +++ b/bin/sh/profile @@ -12,3 +12,23 @@ # msgs -q # Allow terminal messages # mesg y + +# Load each .sh file in /etc/profile.d/, then /usr/local/etc/profile, +# then each .sh file in /usr/local/etc/profile.d/. +_loaded=${_loaded:-/etc/profile} +export _loaded +for _dir in /etc /usr/local/etc ; do + for _file in "${_dir}"/profile "${_dir}"/profile.d/*.sh ; do + if [ -f "${_file}" ] ; then + case :${_loaded}: in + *:"${_file}":*) + ;; + *) + _loaded="${_loaded:+${_loaded}:}${_file}" + . "${_file}" + ;; + esac + fi + done +done +unset _loaded _dir _file diff --git a/etc/mtree/BSD.root.dist b/etc/mtree/BSD.root.dist index 8bea31212217..5ee5da8ee149 100644 --- a/etc/mtree/BSD.root.dist +++ b/etc/mtree/BSD.root.dist @@ -84,6 +84,8 @@ .. ppp .. + profile.d + .. rc.conf.d .. rc.d