Eric Blake <[EMAIL PROTECTED]> wrote: > Sorry for the false alarm, then. But, on the other hand, there is a potential > issue if the user has CDPATH set in the environment with . on the list, for > those tests that do not source envvar-check, since $tmp is always relative. > POSIX requires 'CDPATH=. cd $tmp' to print to stdout, whereas > 'CDPATH=. cd ./$tmp' must be silent. Also, if the user happens to have > another > directory accessible from CDPATH that matches $tmp (although this is less > likely, due to the use of $$ in $tmp), then only the 'cd ./$tmp' form > guarantees that CDPATH is not consulted. So should we do this? > > diff --git a/tests/sample-test b/tests/sample-test > index 4d962d0..1533c3f 100644 > --- a/tests/sample-test > +++ b/tests/sample-test > @@ -33,7 +33,7 @@ trap '(exit $?); exit $?' 1 2 13 15 > > framework_failure=0 > mkdir -p $tmp || framework_failure=1 > -cd $tmp || framework_failure=1 > +cd ./$tmp || framework_failure=1
Good point. But wouldn't it be better to disable this feature (unset CDPATH?) globally than to try to fix all uses of "cd"? FWIW, I plan to factor out a lot of the set-up bits that are in sample-test and put them in shell functions that will then be used from all of the sample-test-derived scripts. Of course, with that change, if you're running "make check" with a /bin/sh that doesn't understand functions, many tests will be skipped. But that's better than polluting hundreds of scripts to accommodate running tests on a few ancient systems. _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
