torture: Place additional configuration options before defaults so they can override them

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
(cherry picked from commit f9bd1db8c3)
This commit is contained in:
Jakub Jelen
2020-10-02 11:24:58 +02:00
parent f8314af85a
commit deb9fc015e

View File

@@ -629,7 +629,8 @@ static void torture_setup_create_sshd_config(void **state, bool pam)
"\n" "\n"
"StrictModes no\n" "StrictModes no\n"
"\n" "\n"
"%s" /* Here comes UsePam */ "%s\n" /* Here comes UsePam */
"%s" /* The space for test-specific options */
"\n" "\n"
/* add all supported algorithms */ /* add all supported algorithms */
"HostKeyAlgorithms " OPENSSH_KEYS "\n" "HostKeyAlgorithms " OPENSSH_KEYS "\n"
@@ -644,8 +645,7 @@ static void torture_setup_create_sshd_config(void **state, bool pam)
"AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT\n" "AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT\n"
"AcceptEnv LC_IDENTIFICATION LC_ALL LC_LIBSSH\n" "AcceptEnv LC_IDENTIFICATION LC_ALL LC_LIBSSH\n"
"\n" "\n"
"PidFile %s\n" "PidFile %s\n";
"%s\n"; /* The space for test-specific options */
/* FIPS config */ /* FIPS config */
const char fips_config_string[]= const char fips_config_string[]=
"Port 22\n" "Port 22\n"
@@ -663,7 +663,8 @@ static void torture_setup_create_sshd_config(void **state, bool pam)
"\n" "\n"
"StrictModes no\n" "StrictModes no\n"
"\n" "\n"
"%s" /* UsePam */ "%s\n" /* Here comes UsePam */
"%s" /* The space for test-specific options */
"\n" "\n"
"Ciphers " "Ciphers "
"aes256-gcm@openssh.com,aes256-ctr,aes256-cbc," "aes256-gcm@openssh.com,aes256-ctr,aes256-cbc,"
@@ -692,8 +693,7 @@ static void torture_setup_create_sshd_config(void **state, bool pam)
"AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT\n" "AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT\n"
"AcceptEnv LC_IDENTIFICATION LC_ALL LC_LIBSSH\n" "AcceptEnv LC_IDENTIFICATION LC_ALL LC_LIBSSH\n"
"\n" "\n"
"PidFile %s\n" /* PID file */ "PidFile %s\n"; /* PID file */
"%s\n"; /* The space for test-specific options */
const char usepam_yes[] = const char usepam_yes[] =
"UsePAM yes\n" "UsePAM yes\n"
"KbdInteractiveAuthentication yes\n"; "KbdInteractiveAuthentication yes\n";
@@ -794,8 +794,8 @@ static void torture_setup_create_sshd_config(void **state, bool pam)
trusted_ca_pubkey, trusted_ca_pubkey,
sftp_server, sftp_server,
usepam, usepam,
s->srv_pidfile, additional_config,
additional_config); s->srv_pidfile);
} else { } else {
snprintf(sshd_config, sizeof(sshd_config), snprintf(sshd_config, sizeof(sshd_config),
config_string, config_string,
@@ -808,8 +808,8 @@ static void torture_setup_create_sshd_config(void **state, bool pam)
trusted_ca_pubkey, trusted_ca_pubkey,
sftp_server, sftp_server,
usepam, usepam,
s->srv_pidfile, additional_config,
additional_config); s->srv_pidfile);
} }
torture_write_file(s->srv_config, sshd_config); torture_write_file(s->srv_config, sshd_config);