mirror of
git://anongit.mindrot.org/openssh.git
synced 2025-05-09 11:38:35 +00:00
upstream commit
make hostname matching really insensitive to case; bz#2685, reported by Petr Cerny; ok dtucker@ Upstream-ID: e467622ff154269e36ba8b6c9e3d105e1c4a9253
This commit is contained in:
parent
77a9be9446
commit
dd3e229866
12
match.c
12
match.c
@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: match.c,v 1.36 2017/03/10 03:52:48 djm Exp $ */
|
/* $OpenBSD: match.c,v 1.37 2017/03/10 04:24:55 djm Exp $ */
|
||||||
/*
|
/*
|
||||||
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
||||||
@ -42,9 +42,11 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "xmalloc.h"
|
#include "xmalloc.h"
|
||||||
#include "match.h"
|
#include "match.h"
|
||||||
|
#include "misc.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns true if the given string matches the pattern (which may contain ?
|
* Returns true if the given string matches the pattern (which may contain ?
|
||||||
@ -177,7 +179,13 @@ match_pattern_list(const char *string, const char *pattern, int dolower)
|
|||||||
int
|
int
|
||||||
match_hostname(const char *host, const char *pattern)
|
match_hostname(const char *host, const char *pattern)
|
||||||
{
|
{
|
||||||
return match_pattern_list(host, pattern, 1);
|
char *hostcopy = xstrdup(host);
|
||||||
|
int r;
|
||||||
|
|
||||||
|
lowercase(hostcopy);
|
||||||
|
r = match_pattern_list(hostcopy, pattern, 1);
|
||||||
|
free(hostcopy);
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user