From e37dde06a6a1ce6c2d2ce853d9834b715af82d47 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 28 Jan 2009 16:33:01 +1100 Subject: [PATCH] - djm@cvs.openbsd.org 2009/01/22 10:09:16 [auth-options.c] another chunk of a2port() diff that got away. wtfdjm?? --- ChangeLog | 5 ++++- auth-options.c | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2b371d11e..7d7de3dd9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -70,6 +70,9 @@ which in turn required some things to be converted from u_short => int make use of int vs. u_short consistent in some other places too feedback & ok markus@ + - djm@cvs.openbsd.org 2009/01/22 10:09:16 + [auth-options.c] + another chunk of a2port() diff that got away. wtfdjm?? 20090107 - (djm) [uidswap.c] bz#1412: Support >16 supplemental groups in OS X. @@ -5079,5 +5082,5 @@ OpenServer 6 and add osr5bigcrypt support so when someone migrates passwords between UnixWare and OpenServer they will still work. OK dtucker@ -$Id: ChangeLog,v 1.5175 2009/01/28 05:31:22 djm Exp $ +$Id: ChangeLog,v 1.5176 2009/01/28 05:33:01 djm Exp $ diff --git a/auth-options.c b/auth-options.c index 25361455e..ab085c233 100644 --- a/auth-options.c +++ b/auth-options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auth-options.c,v 1.43 2008/06/10 23:06:19 djm Exp $ */ +/* $OpenBSD: auth-options.c,v 1.44 2009/01/22 10:09:16 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -255,7 +255,7 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum) cp = "permitopen=\""; if (strncasecmp(opts, cp, strlen(cp)) == 0) { char *host, *p; - u_short port; + int port; char *patterns = xmalloc(strlen(opts) + 1); opts += strlen(cp); @@ -293,7 +293,7 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum) goto bad_option; } host = cleanhostname(host); - if (p == NULL || (port = a2port(p)) == 0) { + if (p == NULL || (port = a2port(p)) <= 0) { debug("%.100s, line %lu: Bad permitopen port " "<%.100s>", file, linenum, p ? p : ""); auth_debug_add("%.100s, line %lu: "