[IRC-Dev CVS] [CVS] Module ircdh: Change committed
Brought to you by:
zolty
From: Toni G. <zo...@us...> - 2003-01-18 22:54:46
|
CVSROOT : /cvsroot/irc-dev Module : ircdh Commit time: 2003-01-18 22:54:44 UTC Modified files: ChangeLog configure include/channel.h include/client.h include/handlers.h include/ircd_alloc.h include/ircd_features.h include/msg.h include/numeric.h include/patchlevel.h include/s_user.h include/send.h include/supported.h ircd/IPcheck.c ircd/Makefile.in ircd/channel.c ircd/client.c ircd/ircd.c ircd/ircd_alloc.c ircd/ircd_features.c ircd/list.c ircd/m_account.c ircd/m_admin.c ircd/m_away.c ircd/m_burst.c ircd/m_create.c ircd/m_error.c ircd/m_gline.c ircd/m_join.c ircd/m_kick.c ircd/m_kill.c ircd/m_map.c ircd/m_mode.c ircd/m_nick.c ircd/m_notice.c ircd/m_oper.c ircd/m_part.c ircd/m_pong.c ircd/m_privmsg.c ircd/m_server.c ircd/m_settime.c ircd/m_userhost.c ircd/m_version.c ircd/m_wallchops.c ircd/m_who.c ircd/m_whois.c ircd/map.c ircd/numnicks.c ircd/parse.c ircd/s_bsd.c ircd/s_conf.c ircd/s_err.c ircd/s_misc.c ircd/s_stats.c ircd/s_user.c ircd/send.c ircd/whocmds.c Log message: 2003-01-18 Toni Garcia <zo...@ir...> 1.0.alpha14 * ircd/s_user.c: Fusion de los modos normales y hispano. * include/client.h: Fusiono los modos normales y de hispano bajo Flags *flags. * ircd/wallvoices.c: Nuevo comando, manda notices a @ y + del canal. * Nuevos parches Undernet, hasta el u2.10.11.04. ---------------------- diff included ---------------------- Index: ircdh/ChangeLog diff -u ircdh/ChangeLog:1.8 ircdh/ChangeLog:1.9 --- ircdh/ChangeLog:1.8 Sat Jan 18 11:53:48 2003 +++ ircdh/ChangeLog Sat Jan 18 14:54:26 2003 @@ -1,3 +1,13 @@ +2003-01-18 Toni Garcia <zo...@ir...> 1.0.alpha14 + * ircd/s_user.c: Fusion de los modos normales y hispano. + + * include/client.h: Fusiono los modos normales y de hispano bajo Flags *flags. + + * ircd/wallvoices.c: Nuevo comando, manda notices a @ y + del canal. + + * Nuevos parches Undernet, hasta el u2.10.11.04. + + 2003-01-18 Toni Garcia <zo...@ir...> 1.0.alpha13 * Nuevos comandos: ACCOUNT, JUPE, CLEARMODE, OPMODE, SET, RESET, PRIV, ASLL. Index: ircdh/configure diff -u ircdh/configure:1.4 ircdh/configure:1.5 --- ircdh/configure:1.4 Sat Jan 18 11:09:00 2003 +++ ircdh/configure Sat Jan 18 14:54:26 2003 @@ -4050,6 +4050,15 @@ rm -f $ac_file mv conftest.h $ac_file fi +echo ATENCION: Este IRCD es una version ALPHA con lo que implica +echo que puede que no se compile bajo ciertas maquinas o que se +echo compila pero sale "warnings". O que se surjan cosas raras +echo o bugs. +echo +echo Si encuentras bugs, se agradeceria mucho que lo avises al mail +echo zo...@ir... o en la lista irc...@li... +echo +echo Estamos trabajando en ello. IRC-Dev.Net 2003 fi; done EOF Index: ircdh/include/channel.h diff -u ircdh/include/channel.h:1.8 ircdh/include/channel.h:1.9 --- ircdh/include/channel.h:1.8 Sat Jan 18 11:09:02 2003 +++ ircdh/include/channel.h Sat Jan 18 14:54:26 2003 @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: channel.h,v 1.8 2003/01/18 19:09:02 zolty Exp $ + * $Id: channel.h,v 1.9 2003/01/18 22:54:26 zolty Exp $ */ #ifndef INCLUDED_channel_h #define INCLUDED_channel_h @@ -123,7 +123,6 @@ #define IsModelessChannel(name) (*(name) == '+') #define IsChannelName(name) (*(name) == '#' || \ IsModelessChannel(name) || IsLocalChannel(name)) - typedef enum ChannelGetType { CGT_NO_CREATE, Index: ircdh/include/client.h diff -u ircdh/include/client.h:1.3 ircdh/include/client.h:1.4 --- ircdh/include/client.h:1.3 Sat Jan 18 11:09:02 2003 +++ ircdh/include/client.h Sat Jan 18 14:54:26 2003 @@ -18,7 +18,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * - * $Id: client.h,v 1.3 2003/01/18 19:09:02 zolty Exp $ + * $Id: client.h,v 1.4 2003/01/18 22:54:26 zolty Exp $ */ #ifndef INCLUDED_client_h #define INCLUDED_client_h @@ -77,41 +77,43 @@ * source file, or in the source file itself (when only used in that file). */ -#define PRIV_CHAN_LIMIT 1 /* no channel limit on oper */ -#define PRIV_MODE_LCHAN 2 /* oper can mode local chans */ -#define PRIV_WALK_LCHAN 3 /* oper can walk thru local modes */ -#define PRIV_DEOP_LCHAN 4 /* no deop oper on local chans */ -#define PRIV_SHOW_INVIS 5 /* show local invisible users */ -#define PRIV_SHOW_ALL_INVIS 6 /* show all invisible users */ -#define PRIV_UNLIMIT_QUERY 7 /* unlimit who queries */ - -#define PRIV_KILL 8 /* oper can KILL */ -#define PRIV_LOCAL_KILL 9 /* oper can local KILL */ -#define PRIV_REHASH 10 /* oper can REHASH */ -#define PRIV_RESTART 11 /* oper can RESTART */ -#define PRIV_DIE 12 /* oper can DIE */ -#define PRIV_GLINE 13 /* oper can GLINE */ -#define PRIV_LOCAL_GLINE 14 /* oper can local GLINE */ -#define PRIV_JUPE 15 /* oper can JUPE */ -#define PRIV_LOCAL_JUPE 16 /* oper can local JUPE */ -#define PRIV_OPMODE 17 /* oper can OP/CLEARMODE */ -#define PRIV_LOCAL_OPMODE 18 /* oper can local OP/CLEARMODE */ -#define PRIV_SET 19 /* oper can SET */ -#define PRIV_WHOX 20 /* oper can use /who x */ -#define PRIV_BADCHAN 21 /* oper can BADCHAN */ -#define PRIV_LOCAL_BADCHAN 22 /* oper can local BADCHAN */ -#define PRIV_SEE_CHAN 23 /* oper can see in secret chans */ - -#define PRIV_PROPAGATE 24 /* propagate oper status */ -#define PRIV_DISPLAY 25 /* "Is an oper" displayed */ -#define PRIV_SEE_OPERS 26 /* display hidden opers */ +enum Priv { + PRIV_CHAN_LIMIT, /* no channel limit on oper */ + PRIV_MODE_LCHAN, /* oper can mode local chans */ + PRIV_WALK_LCHAN, /* oper can walk thru local modes */ + PRIV_DEOP_LCHAN, /* no deop oper on local chans */ + PRIV_SHOW_INVIS, /* show local invisible users */ + PRIV_SHOW_ALL_INVIS, /* show all invisible users */ + PRIV_UNLIMIT_QUERY, /* unlimit who queries */ + + PRIV_KILL, /* oper can KILL */ + PRIV_LOCAL_KILL, /* oper can local KILL */ + PRIV_REHASH, /* oper can REHASH */ + PRIV_RESTART, /* oper can RESTART */ + PRIV_DIE, /* oper can DIE */ + PRIV_GLINE, /* oper can GLINE */ + PRIV_LOCAL_GLINE, /* oper can local GLINE */ + PRIV_JUPE, /* oper can JUPE */ + PRIV_LOCAL_JUPE, /* oper can local JUPE */ + PRIV_OPMODE, /* oper can OP/CLEARMODE */ + PRIV_LOCAL_OPMODE, /* oper can local OP/CLEARMODE */ + PRIV_SET, /* oper can SET */ + PRIV_WHOX, /* oper can use /who x */ + PRIV_BADCHAN, /* oper can BADCHAN */ + PRIV_LOCAL_BADCHAN, /* oper can local BADCHAN */ + PRIV_SEE_CHAN, /* oper can see in secret chans */ + + PRIV_PROPAGATE, /* propagate oper status */ + PRIV_DISPLAY, /* "Is an oper" displayed */ + PRIV_SEE_OPERS, /* display hidden opers */ -#define PRIV_WIDE_GLINE 27 /* oper can set wider G-lines */ + PRIV_WIDE_GLINE, /* oper can set wider G-lines */ -#define PRIV_FORCE_OPMODE 28 /* oper can override a Q-line */ -#define PRIV_FORCE_LOCAL_OPMODE 29 /* oper can override a local channel Q-line */ + PRIV_FORCE_OPMODE, /* oper can override a Q-line */ + PRIV_FORCE_LOCAL_OPMODE, /* oper can override a local channel Q-line */ -#define PRIV_LAST_PRIV 29 /* must be the same as the last priv */ + PRIV_LAST_PRIV /* must be the same as the last priv */ +}; #define _PRIV_NBITS (8 * sizeof(unsigned long)) @@ -119,7 +121,57 @@ #define _PRIV_BIT(priv) (1 << ((priv) % _PRIV_NBITS)) struct Privs { - unsigned long priv_mask[(PRIV_LAST_PRIV / _PRIV_NBITS) + 1]; + unsigned long priv_mask[(PRIV_LAST_PRIV + _PRIV_NBITS - 1) / _PRIV_NBITS]; +}; + +enum Flag { + FLAG_PINGSENT, /* Unreplied ping sent */ + FLAG_DEADSOCKET, /* Local socket is dead--Exiting soon */ + FLAG_KILLED, /* Prevents "QUIT" from being sent for this */ + FLAG_BLOCKED, /* socket is in a blocked condition */ + FLAG_CLOSING, /* set when closing to suppress errors */ + FLAG_UPING, /* has active UDP ping request */ + FLAG_CHKACCESS, /* ok to check clients access if set */ + FLAG_HUB, /* server is a hub */ + FLAG_SERVICE, /* server is a service */ + FLAG_LOCAL, /* set for local clients */ + FLAG_GOTID, /* successful ident lookup achieved */ + FLAG_DOID, /* I-lines say must use ident return */ + FLAG_NONL, /* No \n in buffer */ + FLAG_TS8, /* Why do you want to know? */ + FLAG_MAP, /* Show server on the map */ + FLAG_JUNCTION, /* Junction causing the net.burst */ + FLAG_BURST, /* Server is receiving a net.burst */ + FLAG_BURST_ACK, /* Server is waiting for eob ack */ + FLAG_IPCHECK, /* Added or updated IPregistry data */ + + FLAG_LOCOP, /* Local operator -- SRB */ + FLAG_SERVNOTICE, /* server notices such as kill */ + FLAG_OPER, /* Operator */ + FLAG_INVISIBLE, /* makes user invisible */ + FLAG_WALLOP, /* send wallops to them */ + FLAG_DEAF, /* Makes user deaf */ + FLAG_CHSERV, /* Disallow KICK or MODE -o on the user; + don't display channels in /whois */ + FLAG_DEBUG, /* send global debug/anti-hack info */ + FLAG_ACCOUNT, /* account name has been set */ + FLAG_HIDDENHOST, /* user's host is hidden */ +#if defined(BDD) +/* Flags de los modos Hispano */ + FLAG_NICKREGISTERED, /* Nick Registrado */ + FLAG_NICKSUSPENDED, /* Nick Suspendido */ + FLAG_HELPOP, /* Es un oper con modo +h */ + FLAG_BOT, /* Es un bot */ + FLAG_HIDDENVIEWER, /* Ver ips reales */ + FLAG_MSGONLYREG, /* Solo recibir mensajes de usuarios con +r */ +#endif /* BDD */ + _FLAG_COUNT, + FLAG_LOCAL_UMODES = FLAG_LOCOP, /* First local mode flag */ + FLAG_GLOBAL_UMODES = FLAG_OPER /* First global mode flag */ +}; + +struct Flags { + unsigned long flag_bits[((_FLAG_COUNT + _PRIV_NBITS - 1) / _PRIV_NBITS)]; }; struct Connection { @@ -213,10 +265,7 @@ time_t cli_firsttime; /* time client was created */ time_t cli_lastnick; /* TimeStamp on nick */ int cli_marker; /* /who processing marker */ - unsigned int cli_flags; /* client flags */ -#if defined(BDD) - unsigned int cli_hmodes; /* HISPANO user modes (flag extensions) */ -#endif + struct Flags cli_flags; /* client flags */ unsigned int cli_hopcount; /* number of servers to this 0 = local */ struct in_addr cli_ip; /* Real ip# NOT defined for remote servers! */ short cli_status; /* Client type */ @@ -246,9 +295,6 @@ #define cli_lastnick(cli) ((cli)->cli_lastnick) #define cli_marker(cli) ((cli)->cli_marker) #define cli_flags(cli) ((cli)->cli_flags) -#ifdef BDD -#define cli_hmodes(cli) ((cli->cli_hmodes) -#endif #define cli_hopcount(cli) ((cli)->cli_hopcount) #define cli_ip(cli) ((cli)->cli_ip) #define cli_status(cli) ((cli)->cli_status) @@ -378,172 +424,112 @@ (STAT_SERVER | STAT_CONNECTING | STAT_HANDSHAKE)) /* - * FLAGS macros - */ -#define FLAGS_PINGSENT 0x0001 /* Unreplied ping sent */ -#define FLAGS_DEADSOCKET 0x0002 /* Local socket is dead--Exiting soon */ -#define FLAGS_KILLED 0x0004 /* Prevents "QUIT" from being sent for this */ -#define FLAGS_OPER 0x0008 /* Operator */ -#define FLAGS_LOCOP 0x0010 /* Local operator -- SRB */ -#define FLAGS_INVISIBLE 0x0020 /* makes user invisible */ -#define FLAGS_WALLOP 0x0040 /* send wallops to them */ -#define FLAGS_SERVNOTICE 0x0080 /* server notices such as kill */ -#define FLAGS_BLOCKED 0x0100 /* socket is in a blocked condition */ -#define FLAGS_ACCOUNT 0x0200 /* account name has been set */ -#define FLAGS_CLOSING 0x0400 /* set when closing to suppress errors */ -#define FLAGS_UPING 0x0800 /* has active UDP ping request */ -#define FLAGS_CHKACCESS 0x1000 /* ok to check clients access if set */ -#define FLAGS_HUB 0x2000 /* server is a hub */ -#define FLAGS_SERVICE 0x4000 /* server is a service */ -#define FLAGS_HIDDENHOST 0x8000 /* user's host is hidden */ -#define FLAGS_LOCAL 0x00010000 /* set for local clients */ -#define FLAGS_GOTID 0x00020000 /* successful ident lookup achieved */ -#define FLAGS_DOID 0x00040000 /* I-lines say must use ident return */ -#define FLAGS_NONL 0x00080000 /* No \n in buffer */ -#define FLAGS_TS8 0x00100000 /* Why do you want to know? */ -#define FLAGS_MAP 0x00800000 /* Show server on the map */ -#define FLAGS_JUNCTION 0x01000000 /* Junction causing the net.burst */ -#define FLAGS_DEAF 0x02000000 /* Makes user deaf */ -#define FLAGS_CHSERV 0x04000000 /* Disallow KICK or MODE -o on the user; - don't display channels in /whois */ -#define FLAGS_BURST 0x08000000 /* Server is receiving a net.burst */ -#define FLAGS_BURST_ACK 0x10000000 /* Server is waiting for eob ack */ -#define FLAGS_DEBUG 0x20000000 /* send global debug/anti-hack info */ -#define FLAGS_IPCHECK 0x40000000 /* Added or updated IPregistry data */ - -#define SEND_UMODES \ - (FLAGS_INVISIBLE|FLAGS_OPER|FLAGS_WALLOP|FLAGS_DEAF|FLAGS_CHSERV|FLAGS_DEBUG|FLAGS_ACCOUNT|FLAGS_HIDDENHOST) -#define ALL_UMODES (SEND_UMODES|FLAGS_SERVNOTICE|FLAGS_LOCOP) -#define FLAGS_ID (FLAGS_DOID|FLAGS_GOTID) - -/* * flags macros. */ -#define DoAccess(x) (cli_flags(x) & FLAGS_CHKACCESS) -#define IsAnOper(x) (cli_flags(x) & (FLAGS_OPER|FLAGS_LOCOP)) -#define IsBlocked(x) (cli_flags(x) & FLAGS_BLOCKED) -#define IsBurst(x) (cli_flags(x) & FLAGS_BURST) -#define IsBurstAck(x) (cli_flags(x) & FLAGS_BURST_ACK) -#define IsBurstOrBurstAck(x) (cli_flags(x) & (FLAGS_BURST|FLAGS_BURST_ACK)) -#define IsChannelService(x) (cli_flags(x) & FLAGS_CHSERV) -#define IsDead(x) (cli_flags(x) & FLAGS_DEADSOCKET) -#define IsDeaf(x) (cli_flags(x) & FLAGS_DEAF) -#define IsIPChecked(x) (cli_flags(x) & FLAGS_IPCHECK) -#define IsIdented(x) (cli_flags(x) & FLAGS_GOTID) -#define IsInvisible(x) (cli_flags(x) & FLAGS_INVISIBLE) -#define IsJunction(x) (cli_flags(x) & FLAGS_JUNCTION) -#define IsLocOp(x) (cli_flags(x) & FLAGS_LOCOP) -#define IsLocal(x) (cli_flags(x) & FLAGS_LOCAL) -#define IsOper(x) (cli_flags(x) & FLAGS_OPER) -#define IsUPing(x) (cli_flags(x) & FLAGS_UPING) -#define NoNewLine(x) (cli_flags(x) & FLAGS_NONL) -#define SendDebug(x) (cli_flags(x) & FLAGS_DEBUG) -#define SendServNotice(x) (cli_flags(x) & FLAGS_SERVNOTICE) -#define SendWallops(x) (cli_flags(x) & FLAGS_WALLOP) -#define IsHub(x) (cli_flags(x) & FLAGS_HUB) -#define IsService(x) (cli_flags(x) & FLAGS_SERVICE) -#define IsAccount(x) (cli_flags(x) & FLAGS_ACCOUNT) -#define IsHiddenHost(x) (cli_flags(x) & FLAGS_HIDDENHOST) +#define FlagSet(fset, flag) ((fset)->flag_bits[_PRIV_IDX(flag)] |= \ + _PRIV_BIT(flag)) +#define FlagClr(fset, flag) ((fset)->flag_bits[_PRIV_IDX(flag)] &= \ + ~(_PRIV_BIT(flag))) +#define FlagHas(fset, flag) ((fset)->flag_bits[_PRIV_IDX(flag)] & \ + _PRIV_BIT(flag)) +#define SetFlag(cli, flag) FlagSet(&cli_flags(cli), flag) +#define ClrFlag(cli, flag) FlagClr(&cli_flags(cli), flag) +#define HasFlag(cli, flag) FlagHas(&cli_flags(cli), flag) + +#define DoAccess(x) HasFlag(x, FLAG_CHKACCESS) +#define IsAnOper(x) (HasFlag(x, FLAG_OPER) || HasFlag(x, FLAG_LOCOP)) +#define IsBlocked(x) HasFlag(x, FLAG_BLOCKED) +#define IsBurst(x) HasFlag(x, FLAG_BURST) +#define IsBurstAck(x) HasFlag(x, FLAG_BURST_ACK) +#define IsBurstOrBurstAck(x) (HasFlag(x, FLAG_BURST) || HasFlag(x, FLAG_BURST_ACK)) +#define IsChannelService(x) HasFlag(x, FLAG_CHSERV) +#define IsDead(x) HasFlag(x, FLAG_DEADSOCKET) +#define IsDeaf(x) HasFlag(x, FLAG_DEAF) +#define IsIPChecked(x) HasFlag(x, FLAG_IPCHECK) +#define IsIdented(x) HasFlag(x, FLAG_GOTID) +#define IsInvisible(x) HasFlag(x, FLAG_INVISIBLE) +#define IsJunction(x) HasFlag(x, FLAG_JUNCTION) +#define IsLocOp(x) HasFlag(x, FLAG_LOCOP) +#define IsLocal(x) HasFlag(x, FLAG_LOCAL) +#define IsOper(x) HasFlag(x, FLAG_OPER) +#define IsUPing(x) HasFlag(x, FLAG_UPING) +#define NoNewLine(x) HasFlag(x, FLAG_NONL) +#define SendDebug(x) HasFlag(x, FLAG_DEBUG) +#define SendServNotice(x) HasFlag(x, FLAG_SERVNOTICE) +#define SendWallops(x) HasFlag(x, FLAG_WALLOP) +#define IsHub(x) HasFlag(x, FLAG_HUB) +#define IsService(x) HasFlag(x, FLAG_SERVICE) +#define IsAccount(x) HasFlag(x, FLAG_ACCOUNT) +#define IsHiddenHost(x) HasFlag(x, FLAG_HIDDENHOST) #define HasHiddenHost(x) (IsAccount(x) && IsHiddenHost(x)) +#if defined(BDD) +/* Macros comprobacion modos hispano */ +#define IsNickRegistered(x) HasFlag(x, FLAG_NICKREGISTERED) +#define IsNickSuspended(x) HasFlag(x, FLAG_NICKSUSPENDED) +#define IsHelpOp(x) HasFlag(x, FLAG_HELPOP) +#define IsBot(x) HasFlag(x, FLAG_BOT) +#define IsHiddenViewer(x) HasFlag(x, FLAG_HIDDENVIEWER) +#define IsMsgOnlyReg(x) HasFlag(x, FLAG_MSGONLYREG) +#endif /* BDD */ #define IsPrivileged(x) (IsAnOper(x) || IsServer(x)) -#define SetAccess(x) (cli_flags(x) |= FLAGS_CHKACCESS) -#define SetBurst(x) (cli_flags(x) |= FLAGS_BURST) -#define SetBurstAck(x) (cli_flags(x) |= FLAGS_BURST_ACK) -#define SetChannelService(x) (cli_flags(x) |= FLAGS_CHSERV) -#define SetDeaf(x) (cli_flags(x) |= FLAGS_DEAF) -#define SetDebug(x) (cli_flags(x) |= FLAGS_DEBUG) -#define SetGotId(x) (cli_flags(x) |= FLAGS_GOTID) -#define SetIPChecked(x) (cli_flags(x) |= FLAGS_IPCHECK) -#define SetInvisible(x) (cli_flags(x) |= FLAGS_INVISIBLE) -#define SetJunction(x) (cli_flags(x) |= FLAGS_JUNCTION) -#define SetLocOp(x) (cli_flags(x) |= FLAGS_LOCOP) -#define SetOper(x) (cli_flags(x) |= FLAGS_OPER) -#define SetUPing(x) (cli_flags(x) |= FLAGS_UPING) -#define SetWallops(x) (cli_flags(x) |= FLAGS_WALLOP) -#define SetServNotice(x) (cli_flags(x) |= FLAGS_SERVNOTICE) -#define SetHub(x) (cli_flags(x) |= FLAGS_HUB) -#define SetService(x) (cli_flags(x) |= FLAGS_SERVICE) -#define SetAccount(x) (cli_flags(x) |= FLAGS_ACCOUNT) -#define SetHiddenHost(x) (cli_flags(x) |= FLAGS_HIDDENHOST) - -#define ClearAccess(x) (cli_flags(x) &= ~FLAGS_CHKACCESS) -#define ClearBurst(x) (cli_flags(x) &= ~FLAGS_BURST) -#define ClearBurstAck(x) (cli_flags(x) &= ~FLAGS_BURST_ACK) -#define ClearChannelService(x) (cli_flags(x) &= ~FLAGS_CHSERV) -#define ClearDeaf(x) (cli_flags(x) &= ~FLAGS_DEAF) -#define ClearDebug(x) (cli_flags(x) &= ~FLAGS_DEBUG) -#define ClearIPChecked(x) (cli_flags(x) &= ~FLAGS_IPCHECK) -#define ClearInvisible(x) (cli_flags(x) &= ~FLAGS_INVISIBLE) -#define ClearLocOp(x) (cli_flags(x) &= ~FLAGS_LOCOP) -#define ClearOper(x) (cli_flags(x) &= ~FLAGS_OPER) -#define ClearUPing(x) (cli_flags(x) &= ~FLAGS_UPING) -#define ClearWallops(x) (cli_flags(x) &= ~FLAGS_WALLOP) -#define ClearServNotice(x) (cli_flags(x) &= ~FLAGS_SERVNOTICE) -#define ClearHiddenHost(x) (cli_flags(x) &= ~FLAGS_HIDDENHOST) - -/* free flags */ -#define FREEFLAG_SOCKET 0x0001 /* socket needs to be freed */ -#define FREEFLAG_TIMER 0x0002 /* timer needs to be freed */ - +#define SetAccess(x) SetFlag(x, FLAG_CHKACCESS) +#define SetBurst(x) SetFlag(x, FLAG_BURST) +#define SetBurstAck(x) SetFlag(x, FLAG_BURST_ACK) +#define SetChannelService(x) SetFlag(x, FLAG_CHSERV) +#define SetDeaf(x) SetFlag(x, FLAG_DEAF) +#define SetDebug(x) SetFlag(x, FLAG_DEBUG) +#define SetGotId(x) SetFlag(x, FLAG_GOTID) +#define SetIPChecked(x) SetFlag(x, FLAG_IPCHECK) +#define SetInvisible(x) SetFlag(x, FLAG_INVISIBLE) +#define SetJunction(x) SetFlag(x, FLAG_JUNCTION) +#define SetLocOp(x) SetFlag(x, FLAG_LOCOP) +#define SetOper(x) SetFlag(x, FLAG_OPER) +#define SetUPing(x) SetFlag(x, FLAG_UPING) +#define SetWallops(x) SetFlag(x, FLAG_WALLOP) +#define SetServNotice(x) SetFlag(x, FLAG_SERVNOTICE) +#define SetHub(x) SetFlag(x, FLAG_HUB) +#define SetService(x) SetFlag(x, FLAG_SERVICE) +#define SetAccount(x) SetFlag(x, FLAG_ACCOUNT) +#define SetHiddenHost(x) SetFlag(x, FLAG_HIDDENHOST) #if defined(BDD) - -/* Bits de los modos hispano */ -#define HMODE_NICKREGISTERED 0x00000001 /* Nick is registered (HISPANO/ESNET) */ -#define HMODE_SOCKS 0x00000004 /* se esta chekeando socks */ -#define HMODE_WRSOCKS 0x00000008 /* se tiene ke escribir en socks */ -#define HMODE_HELPOP 0x00000010 /* Es un oper con modo +h */ -#define HMODE_SERVICESBOT 0x00000020 /* Es un bot de canales */ -#define HMODE_HIDDEN 0x00000040 /* Ip Oculta */ -#define HMODE_HIDDENVIEWER 0x00000080 /* Ip Oculta */ -#define HMODE_NICKSUSPENDED 0x00000100 /* Nick Suspendido */ -#define HMODE_MSGONLYREG 0x00000200 /* Solo recibir mensajes de usuarios con +r */ - -/* Modos hispano a propagar */ -#define SEND_HMODES \ - (HMODE_NICKREGISTERED | HMODE_HELPOP | HMODE_SERVICESBOT | HMODE_HIDDEN | HMODE_HIDDENVIEWER \ - | HMODE_NICKSUSPENDED | HMODE_MSGONLYREG) - -/* Modos hispano TODOS */ -#define ALL_HMODES \ - (SEND_HMODES) - -/* Macros comprobacion modos hispano */ -#define IsNickRegistered(x) ((x)->hmodes & HMODE_NICKREGISTERED) -#define DoingSocks(x) ((x)->hmodes & HMODE_SOCKS) -#define DoingWrSocks(x) ((x)->hmodes & HMODE_WRSOCKS) -#define IsHelpOp(x) ((x)->hmodes & HMODE_HELPOP) -#define IsServicesBot(x) ((x)->hmodes & HMODE_SERVICESBOT) -#define IsHidden(x) ((x)->hmodes & HMODE_HIDDEN) -#define IsHiddenViewer(x) ((x)->hmodes & HMODE_HIDDENVIEWER) -#define IsNickSuspended(x) ((x)->hmodes & HMODE_NICKSUSPENDED) -#define IsMsgOnlyReg(x) ((x)->hmodes & HMODE_MSGONLYREG) - /* Macros para poner modos hispano */ -#define SetNickRegistered(x) ((x)->hmodes |= HMODE_NICKREGISTERED) -#define SetSocks(x) ((x)->hmodes |= HMODE_SOCKS) -#define SetWrSocks(x) ((x)->hmodes |= HMODE_WRSOCKS) -#define SetHelpOp(x) ((x)->hmodes |= HMODE_HELPOP) -#define SetServicesBot(x) ((x)->hmodes |= HMODE_SERVICESBOT) -#define SetHidden(x) ((x)->hmodes |= HMODE_HIDDEN) -#define SetHiddenViewer(x) ((x)->hmodes |= HMODE_HIDDENVIEWER) -#define SetNickSuspended(x) ((x)->hmodes |= HMODE_NICKSUSPENDED) -#define SetMsgOnlyReg(x) ((x)->hmodes |= HMODE_MSGONLYREG) +#define SetNickRegistered(x) SetFlag(x, FLAG_NICKREGISTERED) +#define SetNickSuspended(x) SetFlag(x, FLAG_NICKSUSPENDED) +#define SetHelpOp(x) SetFlag(x, FLAG_HELPOP) +#define SetBot(x) SetFlag(x, FLAG_BOT) +#define SetHiddenViewer(x) SetFlag(x, FLAG_HIDDENVIEWER) +#define SetMsgOnlyReg(x) SetFlag(x, FLAG_MSGONLYREG) +#endif /* BDD */ +#define ClearAccess(x) ClrFlag(x, FLAG_CHKACCESS) +#define ClearBurst(x) ClrFlag(x, FLAG_BURST) +#define ClearBurstAck(x) ClrFlag(x, FLAG_BURST_ACK) +#define ClearChannelService(x) ClrFlag(x, FLAG_CHSERV) +#define ClearDeaf(x) ClrFlag(x, FLAG_DEAF) +#define ClearDebug(x) ClrFlag(x, FLAG_DEBUG) +#define ClearIPChecked(x) ClrFlag(x, FLAG_IPCHECK) +#define ClearInvisible(x) ClrFlag(x, FLAG_INVISIBLE) +#define ClearLocOp(x) ClrFlag(x, FLAG_LOCOP) +#define ClearOper(x) ClrFlag(x, FLAG_OPER) +#define ClearUPing(x) ClrFlag(x, FLAG_UPING) +#define ClearWallops(x) ClrFlag(x, FLAG_WALLOP) +#define ClearServNotice(x) ClrFlag(x, FLAG_SERVNOTICE) +#define ClearHiddenHost(x) ClrFlag(x, FLAG_HIDDENHOST) +#if defined (BDD) /* Macros para borrar modos hispano */ -#define ClearNickRegistered(x) ((x)->hmodes &= ~HMODE_NICKREGISTERED) -#define ClearSocks(x) ((x)->hmodes &= ~HMODE_SOCKS) -#define ClearWrSocks(x) ((x)->hmodes &= ~HMODE_WRSOCKS) -#define ClearHelpOp(x) ((x)->hmodes &= ~HMODE_HELPOP) -#define ClearServicesBot(x) ((x)->hmodes &= ~HMODE_SERVICESBOT) -#define ClearHidden(x) ((x)->hmodes &= ~HMODE_HIDDEN) -#define ClearHiddenViewer(x) ((x)->hmodes &= ~HMODE_HIDDENVIEWER) -#define ClearNickSuspended(x) ((x)->hmodes &= ~HMODE_NICKSUSPENDED) -#define ClearMsgOnlyReg(x) ((x)->hmodes &= ~HMODE_MSGONLYREG) - +#define ClearNickRegistered(x) ClrFlag(x, FLAG_NICKREGISTERED) +#define ClearNickSuspended(x) ClrFlag(x, FLAG_NICKSUSPENDED) +#define ClearHelpOp(x) ClrFlag(x, FLAG_HELPOP) +#define ClearBot(x) ClrFlag(x, FLAG_BOT) +#define ClearHiddenViewer(x) ClrFlag(x, FLAG_HIDDENVIEWER) +#define ClearMsgOnlyReg(x) ClrFlag(x, FLAG_MSGONLYREG) #endif /* BDD */ +/* free flags */ +#define FREEFLAG_SOCKET 0x0001 /* socket needs to be freed */ +#define FREEFLAG_TIMER 0x0002 /* timer needs to be freed */ /* server notice stuff */ Index: ircdh/include/handlers.h diff -u ircdh/include/handlers.h:1.3 ircdh/include/handlers.h:1.4 --- ircdh/include/handlers.h:1.3 Sat Jan 18 11:53:48 2003 +++ ircdh/include/handlers.h Sat Jan 18 14:54:26 2003 @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: handlers.h,v 1.3 2003/01/18 19:53:48 zolty Exp $ + * $Id: handlers.h,v 1.4 2003/01/18 22:54:26 zolty Exp $ */ #ifndef INCLUDED_handlers_h #define INCLUDED_handlers_h @@ -139,6 +139,7 @@ extern int m_userip(struct Client *, struct Client *, int, char *[]); extern int m_version(struct Client *, struct Client *, int, char *[]); extern int m_wallchops(struct Client *, struct Client *, int, char *[]); +extern int m_wallvoices(struct Client *, struct Client *, int, char *[]); extern int m_watch(struct Client *, struct Client *, int, char *[]); extern int m_who(struct Client *, struct Client *, int, char *[]); extern int m_whois(struct Client *, struct Client *, int, char *[]); @@ -248,6 +249,7 @@ extern int ms_version(struct Client *, struct Client *, int, char *[]); extern int ms_wallchops(struct Client *, struct Client *, int, char *[]); extern int ms_wallops(struct Client *, struct Client *, int, char *[]); +extern int ms_wallvoices(struct Client *, struct Client *, int, char *[]); extern int ms_wallusers(struct Client *, struct Client *, int, char *[]); extern int ms_whois(struct Client *, struct Client *, int, char *[]); Index: ircdh/include/ircd_alloc.h diff -u ircdh/include/ircd_alloc.h:1.2 ircdh/include/ircd_alloc.h:1.3 --- ircdh/include/ircd_alloc.h:1.2 Sat Jan 18 11:09:03 2003 +++ ircdh/include/ircd_alloc.h Sat Jan 18 14:54:26 2003 @@ -19,11 +19,14 @@ * * Commentary by Bleep (Thomas Helvey) * - * $Id: ircd_alloc.h,v 1.2 2003/01/18 19:09:03 zolty Exp $ + * $Id: ircd_alloc.h,v 1.3 2003/01/18 22:54:26 zolty Exp $ */ #ifndef INCLUDED_ircd_alloc_h #define INCLUDED_ircd_alloc_h +#undef FROBONMALLOC +#undef FROBONFREE + /* * memory resource allocation and test functions */ @@ -39,7 +42,12 @@ #define INCLUDED_stdlib_h #endif +#ifdef FROBONFREE +extern void MyFrobulatingFree(void *x); +#define MyFree(x) do { MyFrobulatingFree((x)); (x) = 0; } while(0) +#else #define MyFree(x) do { free((x)); (x) = 0; } while(0) +#endif extern void *MyMalloc(size_t size); extern void *MyCalloc(size_t nelem, size_t size); Index: ircdh/include/ircd_features.h diff -u ircdh/include/ircd_features.h:1.1 ircdh/include/ircd_features.h:1.2 --- ircdh/include/ircd_features.h:1.1 Sat Jan 18 11:09:03 2003 +++ ircdh/include/ircd_features.h Sat Jan 18 14:54:27 2003 @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: ircd_features.h,v 1.1 2003/01/18 19:09:03 zolty Exp $ + * $Id: ircd_features.h,v 1.2 2003/01/18 22:54:27 zolty Exp $ */ #ifndef INCLUDED_features_h #define INCLUDED_features_h @@ -46,6 +46,7 @@ FEAT_HOST_HIDING, FEAT_HIDDEN_HOST, FEAT_HIDDEN_IP, + FEAT_AUTOHIDE, FEAT_CONNEXIT_NOTICES, /* features that probably should not be touched */ Index: ircdh/include/msg.h diff -u ircdh/include/msg.h:1.5 ircdh/include/msg.h:1.6 --- ircdh/include/msg.h:1.5 Sat Jan 18 11:53:48 2003 +++ ircdh/include/msg.h Sat Jan 18 14:54:27 2003 @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: msg.h,v 1.5 2003/01/18 19:53:48 zolty Exp $ + * $Id: msg.h,v 1.6 2003/01/18 22:54:27 zolty Exp $ */ #ifndef INCLUDED_msg_h #define INCLUDED_msg_h @@ -197,6 +197,10 @@ #define MSG_WALLCHOPS "WALLCHOPS" /* WC */ #define TOK_WALLCHOPS "WC" #define CMD_WALLCHOPS MSG_WALLCHOPS, TOK_WALLCHOPS + +#define MSG_WALLVOICES "WALLVOICES" /* WV */ +#define TOK_WALLVOICES "WV" +#define CMD_WALLVOICES MSG_WALLVOICES, TOK_WALLVOICES #define MSG_CPRIVMSG "CPRIVMSG" /* CPRI */ #define TOK_CPRIVMSG "CP" Index: ircdh/include/numeric.h diff -u ircdh/include/numeric.h:1.6 ircdh/include/numeric.h:1.7 --- ircdh/include/numeric.h:1.6 Sat Jan 18 11:09:03 2003 +++ ircdh/include/numeric.h Sat Jan 18 14:54:27 2003 @@ -305,6 +305,7 @@ /* RPL_USERS 393 Dalnet,EFNet,IRCnet */ /* RPL_END_USERS 394 Dalnet,EFNet,IRCnet */ /* RPL_NOUSERS 395 Dalnet,EFNet,IRCnet */ +#define RPL_HOSTHIDDEN 396 /* UMODE +x completed succesfuly */ /* * Errors are in the range from 400-599 currently and are grouped by what Index: ircdh/include/patchlevel.h diff -u ircdh/include/patchlevel.h:1.8 ircdh/include/patchlevel.h:1.9 --- ircdh/include/patchlevel.h:1.8 Sat Jan 18 11:53:48 2003 +++ ircdh/include/patchlevel.h Sat Jan 18 14:54:27 2003 @@ -15,10 +15,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: patchlevel.h,v 1.8 2003/01/18 19:53:48 zolty Exp $ + * $Id: patchlevel.h,v 1.9 2003/01/18 22:54:27 zolty Exp $ * */ -#define PATCHLEVEL ".alpha13" +#define PATCHLEVEL ".alpha14" #define RELEASE "1.0" Index: ircdh/include/s_user.h diff -u ircdh/include/s_user.h:1.6 ircdh/include/s_user.h:1.7 --- ircdh/include/s_user.h:1.6 Sat Jan 18 11:09:04 2003 +++ ircdh/include/s_user.h Sat Jan 18 14:54:28 2003 @@ -1,7 +1,7 @@ /* * s_user.h * - * $Id: s_user.h,v 1.6 2003/01/18 19:09:04 zolty Exp $ + * $Id: s_user.h,v 1.7 2003/01/18 22:54:28 zolty Exp $ */ #ifndef INCLUDED_s_user_h #define INCLUDED_s_user_h @@ -17,6 +17,7 @@ struct User; struct Channel; struct MsgBuf; +struct Flags; /* * Macros @@ -43,6 +44,11 @@ #define HUNTED_ISME 0 /* if this server should execute the command */ #define HUNTED_PASS 1 /* if message passed onwards successfully */ +/* send sets for send_umode() */ +#define ALL_UMODES 0 /* both local and global user modes */ +#define SEND_UMODES 1 /* global user modes only */ +#define SEND_UMODES_BUT_OPER 2 /* global user modes except for FLAG_OPER */ + /* used when sending to #mask or $mask */ #define MATCH_SERVER 1 @@ -79,23 +85,17 @@ extern void user_count_memory(size_t *count_out, size_t *bytes_out); -extern int do_nick_name(char *nick); extern int set_nick_name(struct Client *cptr, struct Client *sptr, const char *nick, int parc, char *parv[], int flags); -#ifdef BDD -extern void send_umode_out(struct Client *cptr, struct Client *sptr, int old, - int oldh, int registrado, int prop); -#else -extern void send_umode_out(struct Client *cptr, struct Client *sptr, int old, - int prop); -#endif -extern int whisper(struct Client *source, const char *nick, - const char *channel, const char *text, int is_notice); +extern void send_umode_out(struct Client *cptr, struct Client *sptr, + struct Flags *old, int prop); +extern int whisper(struct Client *source, const char *nick, const char *channel, + const char *text, int is_notice); extern void send_user_info(struct Client *to, char *names, int rpl, InfoFormatter fmt); extern int add_silence(struct Client *sptr, const char *mask); -extern int hide_hostmask(struct Client *cptr, unsigned int flags); +extern int hide_hostmask(struct Client *cptr, unsigned int flag); extern int set_user_mode(struct Client *cptr, struct Client *sptr, int parc, char *parv[]); extern int is_silenced(struct Client *sptr, struct Client *acptr); @@ -109,13 +109,8 @@ int MustBeOper, const char *pattern, int server, int parc, char *parv[]); extern struct Client *next_client(struct Client *next, const char *ch); extern char *umode_str(struct Client *cptr); -#if defined(BDD) -extern void send_umode(struct Client *cptr, struct Client *sptr, int old, - int sendmask, int oldh, int sendhmask); -#else -extern void send_umode(struct Client *cptr, struct Client *sptr, int old, - int sendmask); -#endif +extern void send_umode(struct Client *cptr, struct Client *sptr, + struct Flags *old, int sendset); extern int del_silence(struct Client *sptr, char *mask); extern void set_snomask(struct Client *, unsigned int, int); extern int is_snomask(char *); Index: ircdh/include/send.h diff -u ircdh/include/send.h:1.6 ircdh/include/send.h:1.7 --- ircdh/include/send.h:1.6 Sat Jan 18 11:09:04 2003 +++ ircdh/include/send.h Sat Jan 18 14:54:28 2003 @@ -1,7 +1,7 @@ /* * send.h * - * $Id: send.h,v 1.6 2003/01/18 19:09:04 zolty Exp $ + * $Id: send.h,v 1.7 2003/01/18 22:54:28 zolty Exp $ */ #ifndef INCLUDED_send_h #define INCLUDED_send_h @@ -65,6 +65,7 @@ #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) */ /* Send command to all users having a particular flag set */ extern void sendwallto_group_butone(struct Client *from, int type, Index: ircdh/include/supported.h diff -u ircdh/include/supported.h:1.2 ircdh/include/supported.h:1.3 --- ircdh/include/supported.h:1.2 Sat Jan 18 11:09:04 2003 +++ ircdh/include/supported.h Sat Jan 18 14:54:29 2003 @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: supported.h,v 1.2 2003/01/18 19:09:04 zolty Exp $ + * $Id: supported.h,v 1.3 2003/01/18 22:54:29 zolty Exp $ * * Description: This file has the featureset that ircu announces on connecting * a client. It's in this .h because it's likely to be appended @@ -71,6 +71,7 @@ " MAP" \ " USERIP" \ " WALLCHOPS" \ + " WALLVOICES" \ " WHOX" /* Index: ircdh/ircd/IPcheck.c diff -u ircdh/ircd/IPcheck.c:1.8 ircdh/ircd/IPcheck.c:1.9 --- ircdh/ircd/IPcheck.c:1.8 Sat Jan 18 11:09:04 2003 +++ ircdh/ircd/IPcheck.c Sat Jan 18 14:54:29 2003 @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: IPcheck.c,v 1.8 2003/01/18 19:09:04 zolty Exp $ + * $Id: IPcheck.c,v 1.9 2003/01/18 22:54:29 zolty Exp $ * * * @@ -450,7 +450,7 @@ { /* * trying to find an entry for a server causes this to happen, - * servers should never have FLAGS_IPCHECK set + * servers should never have FLAG_IPCHECK set */ return; } Index: ircdh/ircd/Makefile.in diff -u ircdh/ircd/Makefile.in:1.10 ircdh/ircd/Makefile.in:1.11 --- ircdh/ircd/Makefile.in:1.10 Sat Jan 18 11:53:48 2003 +++ ircdh/ircd/Makefile.in Sat Jan 18 14:54:30 2003 @@ -176,6 +176,7 @@ m_userip.c \ m_version.c \ m_wallchops.c \ + m_wallvoices.c \ m_wallops.c \ m_wallusers.c \ m_watch.c \ Index: ircdh/ircd/channel.c diff -u ircdh/ircd/channel.c:1.8 ircdh/ircd/channel.c:1.9 --- ircdh/ircd/channel.c:1.8 Sat Jan 18 11:09:04 2003 +++ ircdh/ircd/channel.c Sat Jan 18 14:54:31 2003 @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: channel.c,v 1.8 2003/01/18 19:09:04 zolty Exp $ + * $Id: channel.c,v 1.9 2003/01/18 22:54:31 zolty Exp $ */ #include "config.h" @@ -417,6 +417,7 @@ struct Membership *member) { struct SLink *tmp; + char tmphost[HOSTLEN + 1]; char nu_host[NUH_BUFSIZE]; char nu_realhost[NUH_BUFSIZE]; char nu_ip[NUI_BUFSIZE]; @@ -435,9 +436,19 @@ (cli_user(cptr))->host); #endif - if (HasHiddenHost(cptr)) - sr = make_nick_user_host(nu_realhost, cli_name(cptr), - (cli_user(cptr))->username, cli_user(cptr)->realhost); + if (IsAccount(cptr)) + { + if (HasHiddenHost(cptr)) + sr = make_nick_user_host(nu_realhost, cli_name(cptr), + cli_user(cptr)->username, cli_user(cptr)->realhost); + else + { + ircd_snprintf(0, tmphost, HOSTLEN, "%s.%s", + cli_user(cptr)->account, feature_str(FEAT_HIDDEN_HOST)); + sr = make_nick_user_host(nu_realhost, cli_name(cptr), + cli_user(cptr)->username, tmphost); + } + } for (tmp = chptr->banlist; tmp; tmp = tmp->next) { @@ -1118,7 +1129,8 @@ a HACK(4) notice will be sent if he would not have been supposed to join normally. */ if (IsLocalChannel(chptr->chname) && HasPriv(sptr, PRIV_WALK_LCHAN) && - !BadPtr(key) && compall("OVERRIDE", key) == 0) + !BadPtr(key) && compall("OVERRIDE", key) == 0 + && compall("OVERRIDE", chptr->mode.key) != 0) overrideJoin = MAGIC_OPER_OVERRIDE; if (chptr->mode.mode & MODE_INVITEONLY) @@ -2080,6 +2092,9 @@ state->parc--; state->max_args--; + if ((int)t_limit < 0) /* don't permit a negative limit */ + return; + if (!(state->flags & MODE_PARSE_WIPEOUT) && (!t_limit || t_limit == state->chptr->mode.limit)) return; @@ -2094,6 +2109,10 @@ return; } + /* Can't remove a limit that's not there */ + if (state->dir == MODE_DEL && !state->chptr->mode.limit) + return; + if (state->done & DONE_LIMIT) /* allow limit to be set only once */ return; state->done |= DONE_LIMIT; @@ -2152,7 +2171,7 @@ return; state->done |= DONE_KEY; - t_len = KEYLEN + 1; + t_len = KEYLEN; /* clean up the key string */ s = t_str; @@ -2410,7 +2429,7 @@ { if (state->flags & MODE_PARSE_SET && MyUser(state->sptr) && (len > (feature_int(FEAT_AVBANLEN) * feature_int(FEAT_MAXBANS)) || - count >= feature_int(FEAT_MAXBANS))) + count > feature_int(FEAT_MAXBANS))) { send_reply(state->sptr, ERR_BANLISTFULL, state->chptr->chname, ban->value.ban.banstr); @@ -2848,6 +2867,7 @@ joinbuf_join(struct JoinBuf *jbuf, struct Channel *chan, unsigned int flags) { unsigned int len; + int is_local; assert(0 != jbuf); @@ -2859,6 +2879,8 @@ return; } + is_local = IsLocalChannel(chan->chname); + if (jbuf->jb_type == JOINBUF_TYPE_PART || jbuf->jb_type == JOINBUF_TYPE_PARTALL) { @@ -2878,7 +2900,8 @@ * exactly the same logic, albeit somewhat more concise, as was in * the original m_part.c */ - if (jbuf->jb_type == JOINBUF_TYPE_PARTALL || IsLocalChannel(chan->chname)) /* got to remove user here */ + /* got to remove user here */ + if (jbuf->jb_type == JOINBUF_TYPE_PARTALL || is_local) remove_user_from_channel(jbuf->jb_source, chan); } else @@ -2903,7 +2926,7 @@ } if (jbuf->jb_type == JOINBUF_TYPE_PARTALL || - jbuf->jb_type == JOINBUF_TYPE_JOIN || IsLocalChannel(chan->chname)) + jbuf->jb_type == JOINBUF_TYPE_JOIN || is_local) return; /* don't send to remote */ /* figure out if channel name will cause buffer to be overflowed */ Index: ircdh/ircd/client.c diff -u ircdh/ircd/client.c:1.1 ircdh/ircd/client.c:1.2 --- ircdh/ircd/client.c:1.1 Sat Jan 18 11:09:04 2003 +++ ircdh/ircd/client.c Sat Jan 18 14:54:31 2003 @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: client.c,v 1.1 2003/01/18 19:09:04 zolty Exp $ + * $Id: client.c,v 1.2 2003/01/18 22:54:31 zolty Exp $ */ #include "config.h" @@ -106,109 +106,115 @@ } static struct { - unsigned int priv; + enum Priv priv; enum Feature feat; - unsigned int flag; + enum { + FEATFLAG_DISABLES_PRIV, + FEATFLAG_ENABLES_PRIV, + FEATFLAG_GLOBAL_OPERS, + FEATFLAG_LOCAL_OPERS, + FEATFLAG_ALL_OPERS + } flag; } feattab[] = { { - PRIV_WHOX, FEAT_LAST_F, (FLAGS_OPER | FLAGS_LOCOP)}, + PRIV_WHOX, FEAT_LAST_F, FEATFLAG_ALL_OPERS}, { - PRIV_DISPLAY, FEAT_LAST_F, (FLAGS_OPER | FLAGS_LOCOP)}, + PRIV_DISPLAY, FEAT_LAST_F, FEATFLAG_ALL_OPERS}, { - PRIV_CHAN_LIMIT, FEAT_OPER_NO_CHAN_LIMIT, (FLAGS_OPER | FLAGS_LOCOP)}, + PRIV_CHAN_LIMIT, FEAT_OPER_NO_CHAN_LIMIT, FEATFLAG_ALL_OPERS}, { - PRIV_MODE_LCHAN, FEAT_OPER_MODE_LCHAN, (FLAGS_OPER | FLAGS_LOCOP)}, + PRIV_MODE_LCHAN, FEAT_OPER_MODE_LCHAN, FEATFLAG_ALL_OPERS}, { - PRIV_LOCAL_OPMODE, FEAT_OPER_MODE_LCHAN, (FLAGS_OPER | FLAGS_LOCOP)}, + PRIV_LOCAL_OPMODE, FEAT_OPER_MODE_LCHAN, FEATFLAG_ALL_OPERS}, { - PRIV_WALK_LCHAN, FEAT_OPER_WALK_THROUGH_LMODES, (FLAGS_OPER | FLAGS_LOCOP)}, + PRIV_WALK_LCHAN, FEAT_OPER_WALK_THROUGH_LMODES, FEATFLAG_ALL_OPERS}, { - PRIV_DEOP_LCHAN, FEAT_NO_OPER_DEOP_LCHAN, (FLAGS_OPER | FLAGS_LOCOP)}, + PRIV_DEOP_LCHAN, FEAT_NO_OPER_DEOP_LCHAN, FEATFLAG_ALL_OPERS}, { - PRIV_SHOW_INVIS, FEAT_SHOW_INVISIBLE_USERS, (FLAGS_OPER | FLAGS_LOCOP)}, + PRIV_SHOW_INVIS, FEAT_SHOW_INVISIBLE_USERS, FEATFLAG_ALL_OPERS}, { - PRIV_SHOW_ALL_INVIS, FEAT_SHOW_ALL_INVISIBLE_USERS, - (FLAGS_OPER | FLAGS_LOCOP)}, + PRIV_SHOW_ALL_INVIS, FEAT_SHOW_ALL_INVISIBLE_USERS, FEATFLAG_ALL_OPERS}, { - PRIV_UNLIMIT_QUERY, FEAT_UNLIMIT_OPER_QUERY, (FLAGS_OPER | FLAGS_LOCOP)}, + PRIV_UNLIMIT_QUERY, FEAT_UNLIMIT_OPER_QUERY, FEATFLAG_ALL_OPERS}, { - PRIV_KILL, FEAT_LOCAL_KILL_ONLY, 0}, + PRIV_KILL, FEAT_LOCAL_KILL_ONLY, FEATFLAG_DISABLES_PRIV}, { - PRIV_GLINE, FEAT_CONFIG_OPERCMDS, ~0}, + PRIV_GLINE, FEAT_CONFIG_OPERCMDS, FEATFLAG_ENABLES_PRIV}, { - PRIV_JUPE, FEAT_CONFIG_OPERCMDS, ~0}, + PRIV_JUPE, FEAT_CONFIG_OPERCMDS, FEATFLAG_ENABLES_PRIV}, { - PRIV_OPMODE, FEAT_CONFIG_OPERCMDS, ~0}, + PRIV_OPMODE, FEAT_CONFIG_OPERCMDS, FEATFLAG_ENABLES_PRIV}, { - PRIV_BADCHAN, FEAT_CONFIG_OPERCMDS, ~0}, + PRIV_BADCHAN, FEAT_CONFIG_OPERCMDS, FEATFLAG_ENABLES_PRIV}, { - PRIV_PROPAGATE, FEAT_LAST_F, FLAGS_OPER}, + PRIV_PROPAGATE, FEAT_LAST_F, FEATFLAG_GLOBAL_OPERS}, { - PRIV_SEE_OPERS, FEAT_LAST_F, FLAGS_OPER}, + PRIV_SEE_OPERS, FEAT_LAST_F, FEATFLAG_GLOBAL_OPERS}, { - PRIV_KILL, FEAT_OPER_KILL, FLAGS_OPER}, + PRIV_KILL, FEAT_OPER_KILL, FEATFLAG_GLOBAL_OPERS}, { - PRIV_LOCAL_KILL, FEAT_OPER_KILL, FLAGS_OPER}, + PRIV_LOCAL_KILL, FEAT_OPER_KILL, FEATFLAG_GLOBAL_OPERS}, { - PRIV_REHASH, FEAT_OPER_REHASH, FLAGS_OPER}, + PRIV_REHASH, FEAT_OPER_REHASH, FEATFLAG_GLOBAL_OPERS}, { - PRIV_RESTART, FEAT_OPER_RESTART, FLAGS_OPER}, + PRIV_RESTART, FEAT_OPER_RESTART, FEATFLAG_GLOBAL_OPERS}, { - PRIV_DIE, FEAT_OPER_DIE, FLAGS_OPER}, + PRIV_DIE, FEAT_OPER_DIE, FEATFLAG_GLOBAL_OPERS}, { - PRIV_GLINE, FEAT_OPER_GLINE, FLAGS_OPER}, + PRIV_GLINE, FEAT_OPER_GLINE, FEATFLAG_GLOBAL_OPERS}, { - PRIV_LOCAL_GLINE, FEAT_OPER_LGLINE, FLAGS_OPER}, + PRIV_LOCAL_GLINE, FEAT_OPER_LGLINE, FEATFLAG_GLOBAL_OPERS}, { - PRIV_JUPE, FEAT_OPER_JUPE, FLAGS_OPER}, + PRIV_JUPE, FEAT_OPER_JUPE, FEATFLAG_GLOBAL_OPERS}, { - PRIV_LOCAL_JUPE, FEAT_OPER_LJUPE, FLAGS_OPER}, + PRIV_LOCAL_JUPE, FEAT_OPER_LJUPE, FEATFLAG_GLOBAL_OPERS}, { - PRIV_OPMODE, FEAT_OPER_OPMODE, FLAGS_OPER}, + PRIV_OPMODE, FEAT_OPER_OPMODE, FEATFLAG_GLOBAL_OPERS}, { - PRIV_LOCAL_OPMODE, FEAT_OPER_LOPMODE, FLAGS_OPER}, + PRIV_LOCAL_OPMODE, FEAT_OPER_LOPMODE, FEATFLAG_GLOBAL_OPERS}, { - PRIV_FORCE_OPMODE, FEAT_OPER_FORCE_OPMODE, FLAGS_OPER}, + PRIV_FORCE_OPMODE, FEAT_OPER_FORCE_OPMODE, FEATFLAG_GLOBAL_OPERS}, { - PRIV_FORCE_LOCAL_OPMODE, FEAT_OPER_FORCE_LOPMODE, FLAGS_OPER}, + PRIV_FORCE_LOCAL_OPMODE, FEAT_OPER_FORCE_LOPMODE, FEATFLAG_GLOBAL_OPERS}, { - PRIV_BADCHAN, FEAT_OPER_BADCHAN, FLAGS_OPER}, + PRIV_BADCHAN, FEAT_OPER_BADCHAN, FEATFLAG_GLOBAL_OPERS}, { - PRIV_LOCAL_BADCHAN, FEAT_OPER_LBADCHAN, FLAGS_OPER}, + PRIV_LOCAL_BADCHAN, FEAT_OPER_LBADCHAN, FEATFLAG_GLOBAL_OPERS}, { - PRIV_SET, FEAT_OPER_SET, FLAGS_OPER}, + PRIV_SET, FEAT_OPER_SET, FEATFLAG_GLOBAL_OPERS}, { - PRIV_SEE_CHAN, FEAT_OPERS_SEE_IN_SECRET_CHANNELS, FLAGS_OPER}, + PRIV_SEE_CHAN, FEAT_OPERS_SEE_IN_SECRET_CHANNELS, FEATFLAG_GLOBAL_OPERS}, { - PRIV_WIDE_GLINE, FEAT_OPER_WIDE_GLINE, FLAGS_OPER}, + PRIV_WIDE_GLINE, FEAT_OPER_WIDE_GLINE, FEATFLAG_GLOBAL_OPERS}, { - PRIV_LOCAL_KILL, FEAT_LOCOP_KILL, FLAGS_LOCOP}, + PRIV_LOCAL_KILL, FEAT_LOCOP_KILL, FEATFLAG_LOCAL_OPERS}, { - PRIV_REHASH, FEAT_LOCOP_REHASH, FLAGS_LOCOP}, + PRIV_REHASH, FEAT_LOCOP_REHASH, FEATFLAG_LOCAL_OPERS}, { - PRIV_RESTART, FEAT_LOCOP_RESTART, FLAGS_LOCOP}, + PRIV_RESTART, FEAT_LOCOP_RESTART, FEATFLAG_LOCAL_OPERS}, { - PRIV_DIE, FEAT_LOCOP_DIE, FLAGS_LOCOP}, + PRIV_DIE, FEAT_LOCOP_DIE, FEATFLAG_LOCAL_OPERS}, { - PRIV_LOCAL_GLINE, FEAT_LOCOP_LGLINE, FLAGS_LOCOP}, + PRIV_LOCAL_GLINE, FEAT_LOCOP_LGLINE, FEATFLAG_LOCAL_OPERS}, { - PRIV_LOCAL_JUPE, FEAT_LOCOP_LJUPE, FLAGS_LOCOP}, + PRIV_LOCAL_JUPE, FEAT_LOCOP_LJUPE, FEATFLAG_LOCAL_OPERS}, { - PRIV_LOCAL_OPMODE, FEAT_LOCOP_LOPMODE, FLAGS_LOCOP}, + PRIV_LOCAL_OPMODE, FEAT_LOCOP_LOPMODE, FEATFLAG_LOCAL_OPERS}, { - PRIV_FORCE_LOCAL_OPMODE, FEAT_LOCOP_FORCE_LOPMODE, FLAGS_LOCOP}, + PRIV_FORCE_LOCAL_OPMODE, FEAT_LOCOP_FORCE_LOPMODE, FEATFLAG_LOCAL_OPERS}, { - PRIV_LOCAL_BADCHAN, FEAT_LOCOP_LBADCHAN, FLAGS_LOCOP}, + PRIV_LOCAL_BADCHAN, FEAT_LOCOP_LBADCHAN, FEATFLAG_LOCAL_OPERS}, { - PRIV_SET, FEAT_LOCOP_SET, FLAGS_LOCOP}, + PRIV_SET, FEAT_LOCOP_SET, FEATFLAG_LOCAL_OPERS}, { - PRIV_SEE_CHAN, FEAT_LOCOP_SEE_IN_SECRET_CHANNELS, FLAGS_LOCOP}, + PRIV_SEE_CHAN, FEAT_LOCOP_SEE_IN_SECRET_CHANNELS, FEATFLAG_LOCAL_OPERS}, { - PRIV_WIDE_GLINE, FEAT_LOCOP_WIDE_GLINE, FLAGS_LOCOP}, + PRIV_WIDE_GLINE, FEAT_LOCOP_WIDE_GLINE, FEATFLAG_LOCAL_OPERS}, { - 0, FEAT_LAST_F, 0} + PRIV_LAST_PRIV, FEAT_LAST_F, 0} }; + /* client_set_privs(struct Client* client) * * Sets the privileges for opers. @@ -236,22 +242,34 @@ /* This sequence is temporary until the .conf is carefully rewritten */ - for (i = 0; feattab[i].priv; i++) + for (i = 0; feattab[i].priv != PRIV_LAST_PRIV; i++) { - if (feattab[i].flag == 0) - { - if (feature_bool(feattab[i].feat)) - PrivSet(&antiprivs, feattab[i].priv); - } - else if (feattab[i].flag == ~0) + if (feattab[i].flag == FEATFLAG_ENABLES_PRIV) { if (!feature_bool(feattab[i].feat)) PrivSet(&antiprivs, feattab[i].priv); } - else if (cli_flags(client) & feattab[i].flag) + else if (feattab[i].feat == FEAT_LAST_F || feature_bool(feattab[i].feat)) { - if (feattab[i].feat == FEAT_LAST_F || feature_bool(feattab[i].feat)) - PrivSet(&privs, feattab[i].priv); + if (feattab[i].flag == FEATFLAG_DISABLES_PRIV) + { + PrivSet(&antiprivs, feattab[i].priv); + } + else if (feattab[i].flag == FEATFLAG_ALL_OPERS) + { + if (IsAnOper(client)) + PrivSet(&privs, feattab[i].priv); + } + else if (feattab[i].flag == FEATFLAG_GLOBAL_OPERS) + { + if (IsOper(client)) + PrivSet(&privs, feattab[i].priv); + } + else if (feattab[i].flag == FEATFLAG_LOCAL_OPERS) + { + if (IsLocOp(client)) + PrivSet(&privs, feattab[i].priv); + } } } Index: ircdh/ircd/ircd.c diff -u ircdh/ircd/ircd.c:1.8 ircdh/ircd/ircd.c:1.9 --- ircdh/ircd/ircd.c:1.8 Sat Jan 18 11:53:49 2003 +++ ircdh/ircd/ircd.c Sat Jan 18 14:54:31 2003 @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: ircd.c,v 1.8 2003/01/18 19:53:49 zolty Exp $ + * $Id: ircd.c,v 1.9 2003/01/18 22:54:31 zolty Exp $ */ #include "config.h" @@ -372,7 +372,7 @@ Debug((DEBUG_DEBUG, "check_pings(%s)=status:%s limit: %d current: %d", cli_name(cptr), - (cli_flags(cptr) & FLAGS_PINGSENT) ? "[Ping Sent]" : "[]", + HasFlag(cptr, FLAG_PINGSENT) ? "[Ping Sent]" : "[]", max_ping, (int)(CurrentTime - cli_lasttime(cptr)))); @@ -420,12 +420,12 @@ continue; } - if (!(cli_flags(cptr) & FLAGS_PINGSENT)) + if (!HasFlag(cptr, FLAG_PINGSENT)) { /* If we havent PINGed the connection and we havent heard from it in a * while, PING it to make sure it is still alive. */ - cli_flags(cptr) |= FLAGS_PINGSENT; + SetFlag(cptr, FLAG_PINGSENT); /* If we're late in noticing don't hold it against them :) */ cli_lasttime(cptr) = CurrentTime - max_ping; @@ -435,14 +435,8 @@ else { char *asll_ts = militime_float(NULL); -#ifdef P09_SUPPORT - if (Protocol(cptr) < 10) - sendcmdto_one(&me, CMD_PING, cptr, "!%s %s %s", asll_ts, - cli_name(cptr), asll_ts); - else -#endif - sendcmdto_one(&me, CMD_PING, cptr, "!%s %s %s", asll_ts, - cli_name(cptr), asll_ts); + sendcmdto_one(&me, CMD_PING, cptr, "!%s %s %s", asll_ts, + cli_name(cptr), asll_ts); } } Index: ircdh/ircd/ircd_alloc.c diff -u ircdh/ircd/ircd_alloc.c:1.2 ircdh/ircd/ircd_alloc.c:1.3 --- ircdh/ircd/ircd_alloc.c:1.2 Sat Jan 18 11:09:05 2003 +++ ircdh/ircd/ircd_alloc.c Sat Jan 18 14:54:31 2003 @@ -19,13 +19,14 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: ircd_alloc.c,v 1.2 2003/01/18 19:09:05 zolty Exp $ + * $Id: ircd_alloc.c,v 1.3 2003/01/18 22:54:31 zolty Exp $ */ #include "config.h" #include "ircd_alloc.h" #include "ircd_string.h" #include "s_debug.h" +#include <string.h> #include <assert.h> @@ -47,29 +48,104 @@ noMemHandler = handler; } +#if defined(FROBONFREE) || defined(FROBONMALLOC) +static void memfrob(void *ptr, size_t size) +{ + unsigned char *p = ptr, *ep = p + size - 4; + while (p <= ep) + { + *(unsigned long *)p = 0xDEADBEEF; + p += 4; + } + switch (ep - p) + { + case 3: + *(unsigned short *)p = 0xDEAD; + p[2] = 0xBE; + return; + case 2: + *(unsigned short *)p = 0xDEAD; + return; + case 1: + *p++ = 0xDE; + return; + } + return; +} +#endif + void *MyMalloc(size_t size) { - void *p = malloc(size); + void *p = +#ifdef FROBONFREE + malloc(size + sizeof(size_t)); +#else + malloc(size); +#endif if (!p) (*noMemHandler) (); +#ifdef FROBONFREE + *(size_t *)p = size; + p = ((size_t *)p) + 1; +#endif +#ifdef FROBONMALLOC + memfrob(p, size); +#endif return p; } -void *MyRealloc(void *p, size_t size) +void *MyRealloc(void *x, size_t size) { - void *x = realloc(p, size); +#ifdef FROBONFREE + size_t old_size = ((size_t *)x)[-1]; + if (old_size > size) + memfrob(((char *)x) + size, old_size - size); + x = realloc(((size_t *)x) - 1, size + sizeof(size_t)); +#else + x = realloc(x, size); +#endif if (!x) (*noMemHandler) (); + /* Both are needed in all cases to work with realloc... */ +#if defined(FROBONMALLOC) && defined(FROBONFREE) + if (old_size < size) + memfrob(((char *)x) + old_size, size - old_size); +#endif +#ifdef FROBONFREE + *(size_t *)x = size; + x = ((size_t *)x) + 1; +#endif return x; } void *MyCalloc(size_t nelem, size_t size) { - void *p = calloc(nelem, size); + void *p = +#ifdef FROBONFREE + malloc(nelem * size + sizeof(size_t)); +#else + malloc(nelem * size); +#endif if (!p) (*noMemHandler) (); +#ifdef FROBONFREE + *((size_t *)p) = nelem * size; + p = ((size_t *)p) + 1; +#endif + memset(p, 0, size * nelem); return p; } + +#ifdef FROBONFREE +void MyFrobulatingFree(void *p) +{ + size_t *stp = (size_t *)p; + if (p == NULL) + return; + memfrob(p, stp[-1]); + free(stp - 1); +} +#endif #else /* defined(MDEBUG) */ /* Index: ircdh/ircd/ircd_features.c diff -u ircdh/ircd/ircd_features.c:1.1 ircdh/ircd/ircd_features.c:1.2 --- ircdh/ircd/ircd_features.c:1.1 Sat Jan 18 11:09:05 2003 +++ ircdh/ircd/ircd_features.c Sat Jan 18 14:54:31 2003 @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: ircd_features.c,v 1.1 2003/01/18 19:09:05 zolty Exp $ + * $Id: ircd_features.c,v 1.2 2003/01/18 22:54:31 zolty Exp $ */ #include "config.h" @@ -31,7 +31,7 @@ #include "ircd_reply.h" #include "ircd_string.h" #include "match.h" -//#include "motd.h" +#include "motd.h" #include "msg.h" #include "numeric.h" #include "numnicks.h" @@ -39,7 +39,7 @@ #include "s_bsd.h" #include "s_debug.h" #include "s_misc.h" -//#include "s_stats.h" +#include "s_stats.h" #include "send.h" #include "struct.h" #include "support.h" @@ -266,20 +266,21 @@ F_B(WALLOPS_OPER_ONLY, 0, 0, 0), F_B(NODNS, 0, 0, 0), F_N(RANDOM_SEED, FEAT_NODISP, random_seed_set, 0, 0, 0, 0, 0, 0), -// F_S(DEFAULT_LIST_PARAM, FEAT_NULL, 0, list_set_default), + F_S(DEFAULT_LIST_PARAM, FEAT_NULL, 0, list_set_default), F_I(NICKNAMEHISTORYLENGTH, 0, 800, whowas_realloc), - F_B(HOST_HIDING, 0, 0, 0), + F_B(HOST_HIDING, 0, 1, 0), F_S(HIDDEN_HOST, FEAT_CASE, "users.undernet.org", 0), F_S(HIDDEN_IP, 0, "127.0.0.1", 0), F_B(CONNEXIT_NOTICES, 0, 0, 0), + F_B(AUTOHIDE, 0, 1, 0), /* features that probably should not be touched */ - F_I(KILLCHASETIMELIMIT, 0, 30, 0), F_I(MAXCHANNELSPERUSER, 0, 10, 0), F_I(AVBANLEN, 0, 40, 0), F_I(MAXBANS, 0, 30, 0), F_I(MAXSILES, 0, 15, 0), F_I(HANGONGOODLINK, 0, 300, 0), F_I(HANGONRETRYDELAY, 0, 10, 0), F_I(CONNECTTIMEOUT, 0, 90, 0), F_I(TIMESEC, 0, 60, 0), F_I(MAXIMUM_LINKS, 0, 1, init_class), /* reinit class 0 as needed */ + F_I(KILLCHASETIMELIMIT, 0, 30, 0), F_I(MAXCHANNELSPERUSER, 0, 10, 0), F_I(AVBANLEN, 0, 40, 0), F_I(MAXBANS, 0, 45, 0), F_I(MAXSILES, 0, 15, 0), F_I(HANGONGOODLINK, 0, 300, 0), F_I(HANGONRETRYDELAY, 0, 10, 0), F_I(CONNECTTIMEOUT, 0, 90, 0), F_I(TIMESEC, 0, 60, 0), F_I(MAXIMUM_LINKS, 0, 1, init_class), /* reinit class 0 as needed */ F_I(PINGFREQUENCY, 0, 120, init_class), F_I(CONNECTFREQUENCY, 0, 600, init_class), F_I(DEFAULTMAXSENDQLENGTH, 0, 40000, init_class), F_I(GLINEMAXUSERCOUNT, 0, 20, 0), /* Some misc. default paths */ -// F_S(MPATH, FEAT_CASE | FEAT_MYOPER, "ircd.motd", motd_init), -// F_S(RPATH, FEAT_CASE | FEAT_MYOPER, "remote.motd", motd_init), + F_S(MPATH, FEAT_CASE | FEAT_MYOPER, "ircd.motd", motd_init), + F_S(RPATH, FEAT_CASE | FEAT_MYOPER, "remote.motd", motd_init), F_S(PPATH, FEAT_CASE | FEAT_MYOPER | FEAT_READ, "ircd.pid", 0), /* Networking features */ F_B(VIRTUAL_HOST, 0, 0, 0), Index: ircdh/ircd/list.c diff -u ircdh/ircd/list.c:1.7 ircdh/ircd/list.c:1.8 --- ircdh/ircd/list.c:1.7 Sat Jan 18 11:09:06 2003 +++ ircdh/ircd/list.c Sat Jan 18 14:54:31 2003 @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: list.c,v 1.7 2003/01/18 19:09:06 zolty Exp $ + * $Id: list.c,v 1.8 2003/01/18 22:54:31 zolty Exp $ */ #include "config.h" @@ -533,8 +533,8 @@ watchs.inuse, tmp = watchs.inuse * sizeof(struct Watch)); mem += tmp; inuse += watchs.inuse, - sendto_one(cptr, ":%s %d %s :Totals: inuse %d %d", - me.name, RPL_STATSDEBUG, name, inuse, mem); + send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Totals: inuse %d %d", + inuse, mem); } #endif Index: ircdh/ircd/m_account.c diff -u ircdh/ircd/m_account.c:1.1 ircdh/ircd/m_account.c:1.2 --- ircdh/ircd/m_account.c:1.1 Sat Jan 18 11:53:49 2003 +++ ircdh/ircd/m_account.c Sat Jan 18 14:54:31 2003 @@ -19,7 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: m_account.c,v 1.1 2003/01/18 19:53:49 zolty Exp $ + * $Id: m_account.c,v 1.2 2003/01/18 22:54:31 zolty Exp $ */ /* @@ -126,7 +126,7 @@ } ircd_strncpy(cli_user(acptr)->account, parv[2], ACCOUNTLEN); - hide_hostmask(acptr, FLAGS_ACCOUNT); + hide_hostmask(acptr, FLAG_ACCOUNT); sendcmdto_serv_butone(sptr, CMD_ACCOUNT, cptr, "%C %s", acptr, cli_user(acptr)->account); Index: ircdh/ircd/m_admin.c diff -u ircdh/ircd/m_admin.c:1.2 ircdh/ircd/m_admin.c:1.3 --- ircdh/ircd/m_admin.c:1.2 Sat Jan 18 11:09:06 2003 +++ ircdh/ircd/m_admin.c Sat Jan 18 14:54:31 2003 @@ -20,7 +20,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: m_admin.c,v 1.2 2003/01/18 19:09:06 zolty Exp $ + * $Id: m_admin.c,v 1.3 2003/01/18 22:54:31 zolty Exp $ */ /* @@ -114,10 +114,12 @@ */ int m_admin(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) { + struct Client *acptr; + assert(0 != cptr); assert(cptr == sptr); - if (parc > 1) + if (parc > 1 && (!(acptr = find_match_server(parv[1])) || !IsMe(acptr))) return send_reply(sptr, ERR_NOPRIVILEGES); return send_admin_info(sptr); Index: ircdh/ircd/m_away.c diff -u ircdh/ircd/m_away.c:1.2 ircdh/ircd/m_away.c:1.3 --- ircdh/ircd/m_away.c:1.2 Sat Jan 18 11:09:06 2003 +++ ircdh/ircd/m_away.c Sat Jan 18 14:54:31 2003 @@ -20,7 +20,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: m_away.c,v 1.2 2003/01/18 19:09:06 zolty Exp $ + * $Id: m_away.c,v 1.3 2003/01/18 22:54:31 zolty Exp $ */ /* @@ -158,13 +158,15 @@ int m_away(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) { char *away_message = parv[1]; + int was_away = cli_user(sptr)->away != 0; assert(0 != cptr); assert(cptr == sptr); if (user_set_away(cli_user(sptr), away_message)) { - sendcmdto_serv_butone(sptr, CMD_AWAY, cptr, ":%s", away_message); + if (!was_away) + sendcmdto_serv_butone(sptr, CMD_AWAY, cptr, ":%s", away_message); send_reply(sptr, RPL_NOWAWAY); } else Index: ircdh/ircd/m_burst.c diff -u ircdh/ircd/m_burst.c:1.2 ircdh/ircd/m_burst.c:1.3 --- ircdh/ircd/m_burst.c:1.2 Sat Jan 18 11:09:06 2003 +++ ircdh/ircd/m_burst.c Sat Jan 18 14:54:31 2003 @@ -20,7 +20,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: m_burst.c,v 1.2 2003/01/18 19:09:06 zolty Exp $ + * $Id: m_burst.c,v 1.3 2003/01/18 22:54:31 zolty Exp $ */ /* @@ -144,9 +144,6 @@ unsigned int parse_flags = (MODE_PARSE_FORCE | MODE_PARSE_BURST); int param, nickpos = 0, banpos = 0; char modestr[BUFSIZE], nickstr[BUFSIZE], banstr[BUFSIZE]; -#ifdef P09_SUPPORT - int ts_sent = 0; -#endif if (parc < 3) return protocol_violation(sptr, "Too few parameters for BURST"); @@ -173,6 +170,8 @@ continue; if (strchr(parv[param], 'i') || strchr(parv[param], 'k')) { + /* Clear any outstanding rogue invites */ + mode_invite_clear(chptr); for (member = chptr->members; member; member = nmember) { nmember = member->next_member; Index: ircdh/ircd/m_create.c diff -u ircdh/ircd/m_create.c:1.2 ircdh/ircd/m_create.c:1.3 --- ircdh/ircd/m_create.c:1.2 Sat Jan 18 11:09:06 2003 +++ ircdh/ircd/m_create.c Sat Jan 18 14:54:31 2003 @@ -20,7 +20,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: m_create.c,v 1.2 2003/01/18 19:09:06 zolty Exp $ + * $Id: m_create.c,v 1.3 2003/01/18 22:54:31 zolty Exp $ */ /* @@ -127,9 +127,6 @@ chanTS = atoi(parv[2]); - joinbuf_init(&join, sptr, cptr, JOINBUF_TYPE_JOIN, 0, 0); - joinbuf_init(&create, sptr, cptr, JOINBUF_TYPE_CREATE, 0, chanTS); - /* A create that didn't appear during a burst has that servers idea of * the current time. Use it for lag calculations. */ @@ -141,13 +138,17 @@ { static time_t rate; sendto_opmask_butone_ratelimited(0, SNO_NETWORK, &rate, - "Timestamp drift from %C (%is)", - cli_user(sptr)->server, chanTS - TStime()); - - /* If this server is >5 minutes fast, squit it */ - if (TStime() - chanTS < -5 * 60 * 60) - ... [truncated message content] |