From nobody Wed Nov 02 13:42: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 4N2SkY6FLSz4hBj6; Wed, 2 Nov 2022 13:42: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 4N2SkY5T6Qz3FFt; Wed, 2 Nov 2022 13:42:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667396565; 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=be4sfgLbrbwdOpn+r61zP9VQBOTPhJ/WUkycOXl1tp8=; b=yX0HPSC3d4FfhhXwO++kCjpka5v7gRoGAVWyVDa0j4BGQcuabzeIdgY0vViOq9e2HgpJvI D5qSTgrp8cDrJ772VrlO3DXGVRdsLH3F2n59fMQIVTpJ8FMKTmAQoZGN4ZaQwuqQI74rMc BBOZOtwJLIu6YvDdrZ+keeyiyjEqM3aBMaSlK60UvUmEn/nBuI4UK2MTVJfShRwY6Z4L9D TQDC+l0O5+W4Mj6GhbYEY44GgrWx7Fbx170Ti3Yl/vmn20ebs10xIKqCjD4eXVlJZSKZWb a3dqG5n9vcIg4UsDn/0e6IRICQlpMFXfYu33AQFrcBBNA80p0PwVDMkEv5zt4Q== 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 4N2SkY4TPJzxgB; Wed, 2 Nov 2022 13:42: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 2A2DgjFg079644; Wed, 2 Nov 2022 13:42:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A2Dgjr5079643; Wed, 2 Nov 2022 13:42:45 GMT (envelope-from git) Date: Wed, 2 Nov 2022 13:42:45 GMT Message-Id: <202211021342.2A2Dgjr5079643@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: 4ea49af3afe1 - stable/12 - 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/12 X-Git-Reftype: branch X-Git-Commit: 4ea49af3afe127c424a1b843617225fd437b51d1 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667396565; 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=be4sfgLbrbwdOpn+r61zP9VQBOTPhJ/WUkycOXl1tp8=; b=Aw3rBrKTAHLzkkDDDGeJoQ+GU/Gh2P1GCODBPTV1COmgkQUYIlHEXkWWyv7LORT6+JXi7d 5KexM5pfPH9zdweNFGm2wYfbOSVcpc0/nEQ4gL7u9a42DdjVacvfkRWyvNYDqchoSaX9sm v/Jl8M9+jFlfTcM65YoSEyQzZqa9/nGwNesQtko+26tTx+WP5m866ccX8zl/jp5DysYUsl 1qmr47SO50TMDpViqMalqTkAGfpnZtITn64USSkA32/mPFN05jx4t0pZq+GD/2CP/MbsbK L+PjnMW1DUZ+enuO+hFrssOmWM639SvT9mmEbgym7ZWloNPNfOUK5pbas5Po6w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667396565; a=rsa-sha256; cv=none; b=jK3GA4QC+VX8uaghBsulgp6ux4jdMiJBGhD+QpHkCdNJgyLBb76X/kO96W6eMDG2NQ1lk0 sQXhG1MpP9vIVLEQWvslFOQM96WRiaHPTTdX0G8fhb23I+kObUDLSgVN+4IDfZyCv1DHhL BUzzlT0Yax4DaO6Q1bFPQ9tkF3jQRAwqB/yU7mVJmI/WAupj12VTLvACHGFb+5+zOBL7C/ 814h1C1Uw5OLjI7UTAo63lje84on77ah/5wXVngY+BctK9oYwcEMU9dQaZfx0AlN2pDTau TqrDFeyqfZOT6ctUWwt5rWHWCaKvBAq6bZPlqbUqRiU+xZjAgsxgRsFbRH2Xaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=4ea49af3afe127c424a1b843617225fd437b51d1 commit 4ea49af3afe127c424a1b843617225fd437b51d1 Author: Dag-Erling Smørgrav AuthorDate: 2022-09-09 13:08:43 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2022-11-02 12:42:02 +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 cba3e9e73c79..0c70b11eed4e 100644 --- a/etc/mtree/BSD.root.dist +++ b/etc/mtree/BSD.root.dist @@ -74,6 +74,8 @@ .. ppp .. + profile.d + .. rc.conf.d .. rc.d