=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/servconf.c,v retrieving revision 1.350 retrieving revision 1.351 diff -u -r1.350 -r1.351 --- src/usr.bin/ssh/servconf.c 2019/03/25 22:33:44 1.350 +++ src/usr.bin/ssh/servconf.c 2019/04/18 18:56:16 1.351 @@ -1,5 +1,5 @@ -/* $OpenBSD: servconf.c,v 1.350 2019/03/25 22:33:44 djm Exp $ */ +/* $OpenBSD: servconf.c,v 1.351 2019/04/18 18:56:16 dtucker Exp $ */ /* * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland * All rights reserved @@ -985,7 +985,7 @@ return -1; } if (strcasecmp(attrib, "user") == 0) { - if (ci == NULL) { + if (ci == NULL || (ci->test && ci->user == NULL)) { result = 0; continue; } @@ -997,7 +997,7 @@ debug("user %.100s matched 'User %.100s' at " "line %d", ci->user, arg, line); } else if (strcasecmp(attrib, "group") == 0) { - if (ci == NULL) { + if (ci == NULL || (ci->test && ci->user == NULL)) { result = 0; continue; } @@ -1010,7 +1010,7 @@ result = 0; } } else if (strcasecmp(attrib, "host") == 0) { - if (ci == NULL) { + if (ci == NULL || (ci->test && ci->host == NULL)) { result = 0; continue; } @@ -1022,7 +1022,7 @@ debug("connection from %.100s matched 'Host " "%.100s' at line %d", ci->host, arg, line); } else if (strcasecmp(attrib, "address") == 0) { - if (ci == NULL) { + if (ci == NULL || (ci->test && ci->address == NULL)) { result = 0; continue; } @@ -1041,7 +1041,7 @@ return -1; } } else if (strcasecmp(attrib, "localaddress") == 0){ - if (ci == NULL) { + if (ci == NULL || (ci->test && ci->laddress == NULL)) { result = 0; continue; } @@ -1067,7 +1067,7 @@ arg); return -1; } - if (ci == NULL) { + if (ci == NULL || (ci->test && ci->lport == -1)) { result = 0; continue; } @@ -1081,10 +1081,12 @@ else result = 0; } else if (strcasecmp(attrib, "rdomain") == 0) { - if (ci == NULL || ci->rdomain == NULL) { + if (ci == NULL || (ci->test && ci->rdomain == NULL)) { result = 0; continue; } + if (ci->rdomain == NULL) + match_test_missing_fatal("RDomain", "rdomain"); if (match_pattern_list(ci->rdomain, arg, 0) != 1) result = 0; else