CVS: Bahamut-1.8/src m_stats.c, 1.1.1.1, 1.2 s_misc.c, 1.2, 1.3 s_user.c, 1.6, 1.7 send.c, 1.1.1.1, 1.2

Mark Rutherford markr at nubian.blitzed.org
Tue Aug 16 03:35:08 UTC 2005


Update of /data/cvs/Bahamut-1.8/src
In directory nubian.blitzed.org:/tmp/cvs-serv6764/src

Modified Files:
	m_stats.c s_misc.c s_user.c send.c 
Log Message:
wrapped dccallow system
squelched gcc warning in s_user.c


Index: m_stats.c
===================================================================
RCS file: /data/cvs/Bahamut-1.8/src/m_stats.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff --unified=6 -r1.1.1.1 -r1.2
--- m_stats.c	13 Aug 2005 16:39:48 -0000	1.1.1.1
+++ m_stats.c	16 Aug 2005 03:35:05 -0000	1.2
@@ -478,20 +478,22 @@
             for (link = acptr->user->invited; link;
                  link = link->next)
                 usi++;
             for (link = acptr->user->channel; link;
                  link = link->next)
                 usc++;
+#ifdef DCCALLOW
             for (link = acptr->user->dccallow; link;
                  link = link->next)
             {
                 if(link->flags == DCC_LINK_ME)
                     usdm++;
                 else
                     usdr++;
             }
+#endif
             for (link = acptr->user->silence; link;
                  link = link->next)
                 uss++;
             if (acptr->user->away)
             {
                 aw++;
@@ -584,15 +586,17 @@
                totallinks * sizeof(Link), linkalloc, linkallocsz);
     sendto_one(cptr, ":%s %d %s :   UserInvites %d(%d) ChanInvites %d(%d)",
                me.name, RPL_STATSDEBUG, nick, usi, usi * sizeof(Link), chi,
                chi * sizeof(Link));
     sendto_one(cptr, ":%s %d %s :   UserChannels %d(%d)",
                me.name, RPL_STATSDEBUG, nick, usc, usc * sizeof(Link));
+#ifdef DCCALLOW
     sendto_one(cptr, ":%s %d %s :   DCCAllow Local %d(%d) Remote %d(%d)",
                me.name, RPL_STATSDEBUG, nick, usdm, usdm * sizeof(Link),
                usdr, usdr * sizeof(Link));
+#endif
     sendto_one(cptr, ":%s %d %s :   WATCH entries %d(%d)",
                me.name, RPL_STATSDEBUG, nick, wle, wle*sizeof(Link));
     sendto_one(cptr, ":%s %d %s :   Fludees %d(%d)",
                me.name, RPL_STATSDEBUG, nick, fludlink, fludlink*sizeof(Link));
 
     sendto_one(cptr, ":%s %d %s :DLinks ALLOC %d(%d)",

Index: s_misc.c
===================================================================
RCS file: /data/cvs/Bahamut-1.8/src/s_misc.c,v
retrieving revision 1.2
retrieving revision 1.3
diff --unified=6 -r1.2 -r1.3
--- s_misc.c	15 Aug 2005 22:12:59 -0000	1.2
+++ s_misc.c	16 Aug 2005 03:35:05 -0000	1.3
@@ -325,13 +325,13 @@
 
     namebuf[0] = '*';
     strncpy(&namebuf[1], name, HOSTLEN - 1);
     namebuf[HOSTLEN - 1] = '\0';
     return namebuf;
 }
-
+#ifdef DCCALLOW
 int remove_dcc_references(aClient *sptr)
 {  
     aClient *acptr;
     Link *lp, *nextlp;
     Link **lpp, *tmp;
     int found;
@@ -369,13 +369,13 @@
                                acptr->name, lp->flags, sptr->name);
         free_link(lp);
         lp = nextlp;
     }
     return 0;
 }  
-
+#endif
 /*
  * NOQUIT
  * a method of reducing the stress on the network during server splits
  * by sending only a simple "SQUIT" message for the server that is dropping,
  * instead of thousands upon thousands of QUIT messages for each user,
  * plus an SQUIT for each server behind the dead link.
@@ -410,15 +410,15 @@
         del_invite(cptr, lp->value.chptr);
     while ((lp = cptr->user->silence))
         del_silence(cptr, lp->value.cp);
 
     if (cptr->ip.s_addr)
         clones_remove(cptr);
-
+#ifdef DCCALLOW
     remove_dcc_references(cptr);
-
+#endif
     del_from_client_hash_table(cptr->name, cptr); 
 
     hash_check_watch(cptr, RPL_LOGOFF);
 
     remove_client_from_list(cptr);
 }
@@ -797,13 +797,15 @@
             /* Clean up invitefield */
             while ((lp = sptr->user->invited))
                 del_invite(sptr, lp->value.chptr);
             /* Clean up silences */
             while ((lp = sptr->user->silence)) 
                 del_silence(sptr, lp->value.cp);
+#ifdef DCCALLOW
             remove_dcc_references(sptr);
+#endif
             /* again, this is all that is needed */
         }
     }
 
     /* Remove sptr from the client list */
     if (del_from_client_hash_table(sptr->name, sptr) != 1) 

Index: s_user.c
===================================================================
RCS file: /data/cvs/Bahamut-1.8/src/s_user.c,v
retrieving revision 1.6
retrieving revision 1.7
diff --unified=6 -r1.6 -r1.7
--- s_user.c	15 Aug 2005 22:12:59 -0000	1.6
+++ s_user.c	16 Aug 2005 03:35:05 -0000	1.7
@@ -37,12 +37,13 @@
 #include "h.h"
 #ifdef FLUD
 #include "blalloc.h"
 #endif /* FLUD */
 #include "userban.h"
 #include "hooks.h"
+#include <arpa/inet.h>
 
 #if defined( HAVE_STRING_H)
 #include <string.h>
 #else
 #include <strings.h>
 #endif
@@ -1157,13 +1158,13 @@
 
 char *exploits_4char[] =
 {
     "html",
     NULL
 };
-
+#ifdef DCCALLOW
 static int
 allow_dcc(aClient *to, aClient *from)
 {
     Link *lp;
 
     for(lp = to->user->dccallow; lp; lp = lp->next)
@@ -1324,12 +1325,13 @@
                                to->name); 
 
         return 1;
     }
     return 0;
 }
+#endif /* DCCALLOW */
 
 /*
  * check target limit: message target rate limiting
  * anti spam control!
  * should only be called for local PERSONS!
  * sptr: client sending message
@@ -1419,21 +1421,23 @@
 check_for_ctcp(char *str, char **dccptr)
 {
     char       *p = str;
 
     while ((p = strchr(p, 1)) != NULL)
     {
+#ifdef DCCALLOW
         if (myncmp(++p, "DCC", 3) == 0)
         {
             if(dccptr)
                 *dccptr = p;
             if(myncmp(p+3, " SEND", 5) == 0)
                 return CTCP_DCCSEND;
             else
                 return CTCP_DCC;
         }
+#endif
         if (myncmp(++p, "ACTION", 6) != 0)
             return CTCP_YES;
         if ((p = strchr(p, 1)) == NULL)
             return CTCP_NONE;
         if(!(*(++p)))
             break;;
@@ -1639,14 +1643,16 @@
                     
                         case CTCP_DCCSEND:
 #ifdef FLUD
                             if (check_for_flud(sptr, acptr, NULL, 1))
                                 return 0;
 #endif
+#ifdef DCCALLOW
                             if(check_dccsend(sptr, acptr, dccmsg))
                                 continue;
+#endif
                             break;
                     
                         default:
 #ifdef FLUD
                             if (check_for_flud(sptr, acptr, NULL, 1))
                                 return 0;
@@ -3732,13 +3738,13 @@
     {
         sendto_one(sptr, err_str(ERR_NOSUCHNICK), me.name, parv[0], parv[1]);
         return 0;
     }
     return 0;
 }
-
+#ifdef DCCALLOW
 static int 
 add_dccallow(aClient *sptr, aClient *optr)
 {
     Link *lp;
     int cnt = 0;
 
@@ -3965,6 +3971,7 @@
                    sptr->name);
         return 0;
     }
     
     return 0;
 }
+#endif /* DCCALLOW */

Index: send.c
===================================================================
RCS file: /data/cvs/Bahamut-1.8/src/send.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff --unified=6 -r1.1.1.1 -r1.2
--- send.c	13 Aug 2005 16:39:54 -0000	1.1.1.1
+++ send.c	16 Aug 2005 03:35:05 -0000	1.2
@@ -1232,17 +1232,17 @@
           tmsg = "Spam";
           break;
 
        case FLOOD_LEV:
           tmsg = "Flood";
           break;
-
+#ifdef DCCALLOW
        case DCCSEND_LEV:
           tmsg = "DCCAllow";
           break;
-
+#endif
        default:
           tmsg = "Notice";
     }
 #else
     tmsg = "Notice";
 #endif
@@ -1270,16 +1270,18 @@
                     continue;
                 break;
             case SPY_LEV:
                 if (!SendSpyNotice(cptr) || !IsAnOper(cptr))
                     continue;
                 break;
+#ifdef DCCALLOW
             case DCCSEND_LEV:
                 if (!SendDCCNotice(cptr) || !IsAnOper(cptr))
                     continue;
                 break;
+#endif
             case FLOOD_LEV:
                 if (!SendFloodNotice(cptr) || !IsAnOper(cptr))
                     continue;
                 break;
             case SPAM_LEV:
                 if (!SendSpamNotice(cptr) || !IsAnOper(cptr))
@@ -1755,17 +1757,17 @@
           tmsg = "Spam";
           break;
 
        case FLOOD_LEV:
           tmsg = "Flood";
           break;
-
+#ifdef DCCALLOW
        case DCCSEND_LEV:
           tmsg = "DCCAllow";
           break;
-
+#endif
        default:
           tmsg = "Notice";
     }
 #else
     tmsg = "Notice";
 #endif
@@ -1792,16 +1794,18 @@
                     continue;
                 break;
             case SPY_LEV:
                 if (!SendSpyNotice(cptr))
                     continue;
                 break;
+#ifdef DCCALLOW
             case DCCSEND_LEV:
                 if (!SendDCCNotice(cptr))
                     continue;
                 break;
+#endif
             case FLOOD_LEV:
                 if (!SendFloodNotice(cptr))
                     continue;
                 break;
             case SPAM_LEV:
                 if (!SendSpamNotice(cptr))



More information about the ircd-checkins mailing list