diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2022-10-18 13:28:23 +0000 |
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2022-10-22 17:05:31 +0000 |
| commit | 8d7221ca2dd5e0b6c633761b314cffed82ddca72 (patch) | |
| tree | 8adf5bafb3e72104f4e0f5f085d965b7a3215429 /bin/sh/profile | |
| parent | 4c9db9566e67779905c667c2719e5b1628c3af3d (diff) | |
| download | src-8d7221ca2dd5e0b6c633761b314cffed82ddca72.tar.gz src-8d7221ca2dd5e0b6c633761b314cffed82ddca72.zip | |
sh: when loading profile, read only .sh files.
Reviewers: jilles, eugen_grosbein.net, cy
Subscribers: imp
Differential Revision: https://reviews.freebsd.org/D37034
Diffstat (limited to 'bin/sh/profile')
| -rw-r--r-- | bin/sh/profile | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/bin/sh/profile b/bin/sh/profile index ac6acced6596..5b8a57d4b7b2 100644 --- a/bin/sh/profile +++ b/bin/sh/profile @@ -13,17 +13,12 @@ # 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/. +# 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/* ; do - case ${_file} in - *[~#]|*.OLD|*.bak|*.orig|*,v) - continue - ;; - esac + for _file in "${_dir}"/profile "${_dir}"/profile.d/*.sh ; do if [ -f "${_file}" ] ; then case :${_loaded}: in *:"${_file}":*) |
