diff --git a/dist b/dist index 9c0e36ec42a2d9bfefacb21ac6354c9ddd910533..1fe92cf0fdf9c2625d878a2ace258f64c1e8ca44 100644 --- a/dist +++ b/dist @@ -1 +1 @@ -an8 +an8_10 diff --git a/which.spec b/which.spec index dfabeda6b6c4a148ef7086ac057d810550477a38..4e9daabb3e7518f7f288ffa468b134374997b365 100644 --- a/which.spec +++ b/which.spec @@ -2,7 +2,7 @@ Summary: Displays where a particular program in your path is located Name: which Version: 2.21 -Release: 20%{anolis_release}%{?dist} +Release: 21%{anolis_release}%{?dist} License: GPLv3 Source0: http://ftp.gnu.org/gnu/which/%{name}-%{version}.tar.gz Source1: which2.sh @@ -59,9 +59,14 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir %doc EXAMPLES README AUTHORS NEWS %changelog -* Mon Dec 11 2023 liuzhilin - 2.21-20.0.1 +* Thu Sep 18 2025 Chang Gao - 2.21-21.0.1 - Add doc sub package +* Thu Jul 03 2025 Than Ngo - 2.21-21 +- Add a check to ensure that /proc/$$/exe can be read + thanks to mbliss@redhat.com for the report and the proposed patch + Resolves: RHEL-101069 + * Wed Mar 22 2023 Than Ngo - 2.21-20 - Related: #2140566, bring test over from Brew dist-git diff --git a/which2.sh b/which2.sh index bca53475f48b5e1a935fe71a8d204be425d3a605..d407c0a1d8f4029f559e3b2fa48ba6e273ee174a 100644 --- a/which2.sh +++ b/which2.sh @@ -1,7 +1,14 @@ # shellcheck shell=sh # Initialization script for bash, sh, mksh and ksh -case "$(basename $(readlink /proc/$$/exe))" in + +if [ -r /proc/$$/exe ]; then + SHELLNAME=$(basename $(readlink /proc/$$/exe)) +else + SHELLNAME="unknown" +fi + +case "$SHELLNAME" in *ksh*) which_declare="" which_opt=""