From 44d98fe13c480f9301b884fd11d50056fafa76ff Mon Sep 17 00:00:00 2001 From: eabdullin Date: Tue, 5 Aug 2025 05:07:43 +0000 Subject: [PATCH] import UBI which-2.21-30.el9_6 --- SOURCES/which2.sh | 8 +++++++- SPECS/which.spec | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/SOURCES/which2.sh b/SOURCES/which2.sh index bca5347..41bce32 100644 --- a/SOURCES/which2.sh +++ b/SOURCES/which2.sh @@ -1,7 +1,13 @@ # 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="" diff --git a/SPECS/which.spec b/SPECS/which.spec index ab99c50..2a78133 100644 --- a/SPECS/which.spec +++ b/SPECS/which.spec @@ -1,7 +1,7 @@ Summary: Displays where a particular program in your path is located Name: which Version: 2.21 -Release: 29%{?dist} +Release: 30%{?dist} License: GPLv3 Source0: http://ftp.gnu.org/gnu/which/%{name}-%{version}.tar.gz Source1: which2.sh @@ -43,6 +43,12 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir %{_mandir}/man1/which.1* %changelog +* Mon Jul 07 2025 Than Ngo - 2.21-30 +- 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-101066 + + * Mon Mar 27 2023 Than Ngo - 2.21-29 - Resolves: #2181974, which fails for long path