config: Skip the rest of the line for Match exec

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2019-06-13 17:22:56 +02:00
committed by Andreas Schneider
parent f46eff79e2
commit ed8284ab09

View File

@@ -499,6 +499,22 @@ ssh_config_parse_line(ssh_session session,
break;
case MATCH_EXEC:
/* Skip to the end of line as unsupported */
p = ssh_config_get_cmd(&s);
if (p == NULL || p[0] == '\0') {
SSH_LOG(SSH_LOG_WARN, "line %d: Match keyword "
"'%s' requires argument", count, p2);
SAFE_FREE(x);
return -1;
}
args++;
SSH_LOG(SSH_LOG_WARN,
"line %d: Unsupported Match keyword '%s', ignoring",
count,
p2);
result = 0;
break;
case MATCH_ORIGINALHOST:
case MATCH_LOCALUSER:
/* Skip one argument */