[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bash-5.0_p1: wildcard expansion bug with unreadable intermediate directo
From: |
Andrew Church |
Subject: |
bash-5.0_p1: wildcard expansion bug with unreadable intermediate directories |
Date: |
Fri, 01 Feb 2019 03:44:19 +0900 |
When expanding a wildcard following a partially quoted pathname,
expansion fails if an intermediate directory is not readable, even when
the final directory (the one in which expansion is performed) is
readable. This does not occur if quotes are not used in the pathname,
or if the quoted part of the pathname does not cross an unreadable
directory (compare second and third expansions in the commands below).
This does not occur in unpatched bash-5.0.
Test case:
bash-5.0$ mkdir -m700 /tmp/a /tmp/a/b
bash-5.0$ touch /tmp/a/b/c
bash-5.0$ echo /tmp/a/b/* "/tmp/a/"b/* "/tmp/a/b"/*
/tmp/a/b/c /tmp/a/b/c
bash-5.0$ chmod -r /tmp/a
bash-5.0$ echo /tmp/a/b/* "/tmp/a/"b/* "/tmp/a/b"/*
/tmp/a/b/c /tmp/a/b/*
Note how the third expansion in the last command fails even though
/tmp/a/b is readable.
--Andrew Church
http://achurch.org/
- bash-5.0_p1: wildcard expansion bug with unreadable intermediate directories,
Andrew Church <=