summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/readconf.c b/readconf.c
index eb4a8b9ee..927e7fefa 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: readconf.c,v 1.190 2010/11/13 23:27:50 djm Exp $ */ 1/* $OpenBSD: readconf.c,v 1.191 2011/05/06 21:31:38 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
@@ -354,7 +354,7 @@ process_config_line(Options *options, const char *host,
354 int *activep) 354 int *activep)
355{ 355{
356 char *s, **charptr, *endofnumber, *keyword, *arg, *arg2, fwdarg[256]; 356 char *s, **charptr, *endofnumber, *keyword, *arg, *arg2, fwdarg[256];
357 int opcode, *intptr, value, value2, scale; 357 int negated, opcode, *intptr, value, value2, scale;
358 LogLevel *log_level_ptr; 358 LogLevel *log_level_ptr;
359 long long orig, val64; 359 long long orig, val64;
360 size_t len; 360 size_t len;
@@ -793,12 +793,28 @@ parse_int:
793 793
794 case oHost: 794 case oHost:
795 *activep = 0; 795 *activep = 0;
796 while ((arg = strdelim(&s)) != NULL && *arg != '\0') 796 arg2 = NULL;
797 while ((arg = strdelim(&s)) != NULL && *arg != '\0') {
798 negated = *arg == '!';
799 if (negated)
800 arg++;
797 if (match_pattern(host, arg)) { 801 if (match_pattern(host, arg)) {
798 debug("Applying options for %.100s", arg); 802 if (negated) {
803 debug("%.200s line %d: Skipping Host "
804 "block because of negated match "
805 "for %.100s", filename, linenum,
806 arg);
807 *activep = 0;
808 break;
809 }
810 if (!*activep)
811 arg2 = arg; /* logged below */
799 *activep = 1; 812 *activep = 1;
800 break;
801 } 813 }
814 }
815 if (*activep)
816 debug("%.200s line %d: Applying options for %.100s",
817 filename, linenum, arg2);
802 /* Avoid garbage check below, as strdelim is done. */ 818 /* Avoid garbage check below, as strdelim is done. */
803 return 0; 819 return 0;
804 820