From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.5 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id D32AF1F609 for ; Wed, 28 Nov 2018 09:42:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727676AbeK1Unu (ORCPT ); Wed, 28 Nov 2018 15:43:50 -0500 Received: from mout.gmx.net ([212.227.15.15]:47393 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727541AbeK1Unt (ORCPT ); Wed, 28 Nov 2018 15:43:49 -0500 Received: from [192.168.0.129] ([37.201.193.149]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MgszY-1g5tGm2ETY-00M6A0; Wed, 28 Nov 2018 10:42:44 +0100 Date: Wed, 28 Nov 2018 10:42:45 +0100 (STD) From: Johannes Schindelin X-X-Sender: virtualbox@gitforwindows.org To: "H.Merijn Brand" cc: git@vger.kernel.org Subject: Re: in 2.19.2 t0061-run-command FAILs if . is in $PATH In-Reply-To: <20181128100517.28d44804@pc09.procura.nl> Message-ID: References: <20181128100517.28d44804@pc09.procura.nl> User-Agent: Alpine 2.21.1 (DEB 209 2017-03-23) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Provags-ID: V03:K1:wFN20SMH/RAkznA8j5bzUJ9rigqZBs+gnqI/IjbA01+oiARQVay 7jBLjij9Aiwd5zkI66V7vG1o8B+KccPIAOFaL3w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COILPlbQopX xk8LOxe81QvmNdnnm4RWff0aGIgIZrs8SORdVc0SKnzTGhvd61VldaSTLAfng+ Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Hi, On Wed, 28 Nov 2018, H.Merijn Brand wrote: > the test is explicitely checking that it should not find runnable > scripts outside $PATH, *assuming* $PATH does not have . in it Does this fix it for you? -- snip -- diff --git a/t/t0061-run-command.sh b/t/t0061-run-command.sh index f3f308920f04..4949fdfde88b 100755 --- a/t/t0061-run-command.sh +++ b/t/t0061-run-command.sh @@ -33,7 +33,14 @@ test_expect_success 'run_command can run a command' ' test_must_be_empty err ' -test_expect_success 'run_command is restricted to PATH' ' +test_lazy_prereq DOT_IN_PATH ' + case ":$PATH:" in + *:.:*) true;; + *) false;; + esac +' + +test_expect_success !DOT_IN_PATH 'run_command is restricted to PATH' ' write_script should-not-run <<-\EOF && echo yikes EOF -- snap -- If so, can you please provide a commit message for it (you can add my Signed-off-by: line and your Tested-by: line). Thanks, Johannes > > Having '.' in $PATH can be seen as a bad idea (and it most likely is), > but the tests should either remove '.' from $PATH before testing or > ignore that fail if $PATH does have '.', as it is not illegal > > $ git-2.19.2/t 504 > prove -v t0061-run-command.sh > t0061-run-command.sh .. > ok 1 - start_command reports ENOENT (slash) > ok 2 - start_command reports ENOENT (no slash) > ok 3 - run_command can run a command > ok 4 - run_command is restricted to PATH > ok 5 - run_command can run a script without a #! line > ok 6 - run_command does not try to execute a directory > ok 7 - run_command passes over non-executable file > ok 8 - run_command reports EACCES > ok 9 - unreadable directory in PATH > ok 10 - run_command runs in parallel with more jobs available than tasks > ok 11 - run_command runs in parallel with as many jobs as tasks > ok 12 - run_command runs in parallel with more tasks than jobs available > ok 13 - run_command is asked to abort gracefully > ok 14 - run_command outputs > ok 15 - GIT_TRACE with environment variables > # passed all 15 test(s) > 1..15 > ok > All tests successful. > Files=1, Tests=15, 1 wallclock secs ( 0.04 usr 0.01 sys + 0.26 cusr 0.07 csys = 0.38 CPU) > Result: PASS > > $ env PATH="$PATH"":." prove -v t0061-run-command.sh > t0061-run-command.sh .. > ok 1 - start_command reports ENOENT (slash) > ok 2 - start_command reports ENOENT (no slash) > ok 3 - run_command can run a command > not ok 4 - run_command is restricted to PATH > # > # write_script should-not-run <<-\EOF && > # echo yikes > # EOF > # test_must_fail test-tool run-command run-command should-not-run > # > ok 5 - run_command can run a script without a #! line > ok 6 - run_command does not try to execute a directory > ok 7 - run_command passes over non-executable file > ok 8 - run_command reports EACCES > ok 9 - unreadable directory in PATH > ok 10 - run_command runs in parallel with more jobs available than tasks > ok 11 - run_command runs in parallel with as many jobs as tasks > ok 12 - run_command runs in parallel with more tasks than jobs available > ok 13 - run_command is asked to abort gracefully > ok 14 - run_command outputs > ok 15 - GIT_TRACE with environment variables > # failed 1 among 15 test(s) > 1..15 > Dubious, test returned 1 (wstat 256, 0x100) > Failed 1/15 subtests > > Test Summary Report > ------------------- > t0061-run-command.sh (Wstat: 256 Tests: 15 Failed: 1) > Failed test: 4 > Non-zero exit status: 1 > Files=1, Tests=15, 1 wallclock secs ( 0.03 usr 0.00 sys + 0.24 cusr 0.07 csys = 0.34 CPU) > Result: FAIL > > -- > H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/ > using perl5.00307 .. 5.29 porting perl5 on HP-UX, AIX, and openSUSE > http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/ > http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/ >