version 1.49, 2006/02/22 00:04:44 |
version 1.49.2.1, 2006/09/30 04:06:50 |
|
|
|
/* $OpenBSD$ */ |
/* |
/* |
* Author: Tatu Ylonen <ylo@cs.hut.fi> |
* Author: Tatu Ylonen <ylo@cs.hut.fi> |
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
|
|
* called by a name other than "ssh" or "Secure Shell". |
* called by a name other than "ssh" or "Secure Shell". |
*/ |
*/ |
|
|
#include "includes.h" |
#include <sys/types.h> |
RCSID("$OpenBSD$"); |
#include <sys/socket.h> |
|
|
|
#include <netinet/in.h> |
|
|
#include <ctype.h> |
#include <ctype.h> |
|
#include <errno.h> |
|
#include <netdb.h> |
|
#include <stdio.h> |
|
#include <stdlib.h> |
|
#include <string.h> |
|
#include <stdarg.h> |
|
|
#include "packet.h" |
|
#include "xmalloc.h" |
#include "xmalloc.h" |
|
#include "packet.h" |
#include "log.h" |
#include "log.h" |
#include "canohost.h" |
#include "canohost.h" |
|
|
|
|
*/ |
*/ |
for (i = 0; name[i]; i++) |
for (i = 0; name[i]; i++) |
if (isupper(name[i])) |
if (isupper(name[i])) |
name[i] = tolower(name[i]); |
name[i] = (char)tolower(name[i]); |
/* |
/* |
* Map it back to an IP address and check that the given |
* Map it back to an IP address and check that the given |
* address actually is an address of this host. This is |
* address actually is an address of this host. This is |
|
|
hints.ai_socktype = SOCK_STREAM; |
hints.ai_socktype = SOCK_STREAM; |
if (getaddrinfo(name, NULL, &hints, &aitop) != 0) { |
if (getaddrinfo(name, NULL, &hints, &aitop) != 0) { |
logit("reverse mapping checking getaddrinfo for %.700s " |
logit("reverse mapping checking getaddrinfo for %.700s " |
"failed - POSSIBLE BREAK-IN ATTEMPT!", name); |
"[%s] failed - POSSIBLE BREAK-IN ATTEMPT!", name, ntop); |
return xstrdup(ntop); |
return xstrdup(ntop); |
} |
} |
/* Look for the address from the list of addresses. */ |
/* Look for the address from the list of addresses. */ |