diff options
-rw-r--r-- | usr.bin/ssh/groupaccess.c | 5 | ||||
-rw-r--r-- | usr.bin/ssh/match.c | 10 | ||||
-rw-r--r-- | usr.bin/ssh/match.h | 3 | ||||
-rw-r--r-- | usr.bin/ssh/servconf.c | 4 |
4 files changed, 16 insertions, 6 deletions
diff --git a/usr.bin/ssh/groupaccess.c b/usr.bin/ssh/groupaccess.c index 618fe4a199b..69fd007fe15 100644 --- a/usr.bin/ssh/groupaccess.c +++ b/usr.bin/ssh/groupaccess.c @@ -1,4 +1,4 @@ -/* $OpenBSD: groupaccess.c,v 1.16 2015/05/04 06:10:48 djm Exp $ */ +/* $OpenBSD: groupaccess.c,v 1.17 2019/03/06 22:14:23 dtucker Exp $ */ /* * Copyright (c) 2001 Kevin Steves. All rights reserved. * @@ -89,7 +89,8 @@ ga_match_pattern_list(const char *group_pattern) int i, found = 0; for (i = 0; i < ngroups; i++) { - switch (match_pattern_list(groups_byname[i], group_pattern, 0)) { + switch (match_usergroup_pattern_list(groups_byname[i], + group_pattern)) { case -1: return 0; /* Negated match wins */ case 0: diff --git a/usr.bin/ssh/match.c b/usr.bin/ssh/match.c index 405be1e972c..a0658122c4f 100644 --- a/usr.bin/ssh/match.c +++ b/usr.bin/ssh/match.c @@ -1,4 +1,4 @@ -/* $OpenBSD: match.c,v 1.38 2018/07/04 13:49:31 djm Exp $ */ +/* $OpenBSD: match.c,v 1.39 2019/03/06 22:14:23 dtucker Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -168,6 +168,14 @@ match_pattern_list(const char *string, const char *pattern, int dolower) return got_positive; } +/* Match a list representing users or groups. */ +int +match_usergroup_pattern_list(const char *string, const char *pattern) +{ + /* Case sensitive match */ + return match_pattern_list(string, pattern, 0); +} + /* * Tries to match the host name (which must be in all lowercase) against the * comma-separated sequence of subpatterns (each possibly preceded by ! to diff --git a/usr.bin/ssh/match.h b/usr.bin/ssh/match.h index 852b1a5cb16..3a8a6ecdc1d 100644 --- a/usr.bin/ssh/match.h +++ b/usr.bin/ssh/match.h @@ -1,4 +1,4 @@ -/* $OpenBSD: match.h,v 1.18 2018/07/04 13:49:31 djm Exp $ */ +/* $OpenBSD: match.h,v 1.19 2019/03/06 22:14:23 dtucker Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> @@ -16,6 +16,7 @@ int match_pattern(const char *, const char *); int match_pattern_list(const char *, const char *, int); +int match_usergroup_pattern_list(const char *, const char *); int match_hostname(const char *, const char *); int match_host_and_ip(const char *, const char *, const char *); int match_user(const char *, const char *, const char *, const char *); diff --git a/usr.bin/ssh/servconf.c b/usr.bin/ssh/servconf.c index b56f0a07304..54f73d56cb5 100644 --- a/usr.bin/ssh/servconf.c +++ b/usr.bin/ssh/servconf.c @@ -1,5 +1,5 @@ -/* $OpenBSD: servconf.c,v 1.348 2019/01/24 02:34:52 dtucker Exp $ */ +/* $OpenBSD: servconf.c,v 1.349 2019/03/06 22:14:23 dtucker Exp $ */ /* * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland * All rights reserved @@ -992,7 +992,7 @@ match_cfg_line(char **condition, int line, struct connection_info *ci) } if (ci->user == NULL) match_test_missing_fatal("User", "user"); - if (match_pattern_list(ci->user, arg, 0) != 1) + if (match_usergroup_pattern_list(ci->user, arg) != 1) result = 0; else debug("user %.100s matched 'User %.100s' at " |