CVS: Bahamut-1.8/src Makefile.in, 1.2, 1.3 channel.c, 1.5, 1.6 drone.c, 1.2, 1.3 s_user.c, 1.8, 1.9

Mark Rutherford markr at nubian.blitzed.org
Sat Aug 20 17:26:08 UTC 2005


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

Modified Files:
	Makefile.in channel.c drone.c s_user.c 
Log Message:
- general cleanup. removed the halfops because at this point,
there is no support for it, nor need. we can re-add it later.

- makefile work, support for the drone module included


Index: Makefile.in
===================================================================
RCS file: /data/cvs/Bahamut-1.8/src/Makefile.in,v
retrieving revision 1.2
retrieving revision 1.3
diff --unified=6 -r1.2 -r1.3
--- Makefile.in	13 Aug 2005 16:58:09 -0000	1.2
+++ Makefile.in	20 Aug 2005 17:26:04 -0000	1.3
@@ -13,12 +13,14 @@
 
 RES_SRC =
 
 #This is only for very old systems that NEED this
 #RES_SRC = res_mkquery.c res_init.c res_comp.c
 
+MODULES = drone.c
+
 SOURCES = blalloc.c bsd.c channel.c clientlist.c clones.c confparse.c \
           fdlist.c fds.c hash.c hide.c inet_addr.c ircd.c ircsprintf.c list.c \
           m_nick.c m_rwho.c m_server.c m_services.c m_stats.c m_who.c match.c \
           modules.c packet.c parse.c pcre.c res.c s_auth.c s_bsd.c s_conf.c \
           s_debug.c s_err.c s_misc.c s_numeric.c s_serv.c s_user.c sbuf.c \
           scache.c send.c struct.c support.c throttle.c userban.c whowas.c \
@@ -36,13 +38,13 @@
 
 # Yuck - don't use this.
 depend:
 	makedepend $(INCLUDE) $(SOURCES)
 
 clean:
-	$(RM) -f $(OBJECTS) *~ ircd.core core ircd 
+	$(RM) -f $(OBJECTS) *~ ircd.core core ircd *.so
 
 distclean: clean
 	$(RM) -f Makefile version.c.last
 
 .c.o:
 	$(CC) $(CFLAGS) $(INCLUDEDIR) -c $<
@@ -52,15 +54,22 @@
 	mv version.c version.c.last
 
 install:
 	@if test -f $(INSTALL_DIR)/ircd; then \
 		echo $(MV) $(INSTALL_DIR)/ircd $(INSTALL_DIR)/ircd.old; \
 		$(MV) $(INSTALL_DIR)/ircd $(INSTALL_DIR)/ircd.old; \
+		echo $(MV) $(INSTALL_DIR)/ircd $(INSTALL_DIR)/drone.so.old; \
+		$(MV) $(INSTALL_DIR)/ircd $(INSTALL_DIR)/drone.so.old; \
 	fi
 	@echo $(INSTALL_BIN) ircd $(INSTALL_DIR);
 	$(INSTALL_BIN) ircd $(INSTALL_DIR)
+	@echo $(INSTALL_BIN) drone.so $(INSTALL_DIR);
+	$(INSTALL_BIN) drone.so $(INSTALL_DIR)
+
+modules:
+	$(CC) $(CFLAGS) $(INCLUDEDIR) -o drone.so -shared -g drone.c
 
 version.c: version.c.SH
 	/bin/sh ./version.c.SH
 
 blalloc.o: blalloc.c ../include/struct.h ../include/config.h \
   ../include/setup.h ../include/defs.h ../include/hash.h \

Index: channel.c
===================================================================
RCS file: /data/cvs/Bahamut-1.8/src/channel.c,v
retrieving revision 1.5
retrieving revision 1.6
diff --unified=6 -r1.5 -r1.6
--- channel.c	15 Aug 2005 02:57:47 -0000	1.5
+++ channel.c	20 Aug 2005 17:26:04 -0000	1.6
@@ -926,23 +926,12 @@
         if ((cm = find_user_member(chptr->members, cptr)))
             return (cm->flags & CHFL_CHANOP);
     
     return 0;
 }
 
-int is_chan_halfop(aClient *cptr, aChannel *chptr)
-{
-    chanMember   *cm;
-    
-    if (chptr)
-        if ((cm = find_user_member(chptr->members, cptr)))
-            return (cm->flags & CHFL_HALFOP);
-    
-    return 0;
-}
-
 int is_deopped(aClient *cptr, aChannel *chptr)
 {
     chanMember   *cm;
     
     if (chptr)
         if ((cm = find_user_member(chptr->members, cptr)))
@@ -988,13 +977,13 @@
                                 * we need to bquiet them if we can
                                 */
     }
     else
     {
         /* ops and voices can talk through everything except NOCOLOR */
-        if (!(cm->flags & (CHFL_CHANOP | CHFL_HALFOP | CHFL_VOICE)))
+        if (!(cm->flags & (CHFL_CHANOP | CHFL_VOICE)))
         {
             if (chptr->mode.mode & MODE_MODERATED)
                 return (MODE_MODERATED);
             if (is_banned(cptr, chptr, cm))
                 return (MODE_BAN);
             if ((chptr->mode.mode & MODE_MODREG) && 
@@ -1226,13 +1215,13 @@
     channel_modes(cptr, modebuf, parabuf, chptr);
 
     ircsprintf(buf, ":%s SJOIN %ld %s %s %s :", me.name,
                chptr->channelts, chptr->chname, modebuf, parabuf);
     t = buf + strlen(buf);
     for (l = chptr->members; l; l = l->next)
-        if (l->flags & MODE_CHANOP || l->flags & MODE_HALFOP)
+        if (l->flags & MODE_CHANOP)
         {
             anop = l;
             break;
         }
 
     /*
@@ -1259,14 +1248,12 @@
                 break;
         }
         if (l->flags & MODE_CHANOP)
             *t++ = '@';
         if (l->flags & MODE_VOICE)
             *t++ = '+';
-	if (l->flags & MODE_HALFOP)
-            *t++ = '%';
         strcpy(t, l->cptr->name);
         t += strlen(t);
         *t++ = ' ';
         n++;
         if (t - buf > BUFSIZE - 80)
         {
@@ -1651,13 +1638,12 @@
                     chptr->mode.mode&=~MODE_OPERONLY;
                 *mbuf++ = *modes;
                 nmodes++;
             }
             break;
         case 'o':
-	case 'h':
         case 'v':
             if(level<1) 
             {
                 errors |= SM_ERR_NOPRIVS;
                 break;
             }
@@ -1690,28 +1676,16 @@
             {
                 args++;
                 break;
             }
             
             /* if we have the user, set them +/-[vo] */
-            /* this is discusting hackery */
-            if(change=='+') {
-		if (*modes == 'o')
-			cm->flags|=CHFL_CHANOP;
-		else if (*modes == 'h')
-			cm->flags|=CHFL_HALFOP;
-		else if (*modes == 'v')
-			cm->flags|=CHFL_VOICE;
-            } else {
-		if (*modes == 'o')
-			cm->flags&=~CHFL_CHANOP;
-		else if (*modes == 'h')
-			cm->flags&=~CHFL_HALFOP;
-		else if (*modes == 'v')
-			cm->flags&=~CHFL_VOICE;
-            }
+            if(change=='+')
+                cm->flags|=(*modes=='o' ? CHFL_CHANOP : CHFL_VOICE);
+            else
+                cm->flags&=~((*modes=='o' ? CHFL_CHANOP : CHFL_VOICE));
             /* we've decided their mode was okay, cool */
             *mbuf++ = *modes;
             ADD_PARA(cm->cptr->name)
                 args++;
             nmodes++;
             if (IsServer(sptr) && *modes == 'o' && change=='+') 
@@ -3356,13 +3330,13 @@
         if (!member)
         {
             sendto_one(sptr, err_str(ERR_NOTONCHANNEL), me.name, parv[0],name);
             return 0;
         }
 
-        if ((chptr->mode.mode & MODE_TOPICLIMIT) && !is_chan_op(sptr, chptr) && !is_chan_halfop(sptr, chptr))
+        if ((chptr->mode.mode & MODE_TOPICLIMIT) && !is_chan_op(sptr, chptr))
         {
             sendto_one(sptr, err_str(ERR_CHANOPRIVSNEEDED), me.name, parv[0],
                        chptr->chname);
             return 0;
         }
     }
@@ -3931,14 +3905,12 @@
         if(IsInvisible(acptr) && !member)
             continue;
         if(cm->flags & CHFL_CHANOP)
             buf[idx++] = '@';
         else if(cm->flags & CHFL_VOICE)
             buf[idx++] = '+';
-	else if(cm->flags & CHFL_HALFOP)
-            buf[idx++] = '%';
         for(s = acptr->name; *s; s++)
             buf[idx++] = *s;
         buf[idx++] = ' ';
         buf[idx] = '\0';
         flag = 1;
         if(mlen + idx + NICKLEN > BUFSIZE - 3)
@@ -4305,13 +4277,13 @@
         
     isnew = ChannelExists(parv[2]) ? 0 : 1;
     chptr = get_channel(sptr, parv[2], CREATE, &created);
     oldts = chptr->channelts;
 
     for (cm = chptr->members; cm; cm = cm->next)
-        if (cm->flags & MODE_CHANOP || cm->flags & MODE_HALFOP)
+        if (cm->flags & MODE_CHANOP)
         {
             haveops++;
             break;
         }
 
     if(clientjoin) /* we have a good old client sjoin, with timestamp */
@@ -4638,30 +4610,12 @@
                     *mbuf = '\0';
                     pargs = pbpos = what = 0;
                 }
                 cm->flags &= ~MODE_CHANOP;
             }
 
-            if (cm->flags & MODE_HALFOP) 
-            {
-                INSERTSIGN(-1,'-')
-                    *mbuf++ = 'h';
-                ADD_PARA(cm->cptr->name)
-                    pargs++;
-                if (pargs >= MAXMODEPARAMS) 
-                {
-                    *mbuf = '\0';
-                    parabuf[pbpos] = '\0';
-                    sjoin_sendit(cptr, sptr, chptr, parv[0]);
-                    mbuf = modebuf;
-                    *mbuf = '\0';
-                    pargs = pbpos = what = 0;
-                }
-                cm->flags &= ~MODE_HALFOP;
-            }
-
             if (cm->flags & MODE_VOICE) 
             {
                 INSERTSIGN(-1,'-')
                     *mbuf++ = 'v';
                 ADD_PARA(cm->cptr->name)
                     pargs++;
@@ -4731,24 +4685,22 @@
     for (s = s0 = strtoken(&p, parv[args + 4], " "); s;
          s = s0 = strtoken(&p, (char *) NULL, " ")) 
     {
         fl = 0;
         if (*s == '@' || s[1] == '@')
             fl |= MODE_CHANOP;
-	if (*s == '%' || s[1] == '%')
-            fl |= MODE_HALFOP;
         if (*s == '+' || s[1] == '+')
             fl |= MODE_VOICE;
         if (!keepnewmodes) 
         {
-            if (fl & MODE_CHANOP || fl & MODE_HALFOP)
+            if (fl & MODE_CHANOP)
                 fl = MODE_DEOPPED;
             else
                 fl = 0;
         }
-        while (*s == '@' || *s == '+' || *s == '%')
+        while (*s == '@' || *s == '+')
             s++;
         if (!(acptr = find_chasing(sptr, s, NULL)))
             continue;
         if (acptr->from != cptr)
             continue;
         people++;
@@ -4777,29 +4729,12 @@
                 sjoin_sendit(cptr, sptr, chptr, parv[0]);
                 mbuf = modebuf;
                 *mbuf++ = '+';
                 pargs = pbpos = 0;
             }
         }
-	
-	if (fl & MODE_HALFOP) 
-        {
-            *mbuf++ = 'h';
-            ADD_PARA(s)
-            pargs++;
-            if (pargs >= MAXMODEPARAMS) 
-            {
-                *mbuf = '\0';
-                parabuf[pbpos] = '\0';
-                sjoin_sendit(cptr, sptr, chptr, parv[0]);
-                mbuf = modebuf;
-                *mbuf++ = '+';
-                pargs = pbpos = 0;
-            }
-        }
-	
 
         if (fl & MODE_VOICE) 
         {
             *mbuf++ = 'v';
             ADD_PARA(s)
             pargs++;

Index: drone.c
===================================================================
RCS file: /data/cvs/Bahamut-1.8/src/drone.c,v
retrieving revision 1.2
retrieving revision 1.3
diff --unified=6 -r1.2 -r1.3
--- drone.c	20 Aug 2005 04:56:07 -0000	1.2
+++ drone.c	20 Aug 2005 17:26:04 -0000	1.3
@@ -29,12 +29,13 @@
 #include "msg.h" 
 #include "channel.h" 
 #include "throttle.h" 
 #include "h.h" 
 #include "hooks.h" 
 #include "drone-data.h"
+#include <arpa/inet.h>
 
  /* compile:
   * gcc -I<path to bahamut include dir> -o drone.so -shared -g drone.c 
   * IMPORTANT! 
   * IF USING SSL:
   * gcc -I<path to bahamut include dir> -DUSE_SSL -o drone.so -shared -g drone.c 
@@ -47,12 +48,13 @@
 
 static int check_fyle(aClient *, char *, char *, char *, char *);
 static int check_fizzer(aClient *, char *, char *, char *, char *);
 static int check_unut23(aClient *, char *, char *, char *, char *, char **, char *);
 static int check_spacex(aClient *, char *, char *, char *, char *);
 static int check_mymoon(aClient *, char *, char *, char *, char *);
+extern void *bircmodule_add_hook(enum c_hooktype, void *, void *);
 
 void *mod; 
 void bircmodule_check(int *acsz) 
 {
 	*acsz = MODULEVERSION; 
 } 

Index: s_user.c
===================================================================
RCS file: /data/cvs/Bahamut-1.8/src/s_user.c,v
retrieving revision 1.8
retrieving revision 1.9
diff --unified=6 -r1.8 -r1.9
--- s_user.c	20 Aug 2005 02:49:36 -0000	1.8
+++ s_user.c	20 Aug 2005 17:26:04 -0000	1.9
@@ -884,12 +884,18 @@
             return exit_client(cptr, sptr, &me, reason);
         }
 
         if(call_hooks(CHOOK_POSTACCESS, sptr) == FLUSH_BUFFER)
             return FLUSH_BUFFER;
 
+        /* free these, drone checks have completed */
+        MyFree(sptr->droneusername);
+        MyFree(sptr->dronehost);
+        MyFree(sptr->droneserver);
+        MyFree(sptr->dronerealname);
+
         if ((++Count.local) > Count.max_loc) 
         {
             Count.max_loc = Count.local;
             if (!(Count.max_loc % 10))
                 sendto_ops("New Max Local Clients: %d", Count.max_loc);
         }



More information about the ircd-checkins mailing list