From b5fe62bfc74288b885188f7b5012cff0aa71c4c1 Mon Sep 17 00:00:00 2001 From: Michael Rash Date: Sun, 26 Oct 2014 16:58:13 -0400 Subject: [PATCH] [test suite] command exec too many args tests --- common/common.h | 2 +- test/tests/rijndael_hmac_cmd_exec.pl | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/common/common.h b/common/common.h index ae6dc265..5a13a4f3 100644 --- a/common/common.h +++ b/common/common.h @@ -151,7 +151,7 @@ enum { /* Command line argument / argv handling */ -#define MAX_CMDLINE_ARGS 50 /*!< should be way more than enough */ +#define MAX_CMDLINE_ARGS 30 /*!< should be way more than enough */ #if HAVE_LIBFIU #define MAX_FAULT_TAG_LEN 128 diff --git a/test/tests/rijndael_hmac_cmd_exec.pl b/test/tests/rijndael_hmac_cmd_exec.pl index 9a5aba5e..fde58a8e 100644 --- a/test/tests/rijndael_hmac_cmd_exec.pl +++ b/test/tests/rijndael_hmac_cmd_exec.pl @@ -15,6 +15,20 @@ "-d $default_digest_file -p $default_pid_file $intf_str", 'fw_rule_created' => $REQUIRE_NO_NEW_RULE, }, + { + 'category' => 'Rijndael+HMAC', + 'subcategory' => 'client+server', + 'detail' => 'command execution (args too long)', + 'function' => \&spa_cycle, + 'cmdline' => qq|$fwknopCmd --server-cmd "ls -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a" | . + "-a $fake_ip -D $loopback_ip --rc-file $cf{'rc_hmac_b64_key'} ". + "$verbose_str", + 'fwknopd_cmdline' => "$fwknopdCmd -c $cf{'def'} -a $cf{'hmac_cmd_access'} " . + "-d $default_digest_file -p $default_pid_file $intf_str", + 'fw_rule_created' => $REQUIRE_NO_NEW_RULE, + 'server_positive_output_matches' => [qr/max command line args exceeded/] + }, + { 'category' => 'Rijndael+HMAC', 'subcategory' => 'client+server', @@ -27,6 +41,20 @@ "-d $default_digest_file -p $default_pid_file $intf_str --udp-server", 'fw_rule_created' => $REQUIRE_NO_NEW_RULE, }, + { + 'category' => 'Rijndael+HMAC', + 'subcategory' => 'client+server', + 'detail' => 'command exec UDP (args too long)', + 'function' => \&spa_cycle, + 'cmdline' => qq|$fwknopCmd --server-cmd "ls -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a" | . + "-a $fake_ip -D $loopback_ip --rc-file $cf{'rc_hmac_b64_key'} ". + "$verbose_str", + 'fwknopd_cmdline' => "$fwknopdCmd -c $cf{'def'} -a $cf{'hmac_cmd_access'} " . + "-d $default_digest_file -p $default_pid_file $intf_str --udp-server", + 'fw_rule_created' => $REQUIRE_NO_NEW_RULE, + 'server_positive_output_matches' => [qr/max command line args exceeded/] + }, + { 'category' => 'Rijndael+HMAC', 'subcategory' => 'client+server',