diff options
Diffstat (limited to 'auth2-hostbased.c')
-rw-r--r-- | auth2-hostbased.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/auth2-hostbased.c b/auth2-hostbased.c index f6fb74043..bc933d434 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 | * |
@@ -154,15 +154,16 @@ hostbased_key_allowed(struct passwd *pw, const char *cuser, char *chost, | |||
154 | debug2("userauth_hostbased: chost %s resolvedname %s ipaddr %s", | 154 | debug2("userauth_hostbased: chost %s resolvedname %s ipaddr %s", |
155 | chost, resolvedname, ipaddr); | 155 | chost, resolvedname, ipaddr); |
156 | 156 | ||
157 | if (((len = strlen(chost)) > 0) && chost[len - 1] == '.') { | ||
158 | debug2("stripping trailing dot from chost %s", chost); | ||
159 | chost[len - 1] = '\0'; | ||
160 | } | ||
161 | |||
157 | if (options.hostbased_uses_name_from_packet_only) { | 162 | if (options.hostbased_uses_name_from_packet_only) { |
158 | if (auth_rhosts2(pw, cuser, chost, chost) == 0) | 163 | if (auth_rhosts2(pw, cuser, chost, chost) == 0) |
159 | return 0; | 164 | return 0; |
160 | lookup = chost; | 165 | lookup = chost; |
161 | } else { | 166 | } else { |
162 | if (((len = strlen(chost)) > 0) && chost[len - 1] == '.') { | ||
163 | debug2("stripping trailing dot from chost %s", chost); | ||
164 | chost[len - 1] = '\0'; | ||
165 | } | ||
166 | if (strcasecmp(resolvedname, chost) != 0) | 167 | if (strcasecmp(resolvedname, chost) != 0) |
167 | logit("userauth_hostbased mismatch: " | 168 | logit("userauth_hostbased mismatch: " |
168 | "client sends %s, but we resolve %s to %s", | 169 | "client sends %s, but we resolve %s to %s", |