diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2001-04-18 22:03:46 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2001-04-18 22:03:46 +0000 |
commit | 06a5ec82fe2fe8820d32fe68523c63f2cfec86aa (patch) | |
tree | cab68406a07a7abed59ad8e7c804f6a066f749b6 /usr.bin/ssh/sshconnect2.c | |
parent | c5beb2be5e83854cdde5316abc584ad33442980e (diff) |
use FDQN with trailing dot in the hostbased auth packets, ok deraadt@
Diffstat (limited to 'usr.bin/ssh/sshconnect2.c')
-rw-r--r-- | usr.bin/ssh/sshconnect2.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/ssh/sshconnect2.c b/usr.bin/ssh/sshconnect2.c index baa4e702851..ac3ad013bbc 100644 --- a/usr.bin/ssh/sshconnect2.c +++ b/usr.bin/ssh/sshconnect2.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshconnect2.c,v 1.70 2001/04/17 10:53:26 markus Exp $"); +RCSID("$OpenBSD: sshconnect2.c,v 1.71 2001/04/18 22:03:45 markus Exp $"); #include <openssl/bn.h> #include <openssl/md5.h> @@ -816,14 +816,17 @@ userauth_hostbased(Authctxt *authctxt) u_char *signature, *blob; char *chost, *pkalg, *p; u_int blen, slen; - int ok, i, found = 0; + int ok, i, len, found = 0; p = get_local_name(packet_get_connection_in()); if (p == NULL) { error("userauth_hostbased: cannot get local ipaddr/name"); return 0; } - chost = xstrdup(p); + len = strlen(p) + 2; + chost = xmalloc(len); + strlcpy(chost, p, len); + strlcat(chost, ".", len); debug2("userauth_hostbased: chost %s", chost); /* check for a useful key */ for (i = 0; i < authctxt->nkeys; i++) { |