]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/s_auth.c
Remove silly a2client_p, entirely pointless since User.server removal.
[irc/rqf/shadowircd.git] / src / s_auth.c
index 3494e5b618b15023489d3d7d44a7e605da28154d..5c57ed2f378e822327f74e8b1204058f9427ac04 100644 (file)
@@ -21,7 +21,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
  *
- *  $Id: s_auth.c 1683 2006-06-20 14:26:16Z jilles $ */
+ *  $Id: s_auth.c 3354 2007-04-03 09:21:31Z nenolod $ */
 
 /*
  * Changes:
 
 static const char *HeaderMessages[] =
 {
-       "NOTICE AUTH :*** Looking up your hostname...",
-       "NOTICE AUTH :*** Found your hostname",
-       "NOTICE AUTH :*** Couldn't look up your hostname",
-       "NOTICE AUTH :*** Checking Ident",
-       "NOTICE AUTH :*** Got Ident response",
-       "NOTICE AUTH :*** No Ident response",
-       "NOTICE AUTH :*** Your hostname is too long, ignoring hostname",
-       "NOTICE AUTH :*** Your forward and reverse DNS do not match, ignoring hostname",
-       "NOTICE AUTH :*** Cannot verify hostname validity, ignoring hostname",
+       ":*** Looking up your hostname...",
+       ":*** Found your hostname",
+       ":*** Couldn't look up your hostname",
+       ":*** Checking Ident",
+       ":*** Got Ident response",
+       ":*** No Ident response",
+       ":*** Your hostname is too long, ignoring hostname",
+       ":*** Your forward and reverse DNS do not match, ignoring hostname",
+       ":*** Cannot verify hostname validity, ignoring hostname",
 };
 
 typedef enum
@@ -87,7 +87,7 @@ typedef enum
 }
 ReportType;
 
-#define sendheader(c, r) sendto_one(c, HeaderMessages[(r)]) 
+#define sendheader(c, r) sendto_one_notice(c, HeaderMessages[(r)]) 
 
 static dlink_list auth_poll_list;
 static BlockHeap *auth_heap;
@@ -149,8 +149,8 @@ release_auth_client(struct AuthRequest *auth)
        client->localClient->auth_request = NULL;
        dlinkDelete(&auth->node, &auth_poll_list);
        free_auth_request(auth);        
-       if(client->localClient->fd > highest_fd)
-               highest_fd = client->localClient->fd;
+       if(client->localClient->F->fd > highest_fd)
+               highest_fd = client->localClient->F->fd;
 
        /*
         * When a client has auth'ed, we want to start reading what it sends
@@ -158,9 +158,9 @@ release_auth_client(struct AuthRequest *auth)
         *     -- adrian
         */
        client->localClient->allow_read = MAX_FLOOD;
-       comm_setflush(client->localClient->fd, 1000, flood_recalc, client);
+       comm_setflush(client->localClient->F->fd, 1000, flood_recalc, client);
        dlinkAddTail(client, &client->node, &global_client_list);
-       read_packet(client->localClient->fd, client);
+       read_packet(client->localClient->F->fd, client);
 }
 
 /*
@@ -286,7 +286,11 @@ start_auth_query(struct AuthRequest *auth)
                ++ServerStats->is_abad;
                return 0;
        }
-       if((MAXCONNECTIONS - 10) < fd)
+
+       /*
+        * TBD: this is a pointless arbitrary limit .. we either have a socket or not. -nenolod
+        */
+       if((comm_get_maxconnections() - 10) < fd)
        {
                sendto_realops_snomask(SNO_GENERAL, L_ALL,
                                     "Can't allocate fd for auth on %s",
@@ -305,7 +309,7 @@ start_auth_query(struct AuthRequest *auth)
         * and machines with multiple IP addresses are common now
         */
        memset(&localaddr, 0, locallen);
-       getsockname(auth->client->localClient->fd,
+       getsockname(auth->client->localClient->F->fd,
                    (struct sockaddr *) &localaddr, &locallen);
        
        mangle_mapped_sockaddr((struct sockaddr *)&localaddr);
@@ -400,10 +404,6 @@ start_auth(struct Client *client)
        if(client == NULL)
                return;
 
-       /* to aid bopm which needs something unique to match against */
-       sendto_one(client, "NOTICE AUTH :*** Processing connection to %s",
-                       me.name);
-
        auth = make_auth_request(client);
 
        auth->dns_query.ptr = auth;
@@ -492,9 +492,9 @@ auth_connect_callback(int fd, int error, void *data)
        }
 
        if(getsockname
-          (auth->client->localClient->fd, (struct sockaddr *) &us,
+          (auth->client->localClient->F->fd, (struct sockaddr *) &us,
            (socklen_t *) & ulen)
-          || getpeername(auth->client->localClient->fd,
+          || getpeername(auth->client->localClient->F->fd,
                          (struct sockaddr *) &them, (socklen_t *) & tlen))
        {
                ilog(L_IOERROR, "auth get{sock,peer}name error for %s:%m",