+2000-04-06 Thomas Helvey <tomh@inxpress.net>
+ * ircd/s_auth.c: Shorten auth connect timeout to 60 seconds
+ set client host to server alias if connection from localhost
+
2000-04-06 Perry Lorier <isomer@coders.net>
* ircd/ircd.c: Fix core during pinging (oops)
#
# ChangeLog for ircu2.10.11
#
-# $Id: ChangeLog,v 1.61 2000-04-06 04:00:28 isomer Exp $
+# $Id: ChangeLog,v 1.62 2000-04-06 06:50:18 bleep Exp $
#
# Insert new changes at beginning of the change list.
#
/* RPL_STATSXLINE 247 hybrid extension */
/* RPL_STATSBLINE 247 Numerics List: IRCnet */
#define RPL_STATSULINE 248 /* Undernet extension */
-/* RPL_STATSDEFINE 248 /* Numerics List: IRCnet */
+/* RPL_STATSDEFINE 248 Numerics List: IRCnet */
#define RPL_STATSDEBUG 249 /* Extension to RFC1459 */
#define RPL_STATSCONN 250 /* Undernet extension */
-/* RPL_STATSDLINE 250 /* Numerics List: IRCnet */
+/* RPL_STATSDLINE 250 Numerics List: IRCnet */
#define RPL_LUSERCLIENT 251
#define RPL_LUSEROP 252
#define RPL_YOUREOPER 381
#define RPL_REHASHING 382
-/* RPL_YOURSERVICE 383 /* Numeric List: various */
+/* RPL_YOURSERVICE 383 Numeric List: various */
#define RPL_MYPORTIS 384 /* not used */
#define RPL_NOTOPERANYMORE 385 /* Extension to RFC1459, not used */
#include "struct.h"
#include "sys.h" /* TRUE bleah */
+#include <arpa/inet.h> /* inet_netof */
#include <netdb.h> /* struct hostent */
#include <string.h>
#include <stdlib.h>
struct AuthRequest* AuthPollList = 0; /* GLOBAL - auth queries pending io */
static struct AuthRequest* AuthIncompleteList = 0;
+enum { AUTH_TIMEOUT = 60 };
+
/*
* make_auth_request - allocate a new auth request
*/
memset(auth, 0, sizeof(struct AuthRequest));
auth->fd = -1;
auth->client = client;
- auth->timeout = CurrentTime + CONNECTTIMEOUT;
+ auth->timeout = CurrentTime + AUTH_TIMEOUT;
return auth;
}
/*
* start_auth - starts auth (identd) and dns queries for a client
*/
+enum { LOOPBACK = 127 };
+
void start_auth(struct Client* client)
{
- struct DNSQuery query;
struct AuthRequest* auth = 0;
assert(0 != client);
auth = make_auth_request(client);
assert(0 != auth);
- query.vptr = auth;
- query.callback = auth_dns_callback;
+#if !defined(NODNS)
+ if (LOOPBACK == inet_netof(client->ip)) {
+ strcpy(client->sockhost, me.name);
+ }
+ else {
+ struct DNSQuery query;
- if (IsUserPort(auth->client))
- sendheader(client, REPORT_DO_DNS);
+ query.vptr = auth;
+ query.callback = auth_dns_callback;
-#if !defined(NODNS)
- client->dns_reply = gethost_byaddr((const char*) &client->ip, &query);
- if (client->dns_reply) {
- ++client->dns_reply->ref_count;
- ircd_strncpy(client->sockhost, client->dns_reply->hp->h_name, HOSTLEN);
if (IsUserPort(auth->client))
- sendheader(client, REPORT_FIN_DNSC);
+ sendheader(client, REPORT_DO_DNS);
+
+ client->dns_reply = gethost_byaddr((const char*) &client->ip, &query);
+
+ if (client->dns_reply) {
+ ++client->dns_reply->ref_count;
+ ircd_strncpy(client->sockhost, client->dns_reply->hp->h_name, HOSTLEN);
+ if (IsUserPort(auth->client))
+ sendheader(client, REPORT_FIN_DNSC);
+ }
+ else
+ SetDNSPending(auth);
}
- else
- SetDNSPending(auth);
#endif
if (start_auth_query(auth))