summaryrefslogtreecommitdiffstats
path: root/auth2-hostbased.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2008-07-17 10:57:19 +0200
committerDamien Miller <djm@mindrot.org>2008-07-17 10:57:19 +0200
commita1d03a50692a2edbe5a6e1e652c5a12e1de07721 (patch)
tree08f386af759386aa817efcdb0f794ee948a1366d /auth2-hostbased.c
parent - djm@cvs.openbsd.org 2008/07/17 08:48:00 (diff)
downloadopenssh-a1d03a50692a2edbe5a6e1e652c5a12e1de07721.tar.xz
openssh-a1d03a50692a2edbe5a6e1e652c5a12e1de07721.zip
- djm@cvs.openbsd.org 2008/07/17 08:51:07
[auth2-hostbased.c] strip trailing '.' from hostname when HostbasedUsesNameFromPacketOnly=yes report and patch from res AT qoxp.net (bz#1200); ok markus@
Diffstat (limited to 'auth2-hostbased.c')
-rw-r--r--auth2-hostbased.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/auth2-hostbased.c b/auth2-hostbased.c
index 663dec5d9..041051c53 100644
--- a/auth2-hostbased.c
+++ b/auth2-hostbased.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth2-hostbased.c,v 1.11 2006/08/03 03:34:41 deraadt Exp $ */
+/* $OpenBSD: auth2-hostbased.c,v 1.12 2008/07/17 08:51:07 djm Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
@@ -151,15 +151,16 @@ hostbased_key_allowed(struct passwd *pw, const char *cuser, char *chost,
debug2("userauth_hostbased: chost %s resolvedname %s ipaddr %s",
chost, resolvedname, ipaddr);
+ if (((len = strlen(chost)) > 0) && chost[len - 1] == '.') {
+ debug2("stripping trailing dot from chost %s", chost);
+ chost[len - 1] = '\0';
+ }
+
if (options.hostbased_uses_name_from_packet_only) {
if (auth_rhosts2(pw, cuser, chost, chost) == 0)
return 0;
lookup = chost;
} else {
- if (((len = strlen(chost)) > 0) && chost[len - 1] == '.') {
- debug2("stripping trailing dot from chost %s", chost);
- chost[len - 1] = '\0';
- }
if (strcasecmp(resolvedname, chost) != 0)
logit("userauth_hostbased mismatch: "
"client sends %s, but we resolve %s to %s",