Bug 1869597 - built-in [ -r xxx ] always return false
Summary: built-in [ -r xxx ] always return false
Keywords:
Status: CLOSED DUPLICATE of bug 1869030
Alias: None
Product: Fedora
Classification: Fedora
Component: bash
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Siteshwar Vashisht
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-18 10:23 UTC by Mattias Ellert
Modified: 2020-08-24 08:45 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-08-24 08:45:50 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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 ***


Note You need to log in before you can comment on or make changes to this bug.