From 4a0cbe396d6776177bb9c01554fde04a6749d0f6 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Mon, 16 Sep 2019 10:47:55 +0200 Subject: [PATCH] config: Make the matching case sensitive as documented in ssh_config manual pages > note that keywords are case-insensitive and arguments are case-sensitive Signed-off-by: Jakub Jelen Reviewed-by: Anderson Toshiyuki Sasaki (cherry picked from commit 9b8b312b88ee79009df40a07b90548f743df9f9f) --- src/config.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/config.c b/src/config.c index d26d44ac..b4c17bd4 100644 --- a/src/config.c +++ b/src/config.c @@ -274,10 +274,8 @@ static int ssh_config_match(char *value, const char *pattern, bool negate) { int ok, result = 0; - char *lowervalue; - lowervalue = (value) ? ssh_lowercase(value) : NULL; - ok = match_pattern_list(lowervalue, pattern, strlen(pattern), 0); + ok = match_pattern_list(value, pattern, strlen(pattern), 0); if (ok <= 0 && negate == true) { result = 1; } else if (ok > 0 && negate == false) { @@ -286,7 +284,6 @@ ssh_config_match(char *value, const char *pattern, bool negate) SSH_LOG(SSH_LOG_TRACE, "%s '%s' against pattern '%s'%s (ok=%d)", result == 1 ? "Matched" : "Not matched", value, pattern, negate == true ? " (negated)" : "", ok); - SAFE_FREE(lowervalue); return result; }