From 5581c7c7e2fc3d46cf1ec4c98af3a3b6b53c0e0f Mon Sep 17 00:00:00 2001 From: Jacob Wang Date: Thu, 18 Sep 2025 16:52:51 +0800 Subject: [PATCH 1/2] [BUG]update to which-2.21-21 to #ICYOPD update to which-2.21-21 for bugfix Signed-off-by: Jacob Wang --- dist | 2 +- which.spec | 25 ++++++------------------- which2.sh | 9 ++++++++- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/dist b/dist index 9c0e36e..1fe92cf 100644 --- a/dist +++ b/dist @@ -1 +1 @@ -an8 +an8_10 diff --git a/which.spec b/which.spec index dfabeda..3b24e24 100644 --- a/which.spec +++ b/which.spec @@ -1,8 +1,7 @@ -%define anolis_release .0.1 Summary: Displays where a particular program in your path is located Name: which Version: 2.21 -Release: 20%{anolis_release}%{?dist} +Release: 21%{?dist} License: GPLv3 Source0: http://ftp.gnu.org/gnu/which/%{name}-%{version}.tar.gz Source1: which2.sh @@ -15,22 +14,10 @@ Requires: coreutils BuildRequires: gcc BuildRequires: readline-devel -Requires: glibc -Provides: /usr/bin/which - %description The which command shows the full pathname of a specified program, if the specified program is in your PATH. -%package doc -Summary: Documents for %{name} -BuildArch: noarch -Requires: %{name} = %{version}-%{release} - - -%description doc -Doc pages for %{name} - %prep %setup -q %patch0 -p1 -b .coverity @@ -50,17 +37,17 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir %files %license COPYING +%doc EXAMPLES README AUTHORS NEWS %attr(0644,root,root) %{_sysconfdir}/profile.d/which2.* %{_bindir}/which %{_infodir}/which.info* %{_mandir}/man1/which.1* -%files doc -%doc EXAMPLES README AUTHORS NEWS - %changelog -* Mon Dec 11 2023 liuzhilin - 2.21-20.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 bca5347..d407c0a 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="" -- Gitee From a79a2a63659b63e4093174fb8557f03e10286492 Mon Sep 17 00:00:00 2001 From: "taifu.gc" Date: Sat, 16 Jul 2022 13:27:05 +0800 Subject: [PATCH 2/2] spec: add doc sub package --- which.spec | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/which.spec b/which.spec index 3b24e24..4e9daab 100644 --- a/which.spec +++ b/which.spec @@ -1,7 +1,8 @@ +%define anolis_release .0.1 Summary: Displays where a particular program in your path is located Name: which Version: 2.21 -Release: 21%{?dist} +Release: 21%{anolis_release}%{?dist} License: GPLv3 Source0: http://ftp.gnu.org/gnu/which/%{name}-%{version}.tar.gz Source1: which2.sh @@ -14,10 +15,22 @@ Requires: coreutils BuildRequires: gcc BuildRequires: readline-devel +Requires: glibc +Provides: /usr/bin/which + %description The which command shows the full pathname of a specified program, if the specified program is in your PATH. +%package doc +Summary: Documents for %{name} +BuildArch: noarch +Requires: %{name} = %{version}-%{release} + + +%description doc +Doc pages for %{name} + %prep %setup -q %patch0 -p1 -b .coverity @@ -37,13 +50,18 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir %files %license COPYING -%doc EXAMPLES README AUTHORS NEWS %attr(0644,root,root) %{_sysconfdir}/profile.d/which2.* %{_bindir}/which %{_infodir}/which.info* %{_mandir}/man1/which.1* +%files doc +%doc EXAMPLES README AUTHORS NEWS + %changelog +* 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 -- Gitee