From: djm Date: Tue, 23 Aug 2016 03:22:49 +0000 (+0000) Subject: fix matching for pattern lists that contain a single negated match, X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=07a24fd78e77caaa837209fec3bc7ed2b0a523b4;p=openbsd fix matching for pattern lists that contain a single negated match, e.g. "Host !example" report and patch from Robin Becker. bz#1918 ok dtucker@ --- diff --git a/usr.bin/ssh/match.c b/usr.bin/ssh/match.c index cf4b2f4e03e..1f0b018c788 100644 --- a/usr.bin/ssh/match.c +++ b/usr.bin/ssh/match.c @@ -1,4 +1,4 @@ -/* $OpenBSD: match.c,v 1.30 2015/05/04 06:10:48 djm Exp $ */ +/* $OpenBSD: match.c,v 1.31 2016/08/23 03:22:49 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -156,7 +156,8 @@ match_pattern_list(const char *string, const char *pattern, int dolower) return -1; /* Negative */ else got_positive = 1; /* Positive */ - } + } else if (negated) + got_positive = 1; } /*