1
1

config: Add new Match final keyword from OpenSSH 8.0

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Этот коммит содержится в:
Jakub Jelen 2019-01-23 11:43:59 +01:00 коммит произвёл Andreas Schneider
родитель 3ce31532eb
Коммит e989c4afff

Просмотреть файл

@ -152,6 +152,7 @@ static struct ssh_config_keyword_table_s ssh_config_keyword_table[] = {
enum ssh_config_match_e {
MATCH_UNKNOWN = -1,
MATCH_ALL,
MATCH_FINAL,
MATCH_CANONICAL,
MATCH_EXEC,
MATCH_HOST,
@ -168,6 +169,7 @@ struct ssh_config_match_keyword_table_s {
static struct ssh_config_match_keyword_table_s ssh_config_match_keyword_table[] = {
{ "all", MATCH_ALL },
{ "canonical", MATCH_CANONICAL },
{ "final", MATCH_FINAL },
{ "exec", MATCH_EXEC },
{ "host", MATCH_HOST },
{ "originalhost", MATCH_ORIGINALHOST },
@ -682,8 +684,10 @@ ssh_config_parse_line(ssh_session session,
switch (opt) {
case MATCH_ALL:
p = ssh_config_get_str_tok(&s, NULL);
if (args == 1 && (p == NULL || p[0] == '\0')) {
/* The first argument and end of line */
if (args <= 2 && (p == NULL || p[0] == '\0')) {
/* The first or second, but last argument. The "all" keyword
* can be prefixed with either "final" or "canonical"
* keywords which do not have any effect here. */
if (negate == true) {
result = 0;
}
@ -696,6 +700,16 @@ ssh_config_parse_line(ssh_session session,
SAFE_FREE(x);
return -1;
case MATCH_FINAL:
case MATCH_CANONICAL:
SSH_LOG(SSH_LOG_WARN,
"line %d: Unsupported Match keyword '%s', skipping\n",
count,
p);
/* Not set any result here -- the result is dependent on the
* following matches after this keyword */
break;
case MATCH_EXEC:
case MATCH_ORIGINALHOST:
case MATCH_LOCALUSER:
@ -708,9 +722,6 @@ ssh_config_parse_line(ssh_session session,
return -1;
}
args++;
FALL_THROUGH;
case MATCH_CANONICAL:
/* These do not need any argument */
SSH_LOG(SSH_LOG_WARN,
"line %d: Unsupported Match keyword '%s', ignoring\n",
count,