33 |
|
* --Bleep Thomas Helvey <tomh@inxpress.net> |
34 |
|
*/ |
35 |
|
#include "stdinc.h" |
36 |
– |
#include "tools.h" |
36 |
|
#include "list.h" |
37 |
+ |
#include "ircd_defs.h" |
38 |
+ |
#include "fdlist.h" |
39 |
|
#include "s_auth.h" |
40 |
|
#include "s_conf.h" |
41 |
|
#include "balloc.h" |
42 |
|
#include "client.h" |
43 |
|
#include "common.h" |
44 |
|
#include "event.h" |
44 |
– |
#include "fdlist.h" /* fdlist_add */ |
45 |
|
#include "hook.h" |
46 |
|
#include "irc_string.h" |
47 |
– |
#include "sprintf_irc.h" |
47 |
|
#include "ircd.h" |
49 |
– |
#include "numeric.h" |
48 |
|
#include "packet.h" |
49 |
|
#include "irc_res.h" |
50 |
|
#include "s_bsd.h" |
51 |
|
#include "s_log.h" |
52 |
|
#include "send.h" |
53 |
< |
#include "memory.h" |
53 |
> |
|
54 |
|
|
55 |
|
static const char *HeaderMessages[] = { |
56 |
|
":%s NOTICE AUTH :*** Looking up your hostname...", |
443 |
|
char authbuf[32]; |
444 |
|
socklen_t ulen = sizeof(struct irc_ssaddr); |
445 |
|
socklen_t tlen = sizeof(struct irc_ssaddr); |
446 |
< |
u_int16_t uport, tport; |
446 |
> |
uint16_t uport, tport; |
447 |
|
#ifdef IPV6 |
448 |
|
struct sockaddr_in6 *v6; |
449 |
|
#else |
456 |
|
return; |
457 |
|
} |
458 |
|
|
459 |
< |
if (getsockname(auth->client->localClient->fd.fd, (struct sockaddr *) &us, |
460 |
< |
(socklen_t *) &ulen) || |
461 |
< |
getpeername(auth->client->localClient->fd.fd, (struct sockaddr *) &them, |
462 |
< |
(socklen_t *) &tlen)) |
459 |
> |
if (getsockname(auth->client->localClient->fd.fd, (struct sockaddr *)&us, |
460 |
> |
&ulen) || |
461 |
> |
getpeername(auth->client->localClient->fd.fd, (struct sockaddr *)&them, |
462 |
> |
&tlen)) |
463 |
|
{ |
464 |
|
ilog(L_INFO, "auth get{sock,peer}name error for %s", |
465 |
|
get_client_name(auth->client, SHOW_IP)); |
483 |
|
them.ss_len = tlen; |
484 |
|
#endif |
485 |
|
|
486 |
< |
ircsprintf(authbuf, "%u , %u\r\n", tport, uport); |
486 |
> |
snprintf(authbuf, sizeof(authbuf), "%u , %u\r\n", tport, uport); |
487 |
|
|
488 |
|
if (send(fd->fd, authbuf, strlen(authbuf), 0) == -1) |
489 |
|
{ |