From 8e36c0034462852ddca6d3d2a7ac14cb522620b1 Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Wed, 23 Feb 2022 21:19:12 +0100 Subject: [PATCH] parallel: Test for bug #61894: Pack ssh code in eval protection. --- doc/haikus | 7 +++-- doc/release_new_version | 26 +++++-------------- src/env_parallel.ash | 2 +- src/env_parallel.bash | 2 +- src/env_parallel.dash | 2 +- src/env_parallel.ksh | 2 +- src/env_parallel.mksh | 2 +- src/env_parallel.sh | 2 +- src/env_parallel.zsh | 2 +- src/niceload | 2 +- src/parallel | 2 +- src/parallel.pod | 2 +- src/parsort | 2 +- src/pod2graph | 21 +++++++++++++++ src/sql | 2 +- testsuite/tests-to-run/parallel-local-ssh1.sh | 9 +++++++ testsuite/wanted-results/parallel-local-ssh1 | 10 +++++++ 17 files changed, 62 insertions(+), 35 deletions(-) diff --git a/doc/haikus b/doc/haikus index e6d92d6f..45bcf03a 100644 --- a/doc/haikus +++ b/doc/haikus @@ -4,6 +4,8 @@ Quote of the month: + It's amazing how fast you can get with bash pipelines and GNU Parallel. + -- Eric Pauley @EricPauley_ GNU parallel すごいな、シェルスクリプトを make -jX みたいにして並列 に走らせたいときに超便利 @@ -18,13 +20,10 @@ Quote of the month: haberlo conocido antes :) -- Juan Sierra Pons @juasiepo - - If I could only keep 5 GNU utils, parallel would make it to the list :) -- 5heikki@reddit - Gnu Parallel: installed in every computer i have access to. -- raffaele messuti @atomotic@twitter @@ -34,7 +33,7 @@ Quote of the month: Deus salve o gnu parallel -- marcos @guv_Tuv@twitter -@a201 +@a 4 اليوم علمت بأداة تساعد على تشغيل أوامر الصدفة بشكل متوازي حسب عدد الأنوية الموجودة مما يجعلها أداة أساسية في عدة تنفيذ المهام. الأداة اسمها gnu parallel diff --git a/doc/release_new_version b/doc/release_new_version index 080e52bf..56754506 100644 --- a/doc/release_new_version +++ b/doc/release_new_version @@ -254,37 +254,25 @@ from:tange@gnu.org to:parallel@gnu.org, bug-parallel@gnu.org stable-bcc: Jesse Alama -Subject: GNU Parallel 20220222 ('Donetsk Luhansk') released +Subject: GNU Parallel 20220322 ('<<>>') released [stable] -GNU Parallel 20220222 ('Donetsk Luhansk') has been released. It is available for download at: lbry://@GnuParallel:4 +GNU Parallel 20220322 ('<<>>') has been released. It is available for download at: lbry://@GnuParallel:4 -This release has a major change in the remote code. This makes this release beta quality. +No new functionality was introduced so this is a good candidate for a stable release. Quote of the month: - I also prefer gnu parallel. Mainly because it makes embarrassingly - parallel tasks embarrassingly easy to run on the command line. - -- Vincent D. Warmerdam @fishnets88@twitter + <<>> New in this release: -* Encoding of remote commands has changed. This limits the length of remote commands to less than half. It also requires $REMOTE_TMPDIR to be writable. - -* Time functions hh_mm_ss() hhmmss() hh_mm() hhmm() are now available for {= =}. - -* parallel_options_map.pdf is a map showing which options other options relate to. - -* {uniq} added to --plus to only run jobs with unique values. +<<>> * Bug fixes and man page updates: Many options now have a 'See also' section. News about GNU Parallel: -* HPC at Noon - GNU Parallel u SLURM srun , 22 February 2022 https://kim.uni-hohenheim.de/en/96097?tx_ttnews%5Btt_news%5D=53919&cHash=985f4f4ac1a166d180d81f6e9be832a3 - -* linux 命令 -- parallel https://blog.csdn.net/qq_38197157/article/details/112596389 - -* Iterating Over Each Line of ls -l Output https://www.baeldung.com/linux/iterating-ls-l-output +<<>> Get the book: GNU Parallel 2018 http://www.lulu.com/shop/ole-tange/gnu-parallel-2018/paperback/product-23558902.html @@ -364,4 +352,4 @@ O. Tange (2011): GNU SQL - A Command Line Tool for Accessing Different Databases = About GNU Niceload = -GNU niceload slows down a program when the computer load average (or other system activity) is above a certain limit. When the limit is reached the program will be suspended for some time. If the limit is a soft limit the program will be allowed to run for short amounts of time before being suspended again. If the limit is a hard limit the program will only be allowed to run when the system is below the limit. \ No newline at end of file +GNU niceload slows down a program when the computer load average (or other system activity) is above a certain limit. When the limit is reached the program will be suspended for some time. If the limit is a soft limit the program will be allowed to run for short amounts of time before being suspended again. If the limit is a hard limit the program will only be allowed to run when the system is below the limit. diff --git a/src/env_parallel.ash b/src/env_parallel.ash index 50a79230..8d1f6e0b 100755 --- a/src/env_parallel.ash +++ b/src/env_parallel.ash @@ -385,7 +385,7 @@ _parset_main() { return 255 fi if [ "$_parset_NAME" = "--version" ] ; then - echo "parset 20220222 (GNU parallel `parallel --minversion 1`)" + echo "parset 20220223 (GNU parallel `parallel --minversion 1`)" echo "Copyright (C) 2007-2022 Ole Tange, http://ole.tange.dk and Free Software" echo "Foundation, Inc." echo "License GPLv3+: GNU GPL version 3 or later " diff --git a/src/env_parallel.bash b/src/env_parallel.bash index af4f48cf..e8633295 100755 --- a/src/env_parallel.bash +++ b/src/env_parallel.bash @@ -385,7 +385,7 @@ _parset_main() { return 255 fi if [ "$_parset_NAME" = "--version" ] ; then - echo "parset 20220222 (GNU parallel `parallel --minversion 1`)" + echo "parset 20220223 (GNU parallel `parallel --minversion 1`)" echo "Copyright (C) 2007-2022 Ole Tange, http://ole.tange.dk and Free Software" echo "Foundation, Inc." echo "License GPLv3+: GNU GPL version 3 or later " diff --git a/src/env_parallel.dash b/src/env_parallel.dash index 45308c42..1bb8d873 100755 --- a/src/env_parallel.dash +++ b/src/env_parallel.dash @@ -385,7 +385,7 @@ _parset_main() { return 255 fi if [ "$_parset_NAME" = "--version" ] ; then - echo "parset 20220222 (GNU parallel `parallel --minversion 1`)" + echo "parset 20220223 (GNU parallel `parallel --minversion 1`)" echo "Copyright (C) 2007-2022 Ole Tange, http://ole.tange.dk and Free Software" echo "Foundation, Inc." echo "License GPLv3+: GNU GPL version 3 or later " diff --git a/src/env_parallel.ksh b/src/env_parallel.ksh index 76e4dc23..0733b499 100755 --- a/src/env_parallel.ksh +++ b/src/env_parallel.ksh @@ -363,7 +363,7 @@ _parset_main() { return 255 fi if [ "$_parset_NAME" = "--version" ] ; then - echo "parset 20220222 (GNU parallel `parallel --minversion 1`)" + echo "parset 20220223 (GNU parallel `parallel --minversion 1`)" echo "Copyright (C) 2007-2022 Ole Tange, http://ole.tange.dk and Free Software" echo "Foundation, Inc." echo "License GPLv3+: GNU GPL version 3 or later " diff --git a/src/env_parallel.mksh b/src/env_parallel.mksh index e61126f0..2f334bf7 100644 --- a/src/env_parallel.mksh +++ b/src/env_parallel.mksh @@ -365,7 +365,7 @@ _parset_main() { return 255 fi if [ "$_parset_NAME" = "--version" ] ; then - echo "parset 20220222 (GNU parallel `parallel --minversion 1`)" + echo "parset 20220223 (GNU parallel `parallel --minversion 1`)" echo "Copyright (C) 2007-2022 Ole Tange, http://ole.tange.dk and Free Software" echo "Foundation, Inc." echo "License GPLv3+: GNU GPL version 3 or later " diff --git a/src/env_parallel.sh b/src/env_parallel.sh index 28625620..a713622c 100755 --- a/src/env_parallel.sh +++ b/src/env_parallel.sh @@ -390,7 +390,7 @@ _parset_main() { return 255 fi if [ "$_parset_NAME" = "--version" ] ; then - echo "parset 20220222 (GNU parallel `parallel --minversion 1`)" + echo "parset 20220223 (GNU parallel `parallel --minversion 1`)" echo "Copyright (C) 2007-2022 Ole Tange, http://ole.tange.dk and Free Software" echo "Foundation, Inc." echo "License GPLv3+: GNU GPL version 3 or later " diff --git a/src/env_parallel.zsh b/src/env_parallel.zsh index 4ca66750..3ff5e717 100755 --- a/src/env_parallel.zsh +++ b/src/env_parallel.zsh @@ -355,7 +355,7 @@ _parset_main() { return 255 fi if [ "$_parset_NAME" = "--version" ] ; then - echo "parset 20220222 (GNU parallel `parallel --minversion 1`)" + echo "parset 20220223 (GNU parallel `parallel --minversion 1`)" echo "Copyright (C) 2007-2022 Ole Tange, http://ole.tange.dk and Free Software" echo "Foundation, Inc." echo "License GPLv3+: GNU GPL version 3 or later " diff --git a/src/niceload b/src/niceload index 670eb2af..12a43b07 100755 --- a/src/niceload +++ b/src/niceload @@ -26,7 +26,7 @@ use strict; use Getopt::Long; $Global::progname="niceload"; -$Global::version = 20220222; +$Global::version = 20220223; Getopt::Long::Configure("bundling","require_order"); get_options_from_array(\@ARGV) || die_usage(); if($opt::version) { diff --git a/src/parallel b/src/parallel index 587d6bd3..8576728f 100755 --- a/src/parallel +++ b/src/parallel @@ -2313,7 +2313,7 @@ sub check_invalid_option_combinations() { sub init_globals() { # Defaults: - $Global::version = 20220222; + $Global::version = 20220223; $Global::progname = 'parallel'; $::name = "GNU Parallel"; $Global::infinity = 2**31; diff --git a/src/parallel.pod b/src/parallel.pod index f783bd59..f6386034 100644 --- a/src/parallel.pod +++ b/src/parallel.pod @@ -205,7 +205,7 @@ Sequence number of the job to run. This replacement string will be replaced by the sequence number of the job being run. It contains the same number as $PARALLEL_SEQ. -See also: B<{#}> B<--seqreplace> +See also: B<{}> B<--seqreplace> =item B<{%}> diff --git a/src/parsort b/src/parsort index bf0366e4..f7e48c25 100755 --- a/src/parsort +++ b/src/parsort @@ -122,7 +122,7 @@ GetOptions( "help" => \$opt::dummy, ) || exit(255); $Global::progname = ($0 =~ m:(^|/)([^/]+)$:)[1]; -$Global::version = 20220222; +$Global::version = 20220223; if($opt::version) { version(); exit 0; } @Global::sortoptions = grep { ! /^-D$/ } shell_quote(@ARGV_before[0..($#ARGV_before-$#ARGV-1)]); diff --git a/src/pod2graph b/src/pod2graph index 2c07cc44..36526943 100755 --- a/src/pod2graph +++ b/src/pod2graph @@ -1,5 +1,26 @@ #!/usr/bin/perl +# Copyright (C) 2007-2022 Ole Tange, http://ole.tange.dk and Free +# Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see +# or write to the Free Software Foundation, Inc., 51 Franklin St, +# Fifth Floor, Boston, MA 02110-1301 USA +# +# SPDX-FileCopyrightText: 2021-2022 Ole Tange, http://ole.tange.dk and Free Software and Foundation, Inc. +# SPDX-License-Identifier: GPL-3.0-or-later + # Convert .pod file containing: # # =item --option diff --git a/src/sql b/src/sql index 63078077..5ba11a70 100755 --- a/src/sql +++ b/src/sql @@ -600,7 +600,7 @@ $Global::Initfile && unlink $Global::Initfile; exit ($err); sub parse_options { - $Global::version = 20220222; + $Global::version = 20220223; $Global::progname = 'sql'; # This must be done first as this may exec myself diff --git a/testsuite/tests-to-run/parallel-local-ssh1.sh b/testsuite/tests-to-run/parallel-local-ssh1.sh index 86fd3950..fdb768fe 100644 --- a/testsuite/tests-to-run/parallel-local-ssh1.sh +++ b/testsuite/tests-to-run/parallel-local-ssh1.sh @@ -18,6 +18,15 @@ echo TODO EOF +par_ssh_ssh() { + echo '### bug #61894: Pack ssh code in eval protection' + echo Unquoted ssh should work + parallel --ssh 'ssh lo ssh' -S lo 'hostname;echo' ::: OK + parallel --ssh 'eval ssh lo ssh' -S lo 'hostname;echo' ::: OK + parallel --ssh 'eval ssh lo eval ssh' -S lo 'hostname;echo' ::: OK + parallel --ssh 'sshpass ssh bash@lo eval ssh' -S csh@lo 'hostname;echo' ::: OK +} + par_stop_if_no_hosts_left() { echo '### Stop if all hosts are filtered and there are no hosts left to run on' stdout parallel --filter-hosts -S no-such.host echo ::: 1 diff --git a/testsuite/wanted-results/parallel-local-ssh1 b/testsuite/wanted-results/parallel-local-ssh1 index 9d3d06b3..2eb51cc7 100644 --- a/testsuite/wanted-results/parallel-local-ssh1 +++ b/testsuite/wanted-results/parallel-local-ssh1 @@ -83,6 +83,16 @@ par_remote_nice 5 par_ssh ### use --ssh par_ssh Run through BARSSH? par_ssh BARSSH +par_ssh_ssh ### bug #61894: Pack ssh code in eval protection +par_ssh_ssh Unquoted ssh should work +par_ssh_ssh aspire +par_ssh_ssh OK +par_ssh_ssh aspire +par_ssh_ssh OK +par_ssh_ssh aspire +par_ssh_ssh OK +par_ssh_ssh aspire +par_ssh_ssh OK par_stop_if_no_hosts_left ### Stop if all hosts are filtered and there are no hosts left to run on par_stop_if_no_hosts_left parallel: Warning: Removed no-such.host. par_stop_if_no_hosts_left parallel: Error: Cannot run any jobs.