[IRC-Dev CVS] [CVS] Module ircd-ircdev: Change committed
Brought to you by:
zolty
From: Toni G. <zo...@us...> - 2007-04-21 21:17:40
|
Committer : zolty CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2007-04-21 21:17:34 UTC Modified files: ChangeLog ChangeLog.es include/ddb.h include/ircd.h include/list.h include/msgq.h include/patchlevel.h include/querycmds.h include/s_bsd.h include/send.h ircd/Makefile.in ircd/channel.c ircd/ddb.c ircd/ddb_events.c ircd/destruct_event.c ircd/gline.c ircd/ircd.c ircd/ircd_auth.c ircd/ircd_log.c ircd/ircd_relay.c ircd/ircd_reply.c ircd/jupe.c ircd/list.c ircd/listener.c ircd/m_account.c ircd/m_away.c ircd/m_burst.c ircd/m_clearmode.c ircd/m_connect.c ircd/m_cprivmsg.c ircd/m_create.c ircd/m_db.c ircd/m_dbq.c ircd/m_destruct.c ircd/m_desynch.c ircd/m_endburst.c ircd/m_error.c ircd/m_ghost.c ircd/m_gline.c ircd/m_invite.c ircd/m_join.c ircd/m_jupe.c ircd/m_kick.c ircd/m_kill.c ircd/m_nick.c ircd/m_oper.c ircd/m_rehash.c ircd/m_server.c ircd/m_settime.c ircd/m_silence.c ircd/m_svsnick.c ircd/m_topic.c ircd/m_trace.c ircd/m_wallchops.c ircd/m_wallops.c ircd/m_wallusers.c ircd/m_wallvoices.c ircd/memdebug.c ircd/motd.c ircd/msgq.c ircd/numnicks.c ircd/os_generic.c ircd/s_auth.c ircd/s_bsd.c ircd/s_conf.c ircd/s_misc.c ircd/s_numeric.c ircd/s_serv.c ircd/s_user.c ircd/send.c ircd/umkpasswd.c Removed files: include/sys.h Log message: Author: zo...@ir... Log message: 2007-04-21 Toni Garc�a <zo...@ir...> 1.0.beta3 * Limpieza send.c * Limpieza sintasis ---------------------- diff included ---------------------- Index: ircd-ircdev/ChangeLog diff -u ircd-ircdev/ChangeLog:1.51 ircd-ircdev/ChangeLog:1.52 --- ircd-ircdev/ChangeLog:1.51 Sat Apr 21 09:20:17 2007 +++ ircd-ircdev/ChangeLog Sat Apr 21 14:17:22 2007 @@ -1,11 +1,15 @@ # # ChangeLog for ircd-ircdev # -# $Id: ChangeLog,v 1.51 2007/04/21 16:20:17 zolty Exp $ +# $Id: ChangeLog,v 1.52 2007/04/21 21:17:22 zolty Exp $ # # Insert new changes at beginning of the change list. # -2007-04-21 Toni Garc�a <zo...@ir...> 1.0.beta2 +2007-04-21 Toni Garc�a <zo...@ir...> 1.0.beta3 + * Cleanup send.c + * Cleanup syntax + +2007-04-21 Toni Garc�a <zo...@ir...> 1.0.beta2 * Remove P09 support rests * New Invite structure Index: ircd-ircdev/ChangeLog.es diff -u ircd-ircdev/ChangeLog.es:1.51 ircd-ircdev/ChangeLog.es:1.52 --- ircd-ircdev/ChangeLog.es:1.51 Sat Apr 21 09:20:17 2007 +++ ircd-ircdev/ChangeLog.es Sat Apr 21 14:17:22 2007 @@ -1,10 +1,14 @@ # # Log de Cambios para ircd-ircdev # -# $Id: ChangeLog.es,v 1.51 2007/04/21 16:20:17 zolty Exp $ +# $Id: ChangeLog.es,v 1.52 2007/04/21 21:17:22 zolty Exp $ # # Insertar los nuevos cambios al principio de esta lista de cambios. # +2007-04-21 Toni Garc�a <zo...@ir...> 1.0.beta3 + * Limpieza send.c + * Limpieza sintasis + 2007-04-21 Toni Garc�a <zo...@ir...> 1.0.beta2 * Eliminar restos soporte P09 * Nueva estructura Invite Index: ircd-ircdev/include/ddb.h diff -u ircd-ircdev/include/ddb.h:1.13 ircd-ircdev/include/ddb.h:1.14 --- ircd-ircdev/include/ddb.h:1.13 Thu Apr 19 15:53:46 2007 +++ ircd-ircdev/include/ddb.h Sat Apr 21 14:17:22 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Distributed DataBases structures, macros and functions. - * @version $Id: ddb.h,v 1.13 2007/04/19 22:53:46 zolty Exp $ + * @version $Id: ddb.h,v 1.14 2007/04/21 21:17:22 zolty Exp $ */ #ifndef INCLUDED_ddb_h #define INCLUDED_ddb_h @@ -148,7 +148,7 @@ extern struct Ddb *ddb_find_key(unsigned char table, char *key); extern char *ddb_get_botname(char *botname); -extern void ddb_splithubs_butone(struct Client *cptr, char *exitmsg); +extern void ddb_splithubs(struct Client *cptr, char *exitmsg); extern void ddb_reload(void); extern void ddb_die(const char *pattern, ...); extern void ddb_report_stats(struct Client* to, const struct StatDesc* sd, char* param); Index: ircd-ircdev/include/ircd.h diff -u ircd-ircdev/include/ircd.h:1.5 ircd-ircdev/include/ircd.h:1.6 --- ircd-ircdev/include/ircd.h:1.5 Thu Apr 19 15:53:46 2007 +++ ircd-ircdev/include/ircd.h Sat Apr 21 14:17:22 2007 @@ -21,7 +21,7 @@ */ /** @file ircd.h * @brief Global data for the daemon. - * @version $Id: ircd.h,v 1.5 2007/04/19 22:53:46 zolty Exp $ + * @version $Id: ircd.h,v 1.6 2007/04/21 21:17:22 zolty Exp $ */ #ifndef INCLUDED_ircd_h #define INCLUDED_ircd_h @@ -77,6 +77,8 @@ extern char* configfile; extern int debuglevel; extern char* debugmode; -extern int running; +extern int running; +extern int maxconnections; +extern int maxclients; #endif /* INCLUDED_ircd_h */ Index: ircd-ircdev/include/list.h diff -u ircd-ircdev/include/list.h:1.7 ircd-ircdev/include/list.h:1.8 --- ircd-ircdev/include/list.h:1.7 Thu Apr 19 15:53:46 2007 +++ ircd-ircdev/include/list.h Sat Apr 21 14:17:22 2007 @@ -21,7 +21,7 @@ */ /** @file list.h * @brief Singly and doubly linked list manipulation interface. - * @version $Id: list.h,v 1.7 2007/04/19 22:53:46 zolty Exp $ + * @version $Id: list.h,v 1.8 2007/04/21 21:17:22 zolty Exp $ */ #ifndef INCLUDED_list_h #define INCLUDED_list_h @@ -71,7 +71,7 @@ extern void free_link(struct SLink *lp); extern struct SLink *make_link(void); -extern void init_list(void); +extern void init_list(int maxconn); extern struct Client *make_client(struct Client *from, int status); extern void free_connection(struct Connection *con); extern void free_client(struct Client *cptr); Index: ircd-ircdev/include/msgq.h diff -u ircd-ircdev/include/msgq.h:1.6 ircd-ircdev/include/msgq.h:1.7 --- ircd-ircdev/include/msgq.h:1.6 Thu Apr 19 15:53:46 2007 +++ ircd-ircdev/include/msgq.h Sat Apr 21 14:17:22 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Outbound message queue interface and declarations. - * @version $Id: msgq.h,v 1.6 2007/04/19 22:53:46 zolty Exp $ + * @version $Id: msgq.h,v 1.7 2007/04/21 21:17:22 zolty Exp $ */ #ifndef INCLUDED_msgq_h #define INCLUDED_msgq_h @@ -50,6 +50,7 @@ struct MsgQList { struct Msg *head; /**< First Msg in queue list */ struct Msg *tail; /**< Last Msg in queue list */ + unsigned int sent; /**< Bytes in *head that have already been sent */ }; /** Entire two-priority message queue for a destination. */ Index: ircd-ircdev/include/patchlevel.h diff -u ircd-ircdev/include/patchlevel.h:1.50 ircd-ircdev/include/patchlevel.h:1.51 --- ircd-ircdev/include/patchlevel.h:1.50 Sat Apr 21 09:20:18 2007 +++ ircd-ircdev/include/patchlevel.h Sat Apr 21 14:17:22 2007 @@ -17,10 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: patchlevel.h,v 1.50 2007/04/21 16:20:18 zolty Exp $ + * $Id: patchlevel.h,v 1.51 2007/04/21 21:17:22 zolty Exp $ * */ -#define PATCHLEVEL "2" +#define PATCHLEVEL "3" #define RELEASE "1.0.beta" Index: ircd-ircdev/include/querycmds.h diff -u ircd-ircdev/include/querycmds.h:1.6 ircd-ircdev/include/querycmds.h:1.7 --- ircd-ircdev/include/querycmds.h:1.6 Thu Apr 19 15:53:47 2007 +++ ircd-ircdev/include/querycmds.h Sat Apr 21 14:17:22 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Interface and declarations for client counting functions. - * @version $Id: querycmds.h,v 1.6 2007/04/19 22:53:47 zolty Exp $ + * @version $Id: querycmds.h,v 1.7 2007/04/21 21:17:22 zolty Exp $ */ #ifndef INCLUDED_querycmds_h #define INCLUDED_querycmds_h @@ -106,7 +106,7 @@ { \ max_connection_count = UserStats.local_clients + UserStats.local_servers; \ if (max_connection_count % 10 == 0) \ - sendto_opmask_butone(0, SNO_OLDSNO, "Maximum connections: %d (%d clients)", \ + sendto_opmask(0, SNO_OLDSNO, "Maximum connections: %d (%d clients)", \ max_connection_count, max_client_count); \ } \ } while(0) Index: ircd-ircdev/include/s_bsd.h diff -u ircd-ircdev/include/s_bsd.h:1.8 ircd-ircdev/include/s_bsd.h:1.9 --- ircd-ircdev/include/s_bsd.h:1.8 Thu Apr 19 15:53:47 2007 +++ ircd-ircdev/include/s_bsd.h Sat Apr 21 14:17:22 2007 @@ -21,7 +21,7 @@ */ /** @file s_bsd.h * @brief Wrapper functions to avoid direct use of BSD APIs. - * @version $Id: s_bsd.h,v 1.8 2007/04/19 22:53:47 zolty Exp $ + * @version $Id: s_bsd.h,v 1.9 2007/04/21 21:17:22 zolty Exp $ */ #ifndef INCLUDED_s_bsd_h #define INCLUDED_s_bsd_h @@ -71,8 +71,8 @@ extern const char* const TOS_ERROR_MSG; extern const char* const REGISTER_ERROR_MSG; -extern int HighestFd; -extern struct Client* LocalClientArray[MAXCONNECTIONS]; +extern int HighestFd; +extern struct Client** LocalClientArray; extern struct irc_sockaddr VirtualHost_v4; extern struct irc_sockaddr VirtualHost_v6; @@ -87,7 +87,7 @@ extern int read_message(time_t delay); extern void init_server_identity(void); extern void close_connections(int close_stderr); -extern int init_connection_limits(void); +extern int init_connection_limits(int maxconn); extern void update_write(struct Client* cptr); #endif /* INCLUDED_s_bsd_h */ Index: ircd-ircdev/include/send.h diff -u ircd-ircdev/include/send.h:1.9 ircd-ircdev/include/send.h:1.10 --- ircd-ircdev/include/send.h:1.9 Thu Apr 19 15:53:47 2007 +++ ircd-ircdev/include/send.h Sat Apr 21 14:17:22 2007 @@ -21,7 +21,7 @@ */ /** @file send.h * @brief Send messages to certain targets. - * @version $Id: send.h,v 1.9 2007/04/19 22:53:47 zolty Exp $ + * @version $Id: send.h,v 1.10 2007/04/21 21:17:22 zolty Exp $ */ #ifndef INCLUDED_send_h #define INCLUDED_send_h @@ -74,90 +74,69 @@ const char *pattern, ...); /* Send command to servers by flags except one */ -extern void sendcmdto_flag_serv_butone(struct Client *from, const char *cmd, - const char *tok, struct Client *one, - int require, int forbid, - const char *pattern, ...); +extern void sendcmdto_flag_serv(struct Client *from, const char *cmd, + const char *tok, struct Client *one, + int require, int forbid, + const char *pattern, ...); /* Send command to all servers except one */ -extern void sendcmdto_serv_butone(struct Client *from, const char *cmd, - const char *tok, struct Client *one, - const char *pattern, ...); +extern void sendcmdto_serv(struct Client *from, const char *cmd, + const char *tok, struct Client *one, + const char *pattern, ...); /* Send command to all channels user is on */ -extern void sendcmdto_common_channels_butone(struct Client *from, - const char *cmd, - const char *tok, - struct Client *one, - const char *pattern, ...); +extern void sendcmdto_common_channels(struct Client *from, + const char *cmd, + const char *tok, + struct Client *one, + const char *pattern, ...); #if defined(DDB) /* Send bot command to all channel users on this server */ -extern void sendcmdbotto_channel_butserv_butone(const char *botmode, - const char *cmd, - const char *tok, - struct Channel *to, - struct Client *one, - unsigned int skip, - const char *pattern, ...); +extern void sendcmdbotto_channel_butserv(const char *botmode, + const char *cmd, + const char *tok, + struct Channel *to, + struct Client *one, + unsigned int skip, + const char *pattern, ...); #endif -/* Send command to all channel users on this server */ -extern void sendcmdto_channel_butserv_butone(struct Client *from, - const char *cmd, - const char *tok, - struct Channel *to, - struct Client *one, - unsigned int skip, - const char *pattern, ...); - -/* Send command to all servers interested in a channel */ -extern void sendcmdto_channel_servers_butone(struct Client *from, - const char *cmd, - const char *tok, - struct Channel *to, - struct Client *one, - unsigned int skip, - const char *pattern, ...); - /* Send command to all interested channel users */ -extern void sendcmdto_channel_butone(struct Client *from, const char *cmd, - const char *tok, struct Channel *to, - struct Client *one, unsigned int skip, - const char *pattern, ...); +extern void sendcmdto_channel(struct Client *from, const char *cmd, + const char *tok, struct Channel *to, + struct Client *one, unsigned int skip, + const char *pattern, ...); #define SKIP_DEAF 0x01 /**< skip users that are +d */ #define SKIP_BURST 0x02 /**< skip users that are bursting */ #define SKIP_NONOPS 0x04 /**< skip users that aren't chanops */ #define SKIP_NONVOICES 0x08 /**< skip users that aren't voiced (includes chanops) */ +#define SKIP_SERVERS 0x10 /**< skip server links */ /* Send command to all users having a particular flag set */ -extern void sendwallto_group_butone(struct Client *from, int type, - struct Client *one, const char *pattern, - ...); +extern void sendwallto_group(struct Client *from, int type, + struct Client *one, const char *pattern, + ...); #define WALL_DESYNCH 1 /**< send as a DESYNCH message */ #define WALL_WALLOPS 2 /**< send to all +w opers */ #define WALL_WALLUSERS 3 /**< send to all +w users */ /* Send command to all matching clients */ -extern void sendcmdto_match_butone(struct Client *from, const char *cmd, - const char *tok, const char *to, - struct Client *one, unsigned int who, - const char *pattern, ...); +extern void sendcmdto_match(struct Client *from, const char *cmd, + const char *tok, const char *to, + struct Client *one, unsigned int who, + const char *pattern, ...); /* Send server notice to opers but one--one can be NULL */ -extern void sendto_opmask_butone(struct Client *one, unsigned int mask, - const char *pattern, ...); +extern void sendto_opmask(struct Client *one, unsigned int mask, + const char *pattern, ...); /* Same as above, but rate limited */ -extern void sendto_opmask_butone_ratelimited(struct Client *one, - unsigned int mask, time_t *rate, - const char *pattern, ...); - -/* Same as above, but with variable argument list */ -extern void vsendto_opmask_butone(struct Client *one, unsigned int mask, - const char *pattern, va_list vl); +extern void sendto_opmask_ratelimited(struct Client *one, + unsigned int mask, time_t *rate, + const char *pattern, ...); #endif /* INCLUDED_send_h */ Index: ircd-ircdev/include/sys.h diff -u ircd-ircdev/include/sys.h:1.6 ircd-ircdev/include/sys.h:removed --- ircd-ircdev/include/sys.h:1.6 Thu Apr 19 15:53:47 2007 +++ ircd-ircdev/include/sys.h Sat Apr 21 14:17:34 2007 @@ -1,34 +0,0 @@ -/* - * IRC-Dev IRCD - An advanced and innovative IRC Daemon, include/sys.h - * - * Copyright (C) 2002-2007 IRC-Dev Development Team <de...@ir...> - * Copyright (C) 1990 Jarkko Oikarinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: sys.h,v 1.6 2007/04/19 22:53:47 zolty Exp $ - * - */ -#ifndef INCLUDED_sys_h -#define INCLUDED_sys_h - -/* - * safety margin so we can always have one spare fd, for motd/authd or - * whatever else. -24 allows "safety" margin of 10 listen ports, 8 servers - * and space reserved for logfiles, DNS sockets and identd sockets etc. - */ -#define MAXCLIENTS (MAXCONNECTIONS-24) - -#endif /* INCLUDED_sys_h */ Index: ircd-ircdev/ircd/Makefile.in diff -u ircd-ircdev/ircd/Makefile.in:1.31 ircd-ircdev/ircd/Makefile.in:1.32 --- ircd-ircdev/ircd/Makefile.in:1.31 Thu Apr 19 15:53:47 2007 +++ ircd-ircdev/ircd/Makefile.in Sat Apr 21 14:17:22 2007 @@ -18,7 +18,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA -# $Id: Makefile.in,v 1.31 2007/04/19 22:53:47 zolty Exp $ +# $Id: Makefile.in,v 1.32 2007/04/21 21:17:22 zolty Exp $ #### Start of system configuration section. #### @@ -423,7 +423,7 @@ ../include/numnicks.h ../include/querycmds.h ../include/ircd_features.h \ ../include/s_bsd.h ../include/s_conf.h ../include/s_debug.h \ ../include/s_misc.h ../include/s_user.h ../include/send.h \ - ../include/struct.h ../include/sys.h ../include/whowas.h + ../include/struct.h ../include/whowas.h class.o: class.c ../config.h ../include/class.h ../include/client.h \ ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ ../include/ircd_events.h ../include/ircd_handler.h ../include/res.h \ @@ -447,9 +447,10 @@ ../include/ircd_alloc.h ../include/ircd_chattr.h \ ../include/ircd_string.h ../include/match.h ../include/s_bsd.h \ ../include/s_debug.h ../include/struct.h -dbuf.o: dbuf.c ../config.h ../include/dbuf.h ../include/ircd_alloc.h \ +dbuf.o: dbuf.c ../config.h ../include/dbuf.h ../include/ircd.h \ + ../include/struct.h ../include/ircd_defs.h ../include/ircd_alloc.h \ ../include/ircd_chattr.h ../include/ircd_features.h \ - ../include/ircd_log.h ../include/send.h ../include/sys.h + ../include/ircd_log.h ../include/send.h destruct_event.o: destruct_event.c ../config.h ../include/channel.h \ ../include/ircd_defs.h ../include/res.h ../include/s_debug.h \ ../include/ircd_alloc.h ../include/ircd.h ../include/struct.h \ @@ -476,26 +477,7 @@ ../include/ircd_log.h ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd.h ../include/struct.h ../include/match.h \ ../include/msg.h ../include/numeric.h ../include/random.h \ - ../include/send.h ../include/struct.h ../include/sys.h \ - ../include/watch.h -ircd.o: ircd.c ../config.h ../include/ircd.h ../include/struct.h \ - ../include/ircd_defs.h ../include/IPcheck.h ../include/class.h \ - ../include/client.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/res.h \ - ../include/capab.h ../include/client.h ../include/crule.h \ - ../include/ddb.h ../config.h ../include/destruct_event.h \ - ../include/channel.h ../include/hash.h ../include/ircd_alloc.h \ - ../include/ircd_crypt.h ../include/ircd_events.h \ - ../include/ircd_features.h ../include/ircd_log.h \ - ../include/ircd_reply.h ../include/ircd_signal.h \ - ../include/ircd_string.h ../include/ircd_chattr.h ../include/jupe.h \ - ../include/list.h ../include/match.h ../include/motd.h ../include/msg.h \ - ../include/numeric.h ../include/numnicks.h ../include/opercmds.h \ - ../include/parse.h ../include/res.h ../include/s_auth.h \ - ../include/s_bsd.h ../include/s_conf.h ../include/s_debug.h \ - ../include/s_misc.h ../include/s_stats.h ../include/send.h \ - ../include/sys.h ../include/uping.h ../include/userload.h \ - ../include/version.h ../include/whowas.h + ../include/send.h ../include/struct.h ../include/watch.h ircd_alloc.o: ircd_alloc.c ../config.h ../include/ircd_alloc.h \ ../include/ircd_log.h ../include/ircd_string.h ../include/ircd_chattr.h \ ../include/s_debug.h ../include/ircd_defs.h @@ -531,8 +513,7 @@ ../include/msg.h ../include/numeric.h ../include/numnicks.h \ ../include/random.h ../include/s_bsd.h ../include/s_debug.h \ ../include/s_misc.h ../include/s_stats.h ../include/s_user.h \ - ../include/send.h ../include/struct.h ../include/sys.h \ - ../include/whowas.h + ../include/send.h ../include/struct.h ../include/whowas.h ircd_log.o: ircd_log.c ../config.h ../include/ircd_log.h \ ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \ ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ @@ -568,8 +549,8 @@ ../include/ircd_snprintf.h ../include/ircd.h ../include/struct.h \ ../include/numeric.h ../include/fileio.h ../include/random.h \ ../include/s_bsd.h ../include/s_debug.h ../include/s_stats.h \ - ../include/ircd_features.h ../include/send.h ../include/sys.h \ - ../include/res.h ../include/ircd_reslib.h + ../include/ircd_features.h ../include/send.h ../include/res.h \ + ../include/ircd_reslib.h ircd_reslib.o: ircd_reslib.c ../include/ircd.h ../include/struct.h \ ../include/ircd_defs.h ../include/res.h ../config.h \ ../include/ircd_reslib.h ../include/ircd_defs.h ../include/fileio.h \ @@ -597,8 +578,7 @@ ../include/ircd_log.h ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/match.h ../include/msg.h \ ../include/numeric.h ../include/numnicks.h ../include/s_bsd.h \ - ../include/s_misc.h ../include/send.h ../include/struct.h \ - ../include/sys.h + ../include/s_misc.h ../include/send.h ../include/struct.h lex.yy.o: lex.yy.c ../config.h ../include/ircd.h ../include/struct.h \ ../include/ircd_defs.h ../include/ircd_alloc.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/s_debug.h y.tab.h @@ -613,18 +593,6 @@ ../include/s_bsd.h ../include/s_conf.h ../include/client.h \ ../include/s_debug.h ../include/s_misc.h ../include/s_user.h \ ../include/send.h ../include/struct.h ../include/whowas.h -listener.o: listener.c ../config.h ../include/listener.h \ - ../include/ircd_defs.h ../include/ircd_events.h ../include/res.h \ - ../include/client.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_handler.h ../include/capab.h ../include/ircd.h \ - ../include/struct.h ../include/ircd_alloc.h ../include/ircd_events.h \ - ../include/ircd_features.h ../include/ircd_log.h \ - ../include/ircd_osdep.h ../include/ircd_reply.h \ - ../include/ircd_snprintf.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/match.h ../include/numeric.h \ - ../include/s_bsd.h ../include/s_conf.h ../include/client.h \ - ../include/s_misc.h ../include/s_stats.h ../include/send.h \ - ../include/sys.h m_admin.o: m_admin.c ../config.h ../include/client.h \ ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ ../include/ircd_events.h ../include/ircd_handler.h ../include/res.h \ @@ -800,16 +768,6 @@ ../include/ircd_log.h ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/msgq.h ../include/numeric.h \ ../include/send.h -m_join.o: m_join.c ../config.h ../include/channel.h \ - ../include/ircd_defs.h ../include/res.h ../include/client.h \ - ../include/dbuf.h ../include/msgq.h ../include/ircd_events.h \ - ../include/ircd_handler.h ../include/capab.h ../include/ddb.h \ - ../config.h ../include/client.h ../include/gline.h ../include/hash.h \ - ../include/ircd.h ../include/struct.h ../include/ircd_chattr.h \ - ../include/ircd_features.h ../include/ircd_log.h \ - ../include/ircd_reply.h ../include/ircd_string.h ../include/msg.h \ - ../include/numeric.h ../include/numnicks.h ../include/s_debug.h \ - ../include/s_user.h ../include/send.h ../include/sys.h m_jupe.o: m_jupe.c ../config.h ../include/client.h ../include/ircd_defs.h \ ../include/dbuf.h ../include/msgq.h ../include/ircd_events.h \ ../include/ircd_handler.h ../include/res.h ../include/capab.h \ @@ -909,7 +867,7 @@ ../include/ircd_log.h ../include/ircd_reply.h ../include/ircd_string.h \ ../include/msg.h ../include/numeric.h ../include/numnicks.h \ ../include/s_debug.h ../include/s_misc.h ../include/s_user.h \ - ../include/send.h ../include/sys.h + ../include/send.h m_notice.o: m_notice.c ../config.h ../include/client.h \ ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ ../include/ircd_events.h ../include/ircd_handler.h ../include/res.h \ @@ -1119,8 +1077,9 @@ ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ ../include/ircd_events.h ../include/ircd_handler.h ../include/res.h \ ../include/capab.h ../include/client.h ../include/hash.h \ - ../include/ircd.h ../include/struct.h ../include/ircd_features.h \ - ../include/ircd_log.h ../include/ircd_reply.h ../include/ircd_string.h \ + ../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \ + ../include/ircd_features.h ../include/ircd_log.h \ + ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/match.h ../include/msg.h \ ../include/numeric.h ../include/numnicks.h ../include/s_bsd.h \ ../include/s_conf.h ../include/s_user.h ../include/send.h \ @@ -1275,9 +1234,6 @@ ../include/ircd_string.h ../include/listener.h ../include/match.h \ ../include/msg.h ../include/numeric.h ../include/numnicks.h \ ../include/s_conf.h ../include/send.h ../include/struct.h -os_generic.o: os_generic.c ../config.h ../include/ircd_osdep.h \ - ../include/ircd_log.h ../include/msgq.h ../include/ircd_defs.h \ - ../include/res.h ../include/s_bsd.h ../include/sys.h packet.o: packet.c ../config.h ../include/packet.h ../include/client.h \ ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ ../include/ircd_events.h ../include/ircd_handler.h ../include/res.h \ @@ -1297,7 +1253,7 @@ ../include/s_bsd.h ../include/s_conf.h ../include/client.h \ ../include/s_debug.h ../include/s_misc.h ../include/s_numeric.h \ ../include/s_user.h ../include/send.h ../include/struct.h \ - ../include/sys.h ../include/whowas.h + ../include/whowas.h querycmds.o: querycmds.c ../config.h ../include/querycmds.h \ ../include/ircd_features.h random.o: random.c ../config.h ../include/random.h ../include/client.h \ @@ -1305,50 +1261,6 @@ ../include/ircd_events.h ../include/ircd_handler.h ../include/res.h \ ../include/capab.h ../include/ircd_log.h ../include/ircd_md5.h \ ../include/ircd_reply.h ../include/send.h -s_auth.o: s_auth.c ../config.h ../include/s_auth.h \ - ../include/ircd_events.h ../include/client.h ../include/ircd_defs.h \ - ../include/dbuf.h ../include/msgq.h ../include/ircd_handler.h \ - ../include/res.h ../include/capab.h ../include/IPcheck.h \ - ../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \ - ../include/ircd_chattr.h ../include/ircd_events.h \ - ../include/ircd_features.h ../include/ircd_log.h \ - ../include/ircd_osdep.h ../include/ircd_snprintf.h \ - ../include/ircd_string.h ../include/list.h ../include/numeric.h \ - ../include/querycmds.h ../include/ircd_features.h ../include/res.h \ - ../include/s_bsd.h ../include/s_debug.h ../include/s_misc.h \ - ../include/send.h ../include/struct.h ../include/sys.h -s_bsd.o: s_bsd.c ../config.h ../include/s_bsd.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/res.h \ - ../include/capab.h ../include/IPcheck.h ../include/channel.h \ - ../include/class.h ../include/client.h ../include/ddb.h ../config.h \ - ../include/hash.h ../include/ircd_alloc.h ../include/ircd_log.h \ - ../include/ircd_features.h ../include/ircd_osdep.h \ - ../include/ircd_reply.h ../include/ircd_snprintf.h \ - ../include/ircd_string.h ../include/ircd_chattr.h ../include/ircd.h \ - ../include/struct.h ../include/list.h ../include/listener.h \ - ../include/msg.h ../include/msgq.h ../include/numeric.h \ - ../include/numnicks.h ../include/packet.h ../include/parse.h \ - ../include/querycmds.h ../include/ircd_features.h ../include/res.h \ - ../include/s_auth.h ../include/s_conf.h ../include/s_debug.h \ - ../include/s_misc.h ../include/s_user.h ../include/send.h \ - ../include/struct.h ../include/sys.h ../include/uping.h \ - ../include/version.h -s_conf.o: s_conf.c ../config.h ../include/s_conf.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/res.h \ - ../include/capab.h ../include/IPcheck.h ../include/class.h \ - ../include/client.h ../include/crule.h ../include/ddb.h ../config.h \ - ../include/ircd_features.h ../include/fileio.h ../include/gline.h \ - ../include/hash.h ../include/ircd.h ../include/struct.h \ - ../include/ircd_alloc.h ../include/ircd_auth.h ../include/ircd_chattr.h \ - ../include/ircd_log.h ../include/ircd_reply.h \ - ../include/ircd_snprintf.h ../include/ircd_string.h ../include/list.h \ - ../include/listener.h ../include/match.h ../include/motd.h \ - ../include/msg.h ../include/numeric.h ../include/numnicks.h \ - ../include/opercmds.h ../include/parse.h ../include/res.h \ - ../include/s_bsd.h ../include/s_debug.h ../include/s_misc.h \ - ../include/send.h ../include/struct.h ../include/sys.h s_debug.o: s_debug.c ../config.h ../include/s_debug.h \ ../include/ircd_defs.h ../include/channel.h ../include/res.h \ ../include/class.h ../include/client.h ../include/dbuf.h \ @@ -1362,7 +1274,7 @@ ../include/numeric.h ../include/numnicks.h ../include/res.h \ ../include/s_bsd.h ../include/s_conf.h ../include/s_stats.h \ ../include/s_user.h ../include/send.h ../include/struct.h \ - ../include/sys.h ../include/watch.h ../include/whowas.h + ../include/watch.h ../include/whowas.h s_err.o: s_err.c ../config.h ../include/numeric.h ../include/ircd_log.h \ ../include/s_debug.h ../include/ircd_defs.h s_misc.o: s_misc.c ../config.h ../include/s_misc.h ../include/IPcheck.h \ @@ -1379,8 +1291,8 @@ ../include/ircd_features.h ../include/res.h ../include/s_bsd.h \ ../include/s_conf.h ../include/client.h ../include/s_debug.h \ ../include/s_stats.h ../include/s_user.h ../include/send.h \ - ../include/struct.h ../include/sys.h ../include/uping.h \ - ../include/userload.h ../include/watch.h + ../include/struct.h ../include/uping.h ../include/userload.h \ + ../include/watch.h s_numeric.o: s_numeric.c ../config.h ../include/s_numeric.h \ ../include/channel.h ../include/ircd_defs.h ../include/res.h \ ../include/client.h ../include/dbuf.h ../include/msgq.h \ @@ -1402,7 +1314,7 @@ ../include/querycmds.h ../include/ircd_features.h ../include/s_bsd.h \ ../include/s_conf.h ../include/s_debug.h ../include/s_misc.h \ ../include/s_user.h ../include/send.h ../include/struct.h \ - ../include/sys.h ../include/userload.h + ../include/userload.h s_stats.o: s_stats.c ../config.h ../include/s_stats.h \ ../include/ircd_features.h ../include/class.h ../include/client.h \ ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ @@ -1434,9 +1346,8 @@ ../include/querycmds.h ../include/ircd_features.h ../include/random.h \ ../include/s_bsd.h ../include/s_conf.h ../include/s_debug.h \ ../include/s_misc.h ../include/s_serv.h ../include/send.h \ - ../include/struct.h ../include/sys.h ../include/userload.h \ - ../include/version.h ../include/watch.h ../include/whowas.h \ - ../include/handlers.h + ../include/struct.h ../include/userload.h ../include/version.h \ + ../include/watch.h ../include/whowas.h ../include/handlers.h send.o: send.c ../config.h ../include/send.h ../include/channel.h \ ../include/ircd_defs.h ../include/res.h ../include/class.h \ ../include/client.h ../include/dbuf.h ../include/msgq.h \ @@ -1447,7 +1358,7 @@ ../include/ircd_chattr.h ../include/list.h ../include/match.h \ ../include/msg.h ../include/numnicks.h ../include/parse.h \ ../include/s_bsd.h ../include/s_debug.h ../include/s_misc.h \ - ../include/s_user.h ../include/struct.h ../include/sys.h + ../include/s_user.h ../include/struct.h uping.o: uping.c ../config.h ../include/uping.h ../include/ircd_defs.h \ ../include/ircd_events.h ../include/res.h ../include/client.h \ ../include/dbuf.h ../include/msgq.h ../include/ircd_handler.h \ @@ -1457,16 +1368,14 @@ ../include/ircd_chattr.h ../include/match.h ../include/msg.h \ ../include/numeric.h ../include/numnicks.h ../include/s_bsd.h \ ../include/s_conf.h ../include/client.h ../include/s_debug.h \ - ../include/s_misc.h ../include/s_user.h ../include/send.h \ - ../include/sys.h + ../include/s_misc.h ../include/s_user.h ../include/send.h userload.o: userload.c ../config.h ../include/userload.h \ ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \ ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ ../include/res.h ../include/capab.h ../include/ircd.h \ ../include/struct.h ../include/msg.h ../include/numnicks.h \ ../include/querycmds.h ../include/ircd_features.h ../include/s_misc.h \ - ../include/s_stats.h ../include/send.h ../include/struct.h \ - ../include/sys.h + ../include/s_stats.h ../include/send.h ../include/struct.h watch.o: watch.c ../config.h ../include/watch.h ../include/client.h \ ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ ../include/ircd_events.h ../include/ircd_handler.h ../include/res.h \ @@ -1483,21 +1392,7 @@ ../include/ircd_features.h ../include/ircd_log.h \ ../include/ircd_string.h ../include/list.h ../include/numeric.h \ ../include/s_debug.h ../include/s_misc.h ../include/s_user.h \ - ../include/send.h ../include/struct.h ../include/sys.h ../include/msg.h -y.tab.o: y.tab.c ../config.h ../include/s_conf.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/res.h \ - ../include/capab.h ../include/class.h ../include/client.h \ - ../include/crule.h ../include/ircd_features.h ../include/fileio.h \ - ../include/gline.h ../include/hash.h ../include/ircd.h \ - ../include/struct.h ../include/ircd_alloc.h ../include/ircd_auth.h \ - ../include/ircd_chattr.h ../include/ircd_log.h ../include/ircd_reply.h \ - ../include/ircd_snprintf.h ../include/ircd_string.h ../include/list.h \ - ../include/listener.h ../include/match.h ../include/motd.h \ - ../include/numeric.h ../include/numnicks.h ../include/opercmds.h \ - ../include/parse.h ../include/res.h ../include/s_bsd.h \ - ../include/s_debug.h ../include/s_misc.h ../include/send.h \ - ../include/struct.h ../include/sys.h + ../include/send.h ../include/struct.h ../include/msg.h m_account.o: m_account.c ../config.h ../include/client.h \ ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ ../include/ircd_events.h ../include/ircd_handler.h ../include/res.h \ @@ -1560,26 +1455,14 @@ ../include/ircd_log.h ../include/ircd_reply.h ../include/msg.h \ ../include/numnicks.h ../include/s_misc.h ../include/s_user.h \ ../include/send.h -m_svsnick.o: m_svsnick.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/res.h \ - ../include/capab.h ../include/ddb.h ../config.h ../include/client.h \ - ../include/hash.h ../include/ircd.h ../include/struct.h \ - ../include/ircd_features.h ../include/ircd_log.h \ - ../include/ircd_snprintf.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/ircd_tea.h ../include/msg.h \ - ../include/numnicks.h ../include/s_conf.h ../include/s_user.h \ - ../include/send.h ../include/sys.h -m_svsnick.o: m_svsnick.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/res.h \ - ../include/capab.h ../include/ddb.h ../config.h ../include/client.h \ - ../include/hash.h ../include/ircd.h ../include/struct.h \ - ../include/ircd_features.h ../include/ircd_log.h \ - ../include/ircd_snprintf.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/ircd_tea.h ../include/msg.h \ - ../include/numnicks.h ../include/s_conf.h ../include/s_user.h \ - ../include/send.h ../include/sys.h +engine_devpoll.o: engine_devpoll.c ../config.h ../include/ircd_events.h \ + ../include/ircd.h ../include/struct.h ../include/ircd_defs.h \ + ../include/ircd_alloc.h ../include/ircd_features.h \ + ../include/ircd_log.h ../include/s_debug.h +engine_epoll.o: engine_epoll.c ../config.h ../include/ircd.h \ + ../include/struct.h ../include/ircd_defs.h ../include/ircd_events.h \ + ../include/ircd_alloc.h ../include/ircd_features.h \ + ../include/ircd_log.h ../include/s_debug.h engine_poll.o: engine_poll.c ../config.h ../include/ircd_events.h \ ../include/ircd.h ../include/struct.h ../include/ircd_defs.h \ ../include/ircd_alloc.h ../include/ircd_log.h ../include/s_debug.h Index: ircd-ircdev/ircd/channel.c diff -u ircd-ircdev/ircd/channel.c:1.30 ircd-ircdev/ircd/channel.c:1.31 --- ircd-ircdev/ircd/channel.c:1.30 Sat Apr 21 09:20:18 2007 +++ ircd-ircdev/ircd/channel.c Sat Apr 21 14:17:22 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Channel management and maintanance - * @version $Id: channel.c,v 1.30 2007/04/21 16:20:18 zolty Exp $ + * @version $Id: channel.c,v 1.31 2007/04/21 21:17:22 zolty Exp $ */ #include "config.h" @@ -1917,33 +1917,31 @@ /* send the messages off to their destination */ if (mbuf->mb_dest & MODEBUF_DEST_HACK2) - sendto_opmask_butone(0, SNO_HACK2, "HACK(2): %s MODE %s %s%s%s%s%s%s " - "[%Tu]", - cli_name(feature_bool(FEAT_HIS_SNOTICES) ? - mbuf->mb_source : app_source), - mbuf->mb_channel->chname, - rembuf_i ? "-" : "", rembuf, addbuf_i ? "+" : "", - addbuf, remstr, addstr, - mbuf->mb_channel->creationtime); + sendto_opmask(0, SNO_HACK2, "HACK(2): %s MODE %s %s%s%s%s%s%s [%Tu]", + cli_name(feature_bool(FEAT_HIS_SNOTICES) ? + mbuf->mb_source : app_source), + mbuf->mb_channel->chname, + rembuf_i ? "-" : "", rembuf, addbuf_i ? "+" : "", + addbuf, remstr, addstr, + mbuf->mb_channel->creationtime); if (mbuf->mb_dest & MODEBUF_DEST_HACK3) - sendto_opmask_butone(0, SNO_HACK3, "BOUNCE or HACK(3): %s MODE %s " - "%s%s%s%s%s%s [%Tu]", - cli_name(feature_bool(FEAT_HIS_SNOTICES) ? - mbuf->mb_source : app_source), - mbuf->mb_channel->chname, rembuf_i ? "-" : "", - rembuf, addbuf_i ? "+" : "", addbuf, remstr, addstr, - mbuf->mb_channel->creationtime); + sendto_opmask(0, SNO_HACK3, "BOUNCE or HACK(3): %s MODE %s " + "%s%s%s%s%s%s [%Tu]", + cli_name(feature_bool(FEAT_HIS_SNOTICES) ? + mbuf->mb_source : app_source), + mbuf->mb_channel->chname, rembuf_i ? "-" : "", + rembuf, addbuf_i ? "+" : "", addbuf, remstr, addstr, + mbuf->mb_channel->creationtime); if (mbuf->mb_dest & MODEBUF_DEST_HACK4) - sendto_opmask_butone(0, SNO_HACK4, "HACK(4): %s MODE %s %s%s%s%s%s%s " - "[%Tu]", - cli_name(feature_bool(FEAT_HIS_SNOTICES) ? - mbuf->mb_source : app_source), - mbuf->mb_channel->chname, - rembuf_i ? "-" : "", rembuf, addbuf_i ? "+" : "", - addbuf, remstr, addstr, - mbuf->mb_channel->creationtime); + sendto_opmask(0, SNO_HACK4, "HACK(4): %s MODE %s %s%s%s%s%s%s [%Tu]", + cli_name(feature_bool(FEAT_HIS_SNOTICES) ? + mbuf->mb_source : app_source), + mbuf->mb_channel->chname, + rembuf_i ? "-" : "", rembuf, addbuf_i ? "+" : "", + addbuf, remstr, addstr, + mbuf->mb_channel->creationtime); if (mbuf->mb_dest & MODEBUF_DEST_LOG) log_write(LS_OPERMODE, L_INFO, LOG_NOSNOTICE, @@ -1955,17 +1953,23 @@ { #if defined(DDB) if (mbuf->mb_dest & MODEBUF_DEST_BOTMODE) - sendcmdbotto_channel_butserv_butone(ddb_get_botname(mbuf->mb_botname), - CMD_MODE, mbuf->mb_channel, NULL, 0, - "%H %s%s%s%s%s%s", mbuf->mb_channel, - rembuf_i ? "-" : "", rembuf, - addbuf_i ? "+" : "", addbuf, remstr, addstr); + sendcmdbotto_channel(ddb_get_botname(mbuf->mb_botname), + CMD_MODE, mbuf->mb_channel, NULL, 0, + "%H %s%s%s%s%s%s", mbuf->mb_channel, + rembuf_i ? "-" : "", rembuf, + addbuf_i ? "+" : "", addbuf, remstr, addstr); else #endif /* defined(DDB) */ - sendcmdto_channel_butserv_butone(app_source, CMD_MODE, mbuf->mb_channel, NULL, 0, - "%H %s%s%s%s%s%s", mbuf->mb_channel, - rembuf_i ? "-" : "", rembuf, - addbuf_i ? "+" : "", addbuf, remstr, addstr); + sendcmdto_channel(app_source, CMD_MODE, mbuf->mb_channel, NULL, SKIP_SERVERS, + "%H %s%s%s%s%s%s%s%s", mbuf->mb_channel, +/* rembuf_i || rembuf_local_i ? "-" : "", + rembuf, rembuf_local, + addbuf_i || addbuf_local_i ? "+" : "", + addbuf, addbuf_local, +*/ + rembuf_i ? "-" : "", rembuf, + addbuf_i ? "+" : "", addbuf, + remstr, addstr); } } @@ -1981,7 +1985,7 @@ * limit is supressed if we're removing it; we have to figure out which * direction is the direction for it to be removed, though... */ - limitdel |= (mbuf->mb_dest & MODEBUF_DEST_HACK2) ? MODE_DEL : MODE_ADD; + limitdel |= (mbuf->mb_dest & MODEBUF_DEST_BOUNCE) ? MODE_DEL : MODE_ADD; for (i = 0; i < mbuf->mb_count; i++) { if (MB_TYPE(mbuf, i) & MODE_SAVE) @@ -2045,15 +2049,15 @@ if (mbuf->mb_dest & MODEBUF_DEST_OPMODE) { /* If OPMODE was set, we're propagating the mode as an OPMODE message */ - sendcmdto_serv_butone(mbuf->mb_source, CMD_OPMODE, mbuf->mb_connect, - "%H %s%s%s%s%s%s", mbuf->mb_channel, - rembuf_i ? "-" : "", rembuf, addbuf_i ? "+" : "", - addbuf, remstr, addstr); + sendcmdto_serv(mbuf->mb_source, CMD_OPMODE, mbuf->mb_connect, + "%H %s%s%s%s%s%s", mbuf->mb_channel, + rembuf_i ? "-" : "", rembuf, addbuf_i ? "+" : "", + addbuf, remstr, addstr); } else if (mbuf->mb_dest & MODEBUF_DEST_BOUNCE) { /* - * If HACK2 was set, we're bouncing; we send the MODE back to the - * connection we got it from with the senses reversed and a TS of 0; - * origin is us + * If HACK2 was set, we're bouncing; we send the MODE back to + * the connection we got it from with the senses reversed and + * the proper TS; origin is us */ sendcmdto_one(&me, CMD_MODE, mbuf->mb_connect, "%H %s%s%s%s%s%s %Tu", mbuf->mb_channel, addbuf_i ? "-" : "", addbuf, @@ -2061,30 +2065,22 @@ mbuf->mb_channel->creationtime); #if defined(DDB) } else if (mbuf->mb_dest & MODEBUF_DEST_BOTMODE) { - sendcmdto_serv_butone(mbuf->mb_source, CMD_BMODE, mbuf->mb_connect, - "%s %H %s%s%s%s%s%s %Tu", mbuf->mb_botname, mbuf->mb_channel, - rembuf_i ? "-" : "", rembuf, addbuf_i ? "+" : "", - addbuf, remstr, addstr, - (mbuf->mb_dest & MODEBUF_DEST_HACK4) ? 0 : - mbuf->mb_channel->creationtime); + sendcmdto_serv(mbuf->mb_source, CMD_BMODE, mbuf->mb_connect, + "%s %H %s%s%s%s%s%s %Tu", mbuf->mb_botname, mbuf->mb_channel, + rembuf_i ? "-" : "", rembuf, addbuf_i ? "+" : "", + addbuf, remstr, addstr, + mbuf->mb_channel->creationtime); #endif /* defined(DDB) */ } else { /* - * We're propagating a normal MODE command to the rest of the network; - * we send the actual channel TS unless this is a HACK3 or a HACK4 + * We're propagating a normal (or HACK3 or HACK4) MODE command + * to the rest of the network. We send the actual channel TS. */ - if (IsServer(mbuf->mb_source)) - sendcmdto_serv_butone(mbuf->mb_source, CMD_MODE, mbuf->mb_connect, - "%H %s%s%s%s%s%s %Tu", mbuf->mb_channel, - rembuf_i ? "-" : "", rembuf, addbuf_i ? "+" : "", - addbuf, remstr, addstr, - (mbuf->mb_dest & MODEBUF_DEST_HACK4) ? 0 : - mbuf->mb_channel->creationtime); - else - sendcmdto_serv_butone(mbuf->mb_source, CMD_MODE, mbuf->mb_connect, - "%H %s%s%s%s%s%s", mbuf->mb_channel, - rembuf_i ? "-" : "", rembuf, addbuf_i ? "+" : "", - addbuf, remstr, addstr); + sendcmdto_serv(mbuf->mb_source, CMD_MODE, mbuf->mb_connect, + "%H %s%s%s%s%s%s %Tu", mbuf->mb_channel, + rembuf_i ? "-" : "", rembuf, addbuf_i ? "+" : "", + addbuf, remstr, addstr, + mbuf->mb_channel->creationtime); } } @@ -2206,7 +2202,7 @@ assert(0 != mbuf); assert(0 != (mode & (MODE_ADD | MODE_DEL))); - if (mode == (MODE_LIMIT | MODE_DEL)) { + if (mode == (MODE_LIMIT | ((mbuf->mb_dest & MODEBUF_DEST_BOUNCE) ? MODE_ADD : MODE_DEL))) { mbuf->mb_rem |= mode; return; } @@ -2686,7 +2682,9 @@ send_reply(state->sptr, ERR_NOTMANAGER, state->chptr->chname, state->chptr->chname); } else { - send_reply(state->sptr, ERR_NOMANAGER, state->chptr->chname); + send_reply(state->sptr, ERR_NOMANAGER, state->chptr->chname, + (TStime() - state->chptr->creationtime < 172800) ? + "approximately 4-5 minutes" : "approximately 48 hours"); } return; } @@ -2731,6 +2729,13 @@ !ircd_strcmp(state->chptr->mode.upass, t_str)) return; /* no upass change */ + /* Skip if this is a burst, we have a Upass already and the new Upass is + * after the old one alphabetically */ + if ((state->flags & MODE_PARSE_BURST) && + *(state->chptr->mode.upass) && + ircd_strcmp(state->chptr->mode.upass, t_str) <= 0) + return; + if (state->flags & MODE_PARSE_BOUNCE) { if (*state->chptr->mode.upass) /* reset old upass */ modebuf_mode_string(state->mbuf, MODE_DEL | flag_p[0], @@ -2743,8 +2748,7 @@ if (state->flags & MODE_PARSE_SET) { if (state->dir == MODE_DEL) /* remove the old upass */ *state->chptr->mode.upass = '\0'; - else if (state->chptr->mode.upass[0] == '\0' - || ircd_strcmp(t_str, state->chptr->mode.upass) < 0) + else ircd_strncpy(state->chptr->mode.upass, t_str, KEYLEN); } } @@ -2778,33 +2782,49 @@ return; } - /* If a non-service user is trying to force it, refuse. */ - if (state->flags & MODE_PARSE_FORCE && MyUser(state->sptr) - && !HasPriv(state->sptr, PRIV_APASS_OPMODE)) { - send_reply(state->sptr, ERR_NOTMANAGER, state->chptr->chname, - state->chptr->chname); - return; - } - - /* Don't allow to change the Apass if the channel is older than 48 hours. */ - if (MyUser(state->sptr) - && TStime() - state->chptr->creationtime >= 172800 - && !IsAnOper(state->sptr)) { - send_reply(state->sptr, ERR_CHANSECURED, state->chptr->chname); - return; - } - - /* If they are not the channel manager, they are not allowed to change it */ - if (MyUser(state->sptr) && !(state->flags & MODE_PARSE_FORCE || IsChannelManager(state->member))) { - if (*state->chptr->mode.apass) { - send_reply(state->sptr, ERR_NOTMANAGER, state->chptr->chname, - state->chptr->chname); + if (MyUser(state->sptr)) { + if (state->flags & MODE_PARSE_FORCE) { + /* If an unprivileged oper is trying to force it, refuse. */ + if (!HasPriv(state->sptr, PRIV_APASS_OPMODE)) { + send_reply(state->sptr, ERR_NOTMANAGER, state->chptr->chname, + state->chptr->chname); + return; + } } else { - send_reply(state->sptr, ERR_NOMANAGER, state->chptr->chname); + /* If they are not the channel manager, they are not allowed to change it. */ + if (!IsChannelManager(state->member)) { + if (*state->chptr->mode.apass) { + send_reply(state->sptr, ERR_NOTMANAGER, state->chptr->chname, + state->chptr->chname); + } else { + send_reply(state->sptr, ERR_NOMANAGER, state->chptr->chname, + (TStime() - state->chptr->creationtime < 172800) ? + "approximately 4-5 minutes" : "approximately 48 hours"); + } + return; + } + /* Can't remove the Apass while Upass is still set. */ + if (state->dir == MODE_DEL && *state->chptr->mode.upass) { + send_reply(state->sptr, ERR_UPASSSET, state->chptr->chname, state->chptr->chname); + return; + } + /* Can't add an Apass if one is set, nor can one remove the wrong Apass. */ + if ((state->dir == MODE_ADD && *state->chptr->mode.apass) || + (state->dir == MODE_DEL && ircd_strcmp(state->chptr->mode.apass, t_str))) { + send_reply(state->sptr, ERR_KEYSET, state->chptr->chname); + return; + } } - return; - } + /* Forbid removing the Apass if the channel is older than 48 hours + * unless an oper is doing it. */ + if (TStime() - state->chptr->creationtime >= 172800 + && state->dir == MODE_DEL + && !IsAnOper(state->sptr)) { + send_reply(state->sptr, ERR_CHANSECURED, state->chptr->chname); + return; + } + } if (state->done & DONE_APASS) /* allow apass to be set only once */ return; state->done |= DONE_APASS; @@ -2821,24 +2841,17 @@ if (!state->mbuf) return; - if (!(state->flags & MODE_PARSE_FORCE)) { - /* can't remove the apass while upass is still set */ - if (state->dir == MODE_DEL && *state->chptr->mode.upass) { - send_reply(state->sptr, ERR_UPASSSET, state->chptr->chname, state->chptr->chname); - return; - } - /* can't add an apass if one is set, nor can one remove the wrong apass */ - if ((state->dir == MODE_ADD && *state->chptr->mode.apass) || - (state->dir == MODE_DEL && ircd_strcmp(state->chptr->mode.apass, t_str))) { - send_reply(state->sptr, ERR_KEYSET, state->chptr->chname); - return; - } - } - if (!(state->flags & MODE_PARSE_WIPEOUT) && state->dir == MODE_ADD && !ircd_strcmp(state->chptr->mode.apass, t_str)) return; /* no apass change */ + /* Skip if this is a burst, we have an Apass already and the new Apass is + * after the old one alphabetically */ + if ((state->flags & MODE_PARSE_BURST) && + *(state->chptr->mode.apass) && + ircd_strcmp(state->chptr->mode.apass, t_str) <= 0) + return; + if (state->flags & MODE_PARSE_BOUNCE) { if (*state->chptr->mode.apass) /* reset old apass */ modebuf_mode_string(state->mbuf, MODE_DEL | flag_p[0], @@ -2850,12 +2863,10 @@ if (state->flags & MODE_PARSE_SET) { if (state->dir == MODE_ADD) { /* set the new apass */ - /* Only accept the new apass if there is no current apass - * (e.g. when a user sets it) or the new one is "less" than the - * old (for resolving conflicts during burst). - */ - if (state->chptr->mode.apass[0] == '\0' - || ircd_strcmp(t_str, state->chptr->mode.apass) < 0) + /* Only accept the new apass if there is no current apass or + * this is a BURST. */ + if (state->chptr->mode.apass[0] == '\0' || + (state->flags & MODE_PARSE_BURST)) ircd_strncpy(state->chptr->mode.apass, t_str, KEYLEN); /* Make it VERY clear to the user that this is a one-time password */ if (MyUser(state->sptr)) { @@ -2863,11 +2874,20 @@ send_reply(state->sptr, RPL_APASSWARN_SECRET, state->chptr->chname, state->chptr->mode.apass); } - /* Give the channel manager level 0 ops. */ - if (!(state->flags & MODE_PARSE_FORCE) && IsChannelManager(state->member)) + /* Give the channel manager level 0 ops. + There should not be tested for IsChannelManager here because + on the local server it is impossible to set the apass if one + isn't a channel manager and remote servers might need to sync + the oplevel here: when someone creates a channel (and becomes + channel manager) during a net.break, and only sets the Apass + after the net rejoined, they will have oplevel MAXOPLEVEL on + all remote servers. */ + if (state->member) SetOpLevel(state->member, 0); } else { /* remove the old apass */ *state->chptr->mode.apass = '\0'; + /* Clear Upass so that there is never a Upass set when a zannel is burst. */ + *state->chptr->mode.upass = '\0'; if (MyUser(state->sptr)) send_reply(state->sptr, RPL_APASSWARN_CLEAR); /* Revert everyone to MAXOPLEVEL. */ @@ -2910,8 +2930,12 @@ old_ban->banstr[old_ban->nu_len] = new_ban->banstr[new_ban->nu_len] = '@'; if (res) return res; - /* Compare the addresses. */ - return !ipmask_check(&new_ban->address, &old_ban->address, old_ban->addrbits); + /* If the old ban's mask mismatches, cannot be a superset. */ + if (!ipmask_check(&new_ban->address, &old_ban->address, old_ban->addrbits)) + return 1; + /* Otherwise it depends on whether the old ban's text is a superset + * of the new. */ + return mmatch(old_ban->banstr, new_ban->banstr); } /** Add a ban from a ban list and mark bans that should be removed @@ -3239,10 +3263,10 @@ /* prevent +k users from being deopped */ if (IsChannelService(state->cli_change[i].client)) { if (state->flags & MODE_PARSE_FORCE) /* it was forced */ - sendto_opmask_butone(0, SNO_HACK4, "Deop of +k user on %H by %s", - state->chptr, - (IsServer(state->sptr) ? cli_name(state->sptr) : - cli_name((cli_user(state->sptr))->server))); + sendto_opmask(0, SNO_HACK4, "Deop of +k user on %H by %s", + state->chptr, + (IsServer(state->sptr) ? cli_name(state->sptr) : + cli_name((cli_user(state->sptr))->server))); else if (MyUser(state->sptr) && state->flags & MODE_PARSE_SET) { send_reply(state->sptr, ERR_ISCHANSERVICE, @@ -3645,7 +3669,7 @@ assert(0 != jbuf); if (!chan) { - sendcmdto_serv_butone(jbuf->jb_source, CMD_JOIN, jbuf->jb_connect, "0"); + sendcmdto_serv(jbuf->jb_source, CMD_JOIN, jbuf->jb_connect, "0"); return; } @@ -3660,9 +3684,9 @@ /* Send notification to channel */ if (!(flags & (CHFL_ZOMBIE | CHFL_DELAYED))) - sendcmdto_channel_butserv_butone(jbuf->jb_source, CMD_PART, chan, NULL, 0, - (flags & CHFL_BANNED || !jbuf->jb_comment) ? - ":%H" : "%H :%s", chan, jbuf->jb_comment); + sendcmdto_channel(jbuf->jb_source, CMD_PART, chan, NULL, SKIP_SERVERS, + (flags & CHFL_BANNED || !jbuf->jb_comment) ? + ":%H" : "%H :%s", chan, jbuf->jb_comment); else if (MyUser(jbuf->jb_source)) sendcmdto_one(jbuf->jb_source, CMD_PART, jbuf->jb_source, (flags & CHFL_BANNED || !jbuf->jb_comment) ? @@ -3695,50 +3719,48 @@ add_user_to_channel(chan, jbuf->jb_source, flags, 0); #endif - /* send notification to all servers */ + /* send JOIN notification to all servers (CREATE is sent later). */ if (jbuf->jb_type != JOINBUF_TYPE_CREATE && !IsLocalChannel(chan->chname)) { -#if defined(UNDERNET) - if (flags & CHFL_CHANOP) { - assert(oplevel == 0 || oplevel == 1); - sendcmdto_serv_butone(jbuf->jb_source, CMD_JOIN, jbuf->jb_connect, - "%u:%H %Tu", oplevel, chan, chan->creationtime); - } else -#elif defined(DDB) +#if defined(DDB) if (flags & CHFL_OWNER) - sendcmdto_serv_butone(jbuf->jb_source, CMD_JOIN, jbuf->jb_connect, - "0:%H %Tu", chan, chan->creationtime); + sendcmdto_serv(jbuf->jb_source, CMD_JOIN, jbuf->jb_connect, + "0:%H %Tu", chan, chan->creationtime); else + sendcmdto_serv(jbuf->jb_source, CMD_JOIN, jbuf->jb_connect, + "%H %Tu", chan, chan->creationtime); +#else + sendcmdto_serv(jbuf->jb_source, CMD_JOIN, jbuf->jb_connect, + "%H %Tu", chan, chan->creationtime); #endif - sendcmdto_serv_butone(jbuf->jb_source, CMD_JOIN, jbuf->jb_connect, - "%H %Tu", chan, chan->creationtime); } if (!((chan->mode.mode & MODE_DELJOINS) && !(flags & CHFL_VOICED_OR_OPPED))) { /* Send the notification to the channel */ - sendcmdto_channel_butserv_butone(jbuf->jb_source, CMD_JOIN, chan, NULL, 0, "%H", chan); + sendcmdto_channel(jbuf->jb_source, CMD_JOIN, chan, NULL, SKIP_SERVERS, + "%H", chan); /* send an op, too, if needed */ #if defined(UNDERNET) if (flags & CHFL_CHANOP && (oplevel < MAXOPLEVEL || !MyUser(jbuf->jb_source))) - sendcmdto_channel_butserv_butone((chan->mode.apass[0] ? &his : jbuf->jb_source), - CMD_MODE, chan, NULL, 0, "%H +o %C", - chan, jbuf->jb_source); + sendcmdto_channel((chan->mode.apass[0] ? &his : jbuf->jb_source), + CMD_MODE, chan, NULL, SKIP_SERVERS, + "%H +o %C", chan, jbuf->jb_source); #elif defined(DDB) if (flags & CHFL_OWNER) { char *botname = ddb_get_botname(DDB_CHANSERV); - sendcmdbotto_channel_butserv_butone(botname, CMD_MODE, chan, NULL, 0, - "%H +q %C", chan, jbuf->jb_source); + sendcmdbotto_channel(botname, CMD_MODE, chan, NULL, 0, + "%H +q %C", chan, jbuf->jb_source); } else if (flags & CHFL_CHANOP) - sendcmdto_channel_butserv_butone(&me, CMD_MODE, chan, NULL, 0, "%H +o %C", - chan, jbuf->jb_source); + sendcmdto_channel(&me, CMD_MODE, chan, NULL, SKIP_SERVERS, + "%H +o %C", chan, jbuf->jb_source); #else if (flags & CHFL_CHANOP) - sendcmdto_channel_butserv_butone(&me, CMD_MODE, chan, NULL, 0, "%H +o %C", - chan, jbuf->jb_source); + sendcmdto_channel(&me, CMD_MODE, chan, NULL, SKIP_SERVERS, + "%H +o %C", chan, jbuf->jb_source); #endif } else if (MyUser(jbuf->jb_source)) sendcmdto_one(jbuf->jb_source, CMD_JOIN, jbuf->jb_source, ":%H", chan); @@ -3795,14 +3817,14 @@ /* and send the appropriate command */ switch (jbuf->jb_type) { case JOINBUF_TYPE_CREATE: - sendcmdto_serv_butone(jbuf->jb_source, CMD_CREATE, jbuf->jb_connect, - "%s %Tu", chanlist, jbuf->jb_create); + sendcmdto_serv(jbuf->jb_source, CMD_CREATE, jbuf->jb_connect, + "%s %Tu", chanlist, jbuf->jb_create); break; case JOINBUF_TYPE_PART: - sendcmdto_serv_butone(jbuf->jb_source, CMD_PART, jbuf->jb_connect, - jbuf->jb_comment ? "%s :%s" : "%s", chanlist... [truncated message content] |