[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tests: dis/allow '.' in PATH?
From: |
Kamil Dudka |
Subject: |
Re: tests: dis/allow '.' in PATH? |
Date: |
Wed, 24 Nov 2021 08:24:58 +0100 |
On Tuesday, November 23, 2021 11:19:22 PM CET Bernhard Voelker wrote:
> GNU findutils got a bug report for a failing test in the testsuite [1].
> It turned out that the calling environment had the current directory '.'
> in PATH. This triggered a warning in `find -execdir ...` and therefore
> made some tests fail.
>
> [1] https://lists.gnu.org/r/bug-findutils/2021-11/msg00004.html
>
> Of course, the findutils tests could (and probably will) remove '.' from
> PATH, but I wonder if this should or should not be done for other packages
> via a change in 'tests/init.sh' as well?
> If a certain test needs '.' in the PATH, it will have to add it anyway.
>
> Any comments?
Note that having an "empty item" in PATH will have the same effect as
having '.' in PATH, according to POSIX [1]:
A zero-length prefix is a legacy feature that indicates the current
working directory. It appears as two adjacent <colon> characters
( "::" ), as an initial <colon> preceding the rest of the list, or
as a trailing <colon> following the rest of the list.
Kamil
[1]
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03