X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/717718f72583a193407c33e25b0e5a3836a647c0..ad884f939ea6f1b84c192b9dd4b2f51a71cfcdb5:/src/s_auth.c diff --git a/src/s_auth.c b/src/s_auth.c index eabea23..2ea496d 100644 --- a/src/s_auth.c +++ b/src/s_auth.c @@ -39,8 +39,7 @@ #include "s_conf.h" #include "client.h" #include "common.h" -#include "irc_string.h" -#include "sprintf_irc.h" +#include "match.h" #include "ircd.h" #include "numeric.h" #include "packet.h" @@ -199,7 +198,7 @@ auth_dns_callback(void *vptr, struct DNSReply *reply) good = 0; } } -#ifdef IPV6 +#ifdef RB_IPV6 else if(auth->client->localClient->ip.ss_family == AF_INET6) { struct sockaddr_in6 *ip, *ip_fwd; @@ -222,7 +221,7 @@ auth_dns_callback(void *vptr, struct DNSReply *reply) if(good && strlen(reply->h_name) <= HOSTLEN) { - strlcpy(auth->client->host, reply->h_name, sizeof(auth->client->host)); + rb_strlcpy(auth->client->host, reply->h_name, sizeof(auth->client->host)); sendheader(auth->client, REPORT_FIN_DNS); } else if (strlen(reply->h_name) > HOSTLEN) @@ -240,7 +239,7 @@ auth_dns_callback(void *vptr, struct DNSReply *reply) static void auth_error(struct AuthRequest *auth) { - ++ServerStats->is_abad; + ++ServerStats.is_abad; rb_close(auth->F); auth->F = NULL; @@ -274,7 +273,7 @@ start_auth_query(struct AuthRequest *auth) if((F = rb_socket(family, SOCK_STREAM, 0, "ident")) == NULL) { ilog_error("creating auth stream socket"); - ++ServerStats->is_abad; + ++ServerStats.is_abad; return 0; } @@ -304,7 +303,7 @@ start_auth_query(struct AuthRequest *auth) (struct sockaddr *) &localaddr, &locallen); /* XXX mangle_mapped_sockaddr((struct sockaddr *)&localaddr); */ -#ifdef IPV6 +#ifdef RB_IPV6 if(localaddr.ss_family == AF_INET6) { ((struct sockaddr_in6 *)&localaddr)->sin6_port = 0; @@ -313,13 +312,13 @@ start_auth_query(struct AuthRequest *auth) ((struct sockaddr_in *)&localaddr)->sin_port = 0; destaddr = auth->client->localClient->ip; -#ifdef IPV6 +#ifdef RB_IPV6 if(localaddr.ss_family == AF_INET6) { - ((struct sockaddr_in6 *)&localaddr)->sin6_port = 113; + ((struct sockaddr_in6 *)&destaddr)->sin6_port = htons(113); } else #endif - ((struct sockaddr_in *)&localaddr)->sin_port = 113; + ((struct sockaddr_in *)&destaddr)->sin_port = htons(113); auth->F = F; SetAuthConnect(auth); @@ -445,7 +444,7 @@ timeout_auth_queries_event(void *notused) if(IsDoingAuth(auth)) { ClearAuth(auth); - ++ServerStats->is_abad; + ++ServerStats.is_abad; sendheader(auth->client, REPORT_FAIL_ID); auth->client->localClient->auth_request = NULL; } @@ -487,7 +486,6 @@ auth_connect_callback(rb_fde_t *F, int error, void *data) if(error != RB_OK) { /* We had an error during connection :( */ - ilog_error("identd check"); auth_error(auth); return; } @@ -576,14 +574,14 @@ read_auth_reply(rb_fde_t *F, void *data) if(s == NULL) { - ++ServerStats->is_abad; + ++ServerStats.is_abad; strcpy(auth->client->username, "unknown"); sendheader(auth->client, REPORT_FAIL_ID); } else { sendheader(auth->client, REPORT_FIN_ID); - ++ServerStats->is_asuc; + ++ServerStats.is_asuc; SetGotId(auth->client); }