summaryrefslogtreecommitdiff
path: root/auth2-hostbased.c
diff options
context:
space:
mode:
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 @@
1/* $OpenBSD: auth2-hostbased.c,v 1.11 2006/08/03 03:34:41 deraadt Exp $ */ 1/* $OpenBSD: auth2-hostbased.c,v 1.12 2008/07/17 08:51:07 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -151,15 +151,16 @@ hostbased_key_allowed(struct passwd *pw, const char *cuser, char *chost,
151 debug2("userauth_hostbased: chost %s resolvedname %s ipaddr %s", 151 debug2("userauth_hostbased: chost %s resolvedname %s ipaddr %s",
152 chost, resolvedname, ipaddr); 152 chost, resolvedname, ipaddr);
153 153
154 if (((len = strlen(chost)) > 0) && chost[len - 1] == '.') {
155 debug2("stripping trailing dot from chost %s", chost);
156 chost[len - 1] = '\0';
157 }
158
154 if (options.hostbased_uses_name_from_packet_only) { 159 if (options.hostbased_uses_name_from_packet_only) {
155 if (auth_rhosts2(pw, cuser, chost, chost) == 0) 160 if (auth_rhosts2(pw, cuser, chost, chost) == 0)
156 return 0; 161 return 0;
157 lookup = chost; 162 lookup = chost;
158 } else { 163 } else {
159 if (((len = strlen(chost)) > 0) && chost[len - 1] == '.') {
160 debug2("stripping trailing dot from chost %s", chost);
161 chost[len - 1] = '\0';
162 }
163 if (strcasecmp(resolvedname, chost) != 0) 164 if (strcasecmp(resolvedname, chost) != 0)
164 logit("userauth_hostbased mismatch: " 165 logit("userauth_hostbased mismatch: "
165 "client sends %s, but we resolve %s to %s", 166 "client sends %s, but we resolve %s to %s",