[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tests: dis/allow '.' in PATH?

From: Bernhard Voelker
Subject: Re: tests: dis/allow '.' in PATH?
Date: Fri, 26 Nov 2021 01:10:01 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0

On 11/25/21 00:54, Paul Eggert wrote:
> On 11/24/21 15:03, Bernhard Voelker wrote:
> Something like the following untested code. This removes all relative 
> names from PATH, not just '.'.

Good idea.  Looking at some code from coreutils, I also suggest to
test if the entries exist.

> saved_IFS=$IFS
> IFS=:
> new_PATH=
> for dir in $PATH; do
>    case $dir in
>      /*) new_PATH=$new_PATH${new_PATH:-:}$dir;;
This operator doesn't do what we need here.

PFA the revised patch.

Thanks & have a nice day,

Attachment: 0001-test-framework-sh-remove-unsafe-entries-from-PATH.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]