From df63b41eb675fbb9a8efbbae1b0c2f57e6db8af8 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Tue, 5 Aug 2025 06:44:28 +0000 Subject: [PATCH] import UBI which-2.21-44.el10_0 --- which.spec | 6 +++++- which2.sh | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/which.spec b/which.spec index 5261ab6..f74b02d 100644 --- a/which.spec +++ b/which.spec @@ -3,7 +3,7 @@ Summary: Displays where a particular program in your path is located Name: which Version: 2.21 -Release: 43%{?dist} +Release: 44%{?dist} License: GPL-3.0-only Source0: http://ftp.gnu.org/gnu/which/%{name}-%{version}.tar.gz Source1: which2.sh @@ -47,6 +47,10 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir %{_mandir}/man1/which.1* %changelog +* Tue Jul 01 2025 Than Ngo - 2.21-44 +- Add a check to ensure that /proc/$$/exe can be read + Resolves: RHEL-97535 + * Tue Oct 29 2024 Troy Dawson - 2.21-43 - Bump release for October 2024 mass rebuild: Resolves: RHEL-64018 diff --git a/which2.sh b/which2.sh index a7db49c..9829a06 100644 --- a/which2.sh +++ b/which2.sh @@ -1,7 +1,12 @@ # 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*|zsh) alias which='alias | /usr/bin/which --tty-only --read-alias --show-tilde --show-dot' ;;