mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 18:50:28 +09:00
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 <jjelen@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
(cherry picked from commit 9b8b312b88)
This commit is contained in:
committed by
Anderson Toshiyuki Sasaki
parent
a1812e9ac1
commit
4a0cbe396d
@@ -274,10 +274,8 @@ static int
|
|||||||
ssh_config_match(char *value, const char *pattern, bool negate)
|
ssh_config_match(char *value, const char *pattern, bool negate)
|
||||||
{
|
{
|
||||||
int ok, result = 0;
|
int ok, result = 0;
|
||||||
char *lowervalue;
|
|
||||||
|
|
||||||
lowervalue = (value) ? ssh_lowercase(value) : NULL;
|
ok = match_pattern_list(value, pattern, strlen(pattern), 0);
|
||||||
ok = match_pattern_list(lowervalue, pattern, strlen(pattern), 0);
|
|
||||||
if (ok <= 0 && negate == true) {
|
if (ok <= 0 && negate == true) {
|
||||||
result = 1;
|
result = 1;
|
||||||
} else if (ok > 0 && negate == false) {
|
} 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)",
|
SSH_LOG(SSH_LOG_TRACE, "%s '%s' against pattern '%s'%s (ok=%d)",
|
||||||
result == 1 ? "Matched" : "Not matched", value, pattern,
|
result == 1 ? "Matched" : "Not matched", value, pattern,
|
||||||
negate == true ? " (negated)" : "", ok);
|
negate == true ? " (negated)" : "", ok);
|
||||||
SAFE_FREE(lowervalue);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user