From ed8284ab0976130c6c1001e2e370593d00675007 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Thu, 13 Jun 2019 17:22:56 +0200 Subject: config: Skip the rest of the line for Match exec Signed-off-by: Jakub Jelen Reviewed-by: Andreas Schneider --- src/config.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/config.c') diff --git a/src/config.c b/src/config.c index e9c20cd4..1e17d00c 100644 --- a/src/config.c +++ b/src/config.c @@ -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 */ -- cgit v1.2.3