Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Oct 2022 09:13:38 +0200
From:      FreeBSD User <freebsd@walstatt-de.de>
To:        Dag-Erling =?UTF-8?B?U23DuHJncmF2?= <des@FreeBSD.org>
Cc:        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.
Message-ID:  <20221009091405.171bde4f@thor.intern.walstatt.dynvpn.de>
In-Reply-To: <202210012131.291LVIY8044703@gitrepo.freebsd.org>
References:  <202210012131.291LVIY8044703@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

Am Sat, 1 Oct 2022 21:31:18 GMT
Dag-Erling Smørgrav <des@FreeBSD.org> schrieb:

> The branch main has been updated by des:
> 
> URL: https://cgit.FreeBSD.org/src/commit/?id=497cdf9673ec53d59634bb78862cd8dea3d5c155
> 
> commit 497cdf9673ec53d59634bb78862cd8dea3d5c155
> Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
> AuthorDate: 2022-09-09 13:08:43 +0000
> Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
> CommitDate: 2022-10-01 21:30:56 +0000
> 
>     sh: read more profile files.
>     
>     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(+)
> 
> 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=${_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="${_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
> 

According to this commit, I took the liberty opening a PR (id=266913) because some ports, like
lang/gawk and x11-toolkits/vte3, install their SH and CSH set of shell configuration files into
${LOCALBASE}/etc/profile.d/, i.e. vte.{sh|csh}. 
The proposed/commited /etc/profile includes also *.csh files, which triggers some disturbing
error messages during a full login (i.e. su - ) and the list of those messages increase with
the number of unfitting shell configuration files.
I do not have a general solution, maybe someone more enlighted can take a look at this.

Thanks and kind regards,

O. Hartmann

-- 
O. Hartmann



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20221009091405.171bde4f>