diff options
author | dtucker@openbsd.org <dtucker@openbsd.org> | 2019-03-06 22:14:23 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2019-03-08 15:10:07 +1100 |
commit | fd10cf027b56f9aaa80c9e3844626a05066589a4 (patch) | |
tree | d444bc6fe48f7254dcf17f36d56e485b5b604719 /match.c | |
parent | ab5fee8eb6a011002fd9e32b1597f02aa8804a25 (diff) |
upstream: Move checks for lists of users or groups into their own
function. This is a no-op on OpenBSD but will make things easier in
-portable, eg on systems where these checks should be case-insensitive. ok
djm@
OpenBSD-Commit-ID: 8bc9c8d98670e23f8eaaaefe29c1f98e7ba0487e
Diffstat (limited to 'match.c')
-rw-r--r-- | match.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: match.c,v 1.38 2018/07/04 13:49:31 djm Exp $ */ | 1 | /* $OpenBSD: match.c,v 1.39 2019/03/06 22:14:23 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -174,6 +174,19 @@ match_pattern_list(const char *string, const char *pattern, int dolower) | |||
174 | 174 | ||
175 | #endif | 175 | #endif |
176 | 176 | ||
177 | /* Match a list representing users or groups. */ | ||
178 | int | ||
179 | match_usergroup_pattern_list(const char *string, const char *pattern) | ||
180 | { | ||
181 | #ifndef HAVE_CYGWIN | ||
182 | /* Case sensitive match */ | ||
183 | return match_pattern_list(string, pattern, 0); | ||
184 | #else | ||
185 | /* Case insensitive match */ | ||
186 | return match_pattern_list(string, pattern, 1); | ||
187 | #endif | ||
188 | } | ||
189 | |||
177 | /* | 190 | /* |
178 | * Tries to match the host name (which must be in all lowercase) against the | 191 | * Tries to match the host name (which must be in all lowercase) against the |
179 | * comma-separated sequence of subpatterns (each possibly preceded by ! to | 192 | * comma-separated sequence of subpatterns (each possibly preceded by ! to |