]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream commit
authordjm@openbsd.org <djm@openbsd.org>
Tue, 23 Aug 2016 03:22:49 +0000 (03:22 +0000)
committerDamien Miller <djm@mindrot.org>
Tue, 23 Aug 2016 04:29:07 +0000 (14:29 +1000)
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@

Upstream-ID: 05a0cb323ea4bc20e98db099b42c067bfb9ea1ea

match.c

diff --git a/match.c b/match.c
index 913b6bae02a6f4657e26a8e521da10788569bb94..fd784ff14ea6ee5fd56d25b716e346734f3048de 100644 (file)
--- a/match.c
+++ b/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 <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -158,7 +158,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;
        }
 
        /*