=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/servconf.c,v retrieving revision 1.332 retrieving revision 1.333 diff -u -r1.332 -r1.333 --- src/usr.bin/ssh/servconf.c 2018/06/09 03:03:10 1.332 +++ src/usr.bin/ssh/servconf.c 2018/06/19 02:59:41 1.333 @@ -1,5 +1,5 @@ -/* $OpenBSD: servconf.c,v 1.332 2018/06/09 03:03:10 djm Exp $ */ +/* $OpenBSD: servconf.c,v 1.333 2018/06/19 02:59:41 djm Exp $ */ /* * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland * All rights reserved @@ -1807,15 +1807,23 @@ break; } for (; arg != NULL && *arg != '\0'; arg = strdelim(&cp)) { - arg2 = xstrdup(arg); - p = hpdelim(&arg); - /* XXX support bare port number for PermitListen */ - if (p == NULL) { - fatal("%s line %d: missing host in %s", - filename, linenum, - lookup_opcode_name(opcode)); + if (opcode == sPermitListen && + strchr(arg, ':') == NULL) { + /* + * Allow bare port number for PermitListen + * to indicate a wildcard listen host. + */ + xasprintf(&arg2, "*:%s", arg); + } else { + arg2 = xstrdup(arg); + p = hpdelim(&arg); + if (p == NULL) { + fatal("%s line %d: missing host in %s", + filename, linenum, + lookup_opcode_name(opcode)); + } + p = cleanhostname(p); } - p = cleanhostname(p); if (arg == NULL || ((port = permitopen_port(arg)) < 0)) { fatal("%s line %d: bad port number in %s",