Bug 1869597

Summary: built-in [ -r xxx ] always return false
Product: [Fedora] Fedora Reporter: Mattias Ellert <mattias.ellert>
Component: bashAssignee: Siteshwar Vashisht <svashisht>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: admiller, kasal, kdudka, ssbarnea, svashisht
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-08-24 08:45:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mattias Ellert 2020-08-18 10:23:58 UTC
Description of problem:

In a Fedora Rawhide mock shell:

<mock-chroot> sh-5.0# cat /etc/fedora-release 
Fedora release 34 (Rawhide)
<mock-chroot> sh-5.0# rpm -q bash
bash-5.0.17-2.fc33.x86_64
<mock-chroot> sh-5.0# [ -r /bin/sh ] && echo OK || echo not OK
not OK
<mock-chroot> sh-5.0# /bin/[ -r /bin/sh ] && echo OK || echo not OK
OK

However, in a Fedora 33 mock shell:

<mock-chroot> sh-5.0# cat /etc/fedora-release
Fedora release 33 (Thirty Three)
<mock-chroot> sh-5.0# rpm -q bash
bash-5.0.17-2.fc33.x86_64
<mock-chroot> sh-5.0# [ -r /bin/sh ] && echo OK || echo not OK
OK
<mock-chroot> sh-5.0# /bin/[ -r /bin/sh ] && echo OK || echo not OK
OK

Version-Release number of selected component (if applicable):

bash-5.0.17-2.fc33.x86_64
(It works in Fedora 33, but is broken in Fedora rawhide)

How reproducible: Many attempts were made...


Steps to Reproduce:
1. mock --root fedora-rawhide-x86_64 --scrub=all
2. mock --root fedora-rawhide-x86_64 --init
3. mock --root fedora-rawhide-x86_64 --shell
4. [ -r /bin/sh ] && echo OK || echo not OK

Actual results:

not OK

Expected results:

OK

Additional info:

The command /bin/[ gives the correct result, the built-in [ does not.
Using
[ -e /bin/sh ] && echo OK || echo not OK
instead gives the expected result.

Comment 1 Kamil Dudka 2020-08-18 12:53:22 UTC
This looks like bug #1869030 to me.

Comment 2 Kamil Dudka 2020-08-24 08:45:50 UTC

*** This bug has been marked as a duplicate of bug 1869030 ***