From nobody Sun Oct 09 13:26:23 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 4MljVp3Ftrz4dg7l; Sun, 9 Oct 2022 13:26:26 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MljVp2MsCz3NfF; Sun, 9 Oct 2022 13:26:26 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTP id hV9DoZhDpSp39hWK1ofi4y; Sun, 09 Oct 2022 13:26:25 +0000 Received: from spqr.komquats.com ([70.66.148.124]) by cmsmtp with ESMTPA id hWJzoKbRflz8phWK0ox7Mf; Sun, 09 Oct 2022 13:26:25 +0000 X-Authority-Analysis: v=2.4 cv=VvEwvs6n c=1 sm=1 tr=0 ts=6342cc01 a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=Qawa6l4ZSaYA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=FmtEDqYgity_RdL7sdEA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 4D12D65D; Sun, 9 Oct 2022 06:26:23 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 389B3161; Sun, 9 Oct 2022 06:26:23 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: FreeBSD User cc: Dag-Erling =?UTF-8?B?U23DuHJncmF2?= , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 497cdf9673ec - main - sh: read more profile files. In-reply-to: <20221009091405.171bde4f@thor.intern.walstatt.dynvpn.de> References: <202210012131.291LVIY8044703@gitrepo.freebsd.org> <20221009091405.171bde4f@thor.intern.walstatt.dynvpn.de> Comments: In-reply-to FreeBSD User message dated "Sun, 09 Oct 2022 09:13:38 +0200." 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=us-ascii Date: Sun, 09 Oct 2022 06:26:23 -0700 Message-Id: <20221009132623.389B3161@slippy.cwsent.com> X-CMAE-Envelope: MS4xfKAnJMo+Xbto4jA+fsed5OHH0jI5+AVNXkpLKxioY/erSdF09rMePUNiq/bqyzYqPAR2Vg1iwhI9SN0YVwZx6tGQWE+brRkpG65x+eyAGmGUKQqSiNas NPPLto7pyuBXVR3ow5UOKRe1Wt7R5Q77HcPanTmO5YoIRnAwb/Oxmk0+OnFQocG8m0CtrYnotzM77wFFm80fyZmDqI5iZDHaJbAOOgoWhxB8rAAo4MhJJYi6 a7p9JVSO0opohw73vYcTjAiPxwFnq8N/g7Qq/MEGD2HOTOpcdKtF3QBewwybGvBls3CbCQe67ozEABaWbon537t1xtILSFm4RAc4mh/Pvg+HtOJpPlbfxJVx LNLsuGJo X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Rspamd-Queue-Id: 4MljVp2MsCz3NfF X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N In message <20221009091405.171bde4f@thor.intern.walstatt.dynvpn.de>, FreeBSD Us er writes: > Am Sat, 1 Oct 2022 21:31:18 GMT > Dag-Erling Sm=C3=B8rgrav schrieb: > > > The branch main has been updated by des: > >=20 > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D497cdf9673ec53d59634bb7886= > 2cd8dea3d5c155 > >=20 > > commit 497cdf9673ec53d59634bb78862cd8dea3d5c155 > > Author: Dag-Erling Sm=C3=B8rgrav > > AuthorDate: 2022-09-09 13:08:43 +0000 > > Commit: Dag-Erling Sm=C3=B8rgrav > > CommitDate: 2022-10-01 21:30:56 +0000 > >=20 > > sh: read more profile files. > > =20 > > Differential Revision: https://reviews.freebsd.org/D36505 > > MFC after: 1 month > > --- > > bin/sh/profile | 20 ++++++++++++++++++++ > > etc/mtree/BSD.root.dist | 2 ++ > > 2 files changed, 22 insertions(+) > >=20 > > diff --git a/bin/sh/profile b/bin/sh/profile > > index b77c8787c79d..afcbeaf4110b 100644 > > --- a/bin/sh/profile > > +++ b/bin/sh/profile > > @@ -12,3 +12,23 @@ > > # msgs -q > > # Allow terminal messages > > # mesg y > > + > > +# Load each file in /etc/profile.d/, then /usr/local/etc/profile, then > > +# each file in /usr/local/etc/profile.d/. > > +_loaded=3D${_loaded:-/etc/profile} > > +export _loaded > > +for _dir in /etc /usr/local/etc ; do > > + for _file in "${_dir}"/profile "${_dir}"/profile.d/* ; do > > + if [ -f "${_file}" ] ; then > > + case :${_loaded}: in > > + *:"${_file}":*) > > + ;; > > + *) > > + _loaded=3D"${_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 > >=20 > > According to this commit, I took the liberty opening a PR (id=3D266913) bec= > ause some ports, like > lang/gawk and x11-toolkits/vte3, install their SH and CSH set of shell conf= > iguration files into > ${LOCALBASE}/etc/profile.d/, i.e. vte.{sh|csh}.=20 > The proposed/commited /etc/profile includes also *.csh files, which trigger= > s some disturbing > error messages during a full login (i.e. su - ) and the list of those messa= > ges increase with > the number of unfitting shell configuration files. > I do not have a general solution, maybe someone more enlighted can take a l= > ook at this. I had the same problem. Though my source tree contains the changes I reverted them locally on each machine and etcupdate will ensure that this never creeps back in again. This is clearly a POLA violation and probably needs a knob to either enable it if disabled by default or disable it if enabled by default. I think a little redesign with the consideration that some ports do weird things might be the path forward. Part of this redesign might be documentation of some standards port maintainers must adhere to or maybe something a little more subtle such as only execute these additional scripts under certain conditions, such as testing $SHELL before executing ${LOCALBASE}/profile.d/* scripts. Personally, I like option 1, document standards which port maintainers must follow. Each additional script must test $SHELL. Most if not all additional profile scripts provided by add-on software assume bash. Not everyone uses bash. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0