Author: Bleep <tomh@inxpress.net>
authorBleep <twhelvey1@home.com>
Thu, 6 Apr 2000 06:50:18 +0000 (06:50 +0000)
committerBleep <twhelvey1@home.com>
Thu, 6 Apr 2000 06:50:18 +0000 (06:50 +0000)
Log message:
Sync with changes to 2.10.10.pl6 (shorten auth timeout, localhost to
server alias).

git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@137 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
include/numeric.h
ircd/s_auth.c

index 68a7ad7369323687617ea792c923cbd90572210c..5d77143e0fd67f947836e0942aa66260eb18000e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+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.
 #
index 02ebde178399a848d9cde4247666d201c21f58ed..bfaabd6486950efc51316f29f189b8c76e937b46 100644 (file)
@@ -117,10 +117,10 @@ extern const struct Numeric* get_error_numeric(int err);
 /*      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
@@ -259,7 +259,7 @@ extern const struct Numeric* get_error_numeric(int err);
 
 #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 */
 
index 58ca8a1eba3a42a9adac697d3d2bc15d2741165c..b84d100db1d2c7f70320d8a3a014a6a46493168e 100644 (file)
@@ -48,6 +48,7 @@
 #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>
@@ -96,6 +97,8 @@ typedef enum {
 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
  */
@@ -107,7 +110,7 @@ static struct AuthRequest* make_auth_request(struct Client* client)
   memset(auth, 0, sizeof(struct AuthRequest));
   auth->fd      = -1;
   auth->client  = client;
-  auth->timeout = CurrentTime + CONNECTTIMEOUT;
+  auth->timeout = CurrentTime + AUTH_TIMEOUT;
   return auth;
 }
 
@@ -507,9 +510,10 @@ static char* GetValidIdent(char *buf)
 /*
  * 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);
@@ -517,22 +521,30 @@ void start_auth(struct Client* 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))