summaryrefslogtreecommitdiff
path: root/match.c
diff options
context:
space:
mode:
Diffstat (limited to 'match.c')
-rw-r--r--match.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/match.c b/match.c
index 3a8fa9d78..927565c18 100644
--- a/match.c
+++ b/match.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: match.c,v 1.41 2019/11/13 04:47:52 deraadt Exp $ */ 1/* $OpenBSD: match.c,v 1.42 2020/07/05 23:59:45 djm 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
@@ -309,13 +309,13 @@ match_list(const char *client, const char *server, u_int *next)
309 309
310/* 310/*
311 * Filter proposal using pattern-list filter. 311 * Filter proposal using pattern-list filter.
312 * "blacklist" determines sense of filter: 312 * "denylist" determines sense of filter:
313 * non-zero indicates that items matching filter should be excluded. 313 * non-zero indicates that items matching filter should be excluded.
314 * zero indicates that only items matching filter should be included. 314 * zero indicates that only items matching filter should be included.
315 * returns NULL on allocation error, otherwise caller must free result. 315 * returns NULL on allocation error, otherwise caller must free result.
316 */ 316 */
317static char * 317static char *
318filter_list(const char *proposal, const char *filter, int blacklist) 318filter_list(const char *proposal, const char *filter, int denylist)
319{ 319{
320 size_t len = strlen(proposal) + 1; 320 size_t len = strlen(proposal) + 1;
321 char *fix_prop = malloc(len); 321 char *fix_prop = malloc(len);
@@ -333,7 +333,7 @@ filter_list(const char *proposal, const char *filter, int blacklist)
333 *fix_prop = '\0'; 333 *fix_prop = '\0';
334 while ((cp = strsep(&tmp, ",")) != NULL) { 334 while ((cp = strsep(&tmp, ",")) != NULL) {
335 r = match_pattern_list(cp, filter, 0); 335 r = match_pattern_list(cp, filter, 0);
336 if ((blacklist && r != 1) || (!blacklist && r == 1)) { 336 if ((denylist && r != 1) || (!denylist && r == 1)) {
337 if (*fix_prop != '\0') 337 if (*fix_prop != '\0')
338 strlcat(fix_prop, ",", len); 338 strlcat(fix_prop, ",", len);
339 strlcat(fix_prop, cp, len); 339 strlcat(fix_prop, cp, len);
@@ -348,7 +348,7 @@ filter_list(const char *proposal, const char *filter, int blacklist)
348 * the 'filter' pattern list. Caller must free returned string. 348 * the 'filter' pattern list. Caller must free returned string.
349 */ 349 */
350char * 350char *
351match_filter_blacklist(const char *proposal, const char *filter) 351match_filter_denylist(const char *proposal, const char *filter)
352{ 352{
353 return filter_list(proposal, filter, 1); 353 return filter_list(proposal, filter, 1);
354} 354}
@@ -358,7 +358,7 @@ match_filter_blacklist(const char *proposal, const char *filter)
358 * the 'filter' pattern list. Caller must free returned string. 358 * the 'filter' pattern list. Caller must free returned string.
359 */ 359 */
360char * 360char *
361match_filter_whitelist(const char *proposal, const char *filter) 361match_filter_allowlist(const char *proposal, const char *filter)
362{ 362{
363 return filter_list(proposal, filter, 0); 363 return filter_list(proposal, filter, 0);
364} 364}