summaryrefslogtreecommitdiff
path: root/auth2.c
diff options
context:
space:
mode:
Diffstat (limited to 'auth2.c')
-rw-r--r--auth2.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/auth2.c b/auth2.c
index cd6b27685..be07be914 100644
--- a/auth2.c
+++ b/auth2.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: auth2.c,v 1.52 2001/04/12 19:15:24 markus Exp $"); 26RCSID("$OpenBSD: auth2.c,v 1.53 2001/04/18 22:03:44 markus Exp $");
27 27
28#include <openssl/evp.h> 28#include <openssl/evp.h>
29 29
@@ -799,19 +799,23 @@ hostbased_key_allowed(struct passwd *pw, const char *cuser, const char *chost,
799 const char *resolvedname, *ipaddr, *lookup; 799 const char *resolvedname, *ipaddr, *lookup;
800 struct stat st; 800 struct stat st;
801 char *user_hostfile; 801 char *user_hostfile;
802 int host_status; 802 int host_status, len;
803 803
804 resolvedname = get_canonical_hostname(options.reverse_mapping_check); 804 resolvedname = get_canonical_hostname(options.reverse_mapping_check);
805 ipaddr = get_remote_ipaddr(); 805 ipaddr = get_remote_ipaddr();
806 806
807 debug2("userauth_hostbased: resolvedname %s ipaddr %s", 807 debug2("userauth_hostbased: chost %s resolvedname %s ipaddr %s",
808 resolvedname, ipaddr); 808 chost, resolvedname, ipaddr);
809 809
810 if (options.hostbased_uses_name_from_packet_only) { 810 if (options.hostbased_uses_name_from_packet_only) {
811 if (auth_rhosts2(pw, cuser, chost, chost) == 0) 811 if (auth_rhosts2(pw, cuser, chost, chost) == 0)
812 return 0; 812 return 0;
813 lookup = chost; 813 lookup = chost;
814 } else { 814 } else {
815 if (((len = strlen(chost)) > 0) && chost[len - 1] == '.') {
816 debug2("stripping trailing dot from chost %s", chost);
817 chost[len - 1] = '\0';
818 }
815 if (strcasecmp(resolvedname, chost) != 0) 819 if (strcasecmp(resolvedname, chost) != 0)
816 log("userauth_hostbased mismatch: " 820 log("userauth_hostbased mismatch: "
817 "client sends %s, but we resolve %s to %s", 821 "client sends %s, but we resolve %s to %s",