diff -urN ircd-hybrid-6rc7/include/channel.h ircd-hybrid-6rc7+t11i/include/channel.h --- ircd-hybrid-6rc7/include/channel.h Fri Oct 6 04:00:55 2000 +++ ircd-hybrid-6rc7+t11i/include/channel.h Fri Dec 22 23:59:40 2000 @@ -56,7 +56,7 @@ struct Mode mode; char topic[TOPICLEN + 1]; #ifdef TOPIC_INFO - char topic_nick[NICKLEN + 1]; + char *topic_info; time_t topic_time; #endif int users; diff -urN ircd-hybrid-6rc7/include/client.h ircd-hybrid-6rc7+t11i/include/client.h --- ircd-hybrid-6rc7/include/client.h Fri Dec 1 06:28:46 2000 +++ ircd-hybrid-6rc7+t11i/include/client.h Fri Dec 22 23:59:40 2000 @@ -327,10 +327,11 @@ #define FLAGS_OPERWALL 0x0200 /* Operwalls */ #define FLAGS_INVISIBLE 0x0400 /* makes user invisible */ #define FLAGS_BOTS 0x0800 /* shows bots */ -#define FLAGS_EXTERNAL 0x1000 /* show servers introduced */ +#define FLAGS_EXTERNAL 0x1000 /* servers introduced and splitting */ /* user information flags, only settable by remote mode or local oper */ #define FLAGS_OPER 0x4000 /* Operator */ #define FLAGS_LOCOP 0x8000 /* Local operator -- SRB */ +#define FLAGS_ADMIN 0x10000 /* Server admin */ /* *sigh* overflow flags */ #define FLAGS2_RESTRICTED 0x0001 /* restricted client */ @@ -343,12 +344,13 @@ /* oper priv flags */ #define FLAGS2_OPER_GLOBAL_KILL 0x0020 /* oper can global kill */ #define FLAGS2_OPER_REMOTE 0x0040 /* oper can do squits/connects */ -#define FLAGS2_OPER_UNKLINE 0x0080 /* oper can use unkline */ +#define FLAGS2_OPER_UNKLINE 0x0080 /* oper can unkline and undline */ #define FLAGS2_OPER_GLINE 0x0100 /* oper can use gline */ #define FLAGS2_OPER_N 0x0200 /* oper can umode n */ #define FLAGS2_OPER_K 0x0400 /* oper can kill/kline */ #define FLAGS2_OPER_DIE 0x0800 /* oper can die */ #define FLAGS2_OPER_REHASH 0x1000 /* oper can rehash */ +#define FLAGS2_OPER_ADMIN 0x2000 /* oper is an admin */ #define FLAGS2_OPER_FLAGS (FLAGS2_OPER_GLOBAL_KILL | \ FLAGS2_OPER_REMOTE | \ FLAGS2_OPER_UNKLINE | \ @@ -356,7 +358,9 @@ FLAGS2_OPER_N | \ FLAGS2_OPER_K | \ FLAGS2_OPER_DIE | \ - FLAGS2_OPER_REHASH) + FLAGS2_OPER_REHASH | \ + FLAGS2_OPER_ADMIN) + /* ZIP_LINKS */ #define FLAGS2_ZIP 0x4000 /* (server) link is zipped */ @@ -374,11 +378,12 @@ #define FLAGS2_SENDQ_POP 0x400000 /* sendq exceeded (during list) */ -#define SEND_UMODES (FLAGS_INVISIBLE | FLAGS_OPER | FLAGS_WALLOP) +#define SEND_UMODES (FLAGS_INVISIBLE | FLAGS_OPER | FLAGS_WALLOP | \ + FLAGS_ADMIN) #define ALL_UMODES (SEND_UMODES | FLAGS_SERVNOTICE | FLAGS_CCONN | \ FLAGS_REJ | FLAGS_SKILL | FLAGS_FULL | FLAGS_SPY | \ FLAGS_NCHANGE | FLAGS_OPERWALL | FLAGS_DEBUG | \ - FLAGS_BOTS | FLAGS_EXTERNAL | FLAGS_LOCOP ) + FLAGS_BOTS | FLAGS_EXTERNAL | FLAGS_LOCOP | FLAGS_ADMIN) #ifndef OPER_UMODES #define OPER_UMODES (FLAGS_OPER | FLAGS_WALLOP | FLAGS_SERVNOTICE | \ @@ -494,6 +499,8 @@ #define IsOperDie(x) ((x)->flags2 & FLAGS2_OPER_DIE) #define SetOperRehash(x) ((x)->flags2 |= FLAGS2_OPER_REHASH) #define IsOperRehash(x) ((x)->flags2 & FLAGS2_OPER_REHASH) +#define SetOperAdmin(x) ((x)->flags2 |= FLAGS2_OPER_ADMIN) +#define IsSetOperAdmin(x) ((x)->flags2 & FLAGS2_OPER_ADMIN) #define CBurst(x) ((x)->flags2 & FLAGS2_CBURST) /* diff -urN ircd-hybrid-6rc7/include/config.h ircd-hybrid-6rc7+t11i/include/config.h --- ircd-hybrid-6rc7/include/config.h Mon Nov 27 04:11:47 2000 +++ ircd-hybrid-6rc7+t11i/include/config.h Fri Dec 22 23:59:40 2000 @@ -257,6 +257,13 @@ */ #define TOPIC_INFO +/* + * TOPIC_UH - ircnet style topic info + * if this is defined then the topic will show the n!u@h of the person + * who set the topic, not just the nick + */ +#undef TOPIC_UH + /* ANTI_NICK_FLOOD - prevents nick flooding * define if you want to block local clients from nickflooding */ @@ -333,7 +340,15 @@ * Members of the development team were split on supporting the * default here. */ -#define STATS_NOTICE +#undef STATS_NOTICE + +/* + * STATS_P_NOTICE + * + * If you don't like stats_notice, but still want your opers + * to be able to respond to /stats p, then define this. + */ +#define STATS_P_NOTICE /* WHOIS_NOTICE - Shows a notice to an oper when a user does a * /whois on them @@ -710,6 +725,13 @@ #undef NO_PRIORITY +/* + * QUIET_IF_BANNED + * define this if you don't want banned peolpe who're not opped or + * voiced to be able to talk in a channel. + */ +#undef QUIET_IF_BANNED + /* STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP */ /* You shouldn't change anything below this line, unless absolutely needed. */ @@ -965,6 +987,13 @@ * As configured here, a GLINE will last 12 hours */ #define GLINE_TIME (12*3600) + +/* GLINE_STRICT_VOTE - Define this if you want your server to + * be strict about opers voting more than once for G-Lines. + * Recommended if you don't like opers with multiple G flags + * triggering G-lines. + */ +#define GLINE_STRICT_VOTE /* ----------------- archaic and/or broken section -------------------- */ #undef DNS_DEBUG diff -urN ircd-hybrid-6rc7/include/config.h.dist ircd-hybrid-6rc7+t11i/include/config.h.dist --- ircd-hybrid-6rc7/include/config.h.dist Mon Nov 27 04:11:48 2000 +++ ircd-hybrid-6rc7+t11i/include/config.h.dist Fri Dec 22 23:59:40 2000 @@ -257,6 +257,13 @@ */ #define TOPIC_INFO +/* + * TOPIC_UH - ircnet style topic info + * if this is defined then the topic will show the n!u@h of the person + * who set the topic, not just the nick + */ +#undef TOPIC_UH + /* ANTI_NICK_FLOOD - prevents nick flooding * define if you want to block local clients from nickflooding */ @@ -333,7 +340,15 @@ * Members of the development team were split on supporting the * default here. */ -#define STATS_NOTICE +#undef STATS_NOTICE + +/* + * STATS_P_NOTICE + * + * If you don't like stats_notice, but still want your opers + * to be able to respond to /stats p, then define this. + */ +#define STATS_P_NOTICE /* WHOIS_NOTICE - Shows a notice to an oper when a user does a * /whois on them @@ -710,6 +725,13 @@ #undef NO_PRIORITY +/* + * QUIET_IF_BANNED + * define this if you don't want banned peolpe who're not opped or + * voiced to be able to talk in a channel. + */ +#undef QUIET_IF_BANNED + /* STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP */ /* You shouldn't change anything below this line, unless absolutely needed. */ @@ -965,6 +987,13 @@ * As configured here, a GLINE will last 12 hours */ #define GLINE_TIME (12*3600) + +/* GLINE_STRICT_VOTE - Define this if you want your server to + * be strict about opers voting more than once for G-Lines. + * Recommended if you don't like opers with multiple G flags + * triggering G-lines. + */ +#define GLINE_STRICT_VOTE /* ----------------- archaic and/or broken section -------------------- */ #undef DNS_DEBUG diff -urN ircd-hybrid-6rc7/include/m_commands.h ircd-hybrid-6rc7+t11i/include/m_commands.h --- ircd-hybrid-6rc7/include/m_commands.h Sat Jul 31 03:44:44 1999 +++ ircd-hybrid-6rc7+t11i/include/m_commands.h Fri Dec 22 23:59:40 2000 @@ -33,8 +33,10 @@ extern int m_kline(struct Client *,struct Client *,int,char **); extern int m_unkline(struct Client *,struct Client *,int,char **); extern int m_dline(struct Client *,struct Client *,int,char **); +extern int m_undline(struct Client *,struct Client *,int,char **); extern int m_gline(struct Client *,struct Client *,int,char **); +extern int m_ungline(struct Client *,struct Client *,int,char **); extern int m_locops(struct Client *,struct Client *,int,char **); diff -urN ircd-hybrid-6rc7/include/m_gline.h ircd-hybrid-6rc7+t11i/include/m_gline.h --- ircd-hybrid-6rc7/include/m_gline.h Fri Aug 25 01:20:41 2000 +++ ircd-hybrid-6rc7+t11i/include/m_gline.h Fri Dec 22 23:59:40 2000 @@ -44,6 +44,7 @@ extern struct ConfItem* find_is_glined(const char *, const char *); extern void flush_glines(void); extern void report_glines(struct Client *); +extern int remove_gline_match(const char* user, const char* host); typedef struct gline_pending { diff -urN ircd-hybrid-6rc7/include/m_info.h ircd-hybrid-6rc7+t11i/include/m_info.h --- ircd-hybrid-6rc7/include/m_info.h Fri Nov 24 18:51:13 2000 +++ ircd-hybrid-6rc7+t11i/include/m_info.h Fri Dec 22 23:59:40 2000 @@ -221,6 +221,12 @@ { "F_LINES_OPER_ONLY", "OFF", 0, "Allow only Operators to use STATS F" }, #endif /* F_LINES_OPER_ONLY */ +#ifdef GLINE_STRICT_VOTE + { "GLINE_STRICT_VOTE", "ON", 0, "Prevent opers voting twice on Glines" }, +#else + { "GLINE_STRICT_VOTE", "OFF", 0, "Prevent opers voting twice on Glines" }, +#endif /* GLINE_STRICT_VOTE */ + #ifdef GLINE_TIME { "GLINE_TIME", "", GLINE_TIME, "Expire Time for Glines" }, #else @@ -502,6 +508,12 @@ { "PRESERVE_CHANNEL_ON_SPLIT", "OFF", 0, "Preserve Channel Modes During a NetSplit" }, #endif /* PRESERVE_CHANNEL_ON_SPLIT */ +#ifdef QUIET_IF_BANNED + { "QUIET_IF_BANNED", "ON", 0, "Don't let banned people talk in channels" }, +#else + { "QUIET_IF_BANNED", "OFF", 0, "Don't let banned people talk in channels" }, +#endif + #ifdef REJECT_HOLD { "REJECT_HOLD", "ON", 0, "Do not Dump a K-lined Client immediately" }, #else @@ -606,6 +618,12 @@ { "STATS_NOTICE", "OFF", 0, "Show Operators when a Client uses STATS" }, #endif /* STATS_NOTICE */ +#ifdef STATS_P_NOTICE + { "STATS_P_NOTICE", "ON", 0, "Show Operators when a Client uses STATS p"}, +#else + { "STATS_P_NOTICE", "OFF", 0, "Show Operators when a Client uses STATS p"}, +#endif + { "TIMESEC", "", TIMESEC, "Time Interval to Wait Before Checking Pings" }, #ifdef TOPIC_INFO @@ -614,14 +632,14 @@ { "TOPIC_INFO", "OFF", 0, "Show Who Set a Topic and When" }, #endif /* TOPIC_INFO */ +#ifdef TOPIC_UH + { "TOPIC_UH", "ON", 0, "Include user@host for TOPIC_INFO" }, +#else + { "TOPIC_UH", "OFF", 0, "Include user@host for TOPIC_INFO" }, +#endif + { "TS_MAX_DELTA", "", TS_MAX_DELTA, "Maximum Allowed TS Delta from another Server" }, { "TS_WARN_DELTA", "", TS_WARN_DELTA, "Maximum TS Delta before Sending Warning" }, - -#ifdef USE_IP_I_LINE_FIRST - { "USE_IP_I_LINE_FIRST", "ON", 0, "Search IP Ilines First" }, -#else - { "USE_IP_I_LINE_FIRST", "OFF", 0, "Search IP Ilines First" }, -#endif /* USE_IP_I_LINE_FIRST */ #ifdef USE_RCS { "USE_RCS", "ON", 0, "Use \"ci\" to Keep RCS Control" }, diff -urN ircd-hybrid-6rc7/include/msg.h ircd-hybrid-6rc7+t11i/include/msg.h --- ircd-hybrid-6rc7/include/msg.h Thu Nov 9 03:46:52 2000 +++ ircd-hybrid-6rc7+t11i/include/msg.h Fri Dec 22 23:59:40 2000 @@ -115,11 +115,12 @@ #define MSG_KLINE "KLINE" /* KLINE */ #define MSG_UNKLINE "UNKLINE" /* UNKLINE */ #define MSG_DLINE "DLINE" /* DLINE */ +#define MSG_UNDLINE "UNDLINE" /* UNDLINE */ #define MSG_HTM "HTM" /* HTM */ #define MSG_SET "SET" /* SET */ #define MSG_GLINE "GLINE" /* GLINE */ - +#define MSG_UNGLINE "UNGLINE" /* UNGLINE */ #define MSG_LOCOPS "LOCOPS" /* LOCOPS */ #ifdef LWALLOPS @@ -238,7 +239,9 @@ { MSG_KLINE, m_kline, 0, MAXPARA, 1, 0, 0, 0L }, { MSG_UNKLINE, m_unkline, 0, MAXPARA, 1, 0, 0, 0L }, { MSG_DLINE, m_dline, 0, MAXPARA, 1, 0, 0, 0L }, + { MSG_UNDLINE, m_undline, 0, MAXPARA, 1, 0, 0, 0L }, { MSG_GLINE, m_gline, 0, MAXPARA, 1, 0, 0, 0L }, + { MSG_UNGLINE, m_ungline, 0, MAXPARA, 1, 0, 0, 0L }, { MSG_HASH, m_hash, 0, MAXPARA, 1, 0, 0, 0L }, { MSG_DNS, m_dns, 0, MAXPARA, 1, 0, 0, 0L }, { MSG_REHASH, m_rehash, 0, MAXPARA, 1, 0, 0, 0L }, diff -urN ircd-hybrid-6rc7/include/numeric.h ircd-hybrid-6rc7+t11i/include/numeric.h --- ircd-hybrid-6rc7/include/numeric.h Thu Dec 23 07:10:51 1999 +++ ircd-hybrid-6rc7+t11i/include/numeric.h Fri Dec 22 23:59:40 2000 @@ -140,6 +140,7 @@ #define RPL_YOURHOST 002 #define RPL_CREATED 003 #define RPL_MYINFO 004 +#define RPL_ISUPPORT 005 /* * Numeric replies from server commands. @@ -214,6 +215,8 @@ #define RPL_TEXT 304 #define RPL_UNAWAY 305 #define RPL_NOWAWAY 306 + +#define RPL_WHOISADMIN 308 #define RPL_WHOISUSER 311 #define RPL_WHOISSERVER 312 diff -urN ircd-hybrid-6rc7/include/patchlevel.h ircd-hybrid-6rc7+t11i/include/patchlevel.h --- ircd-hybrid-6rc7/include/patchlevel.h Tue Nov 21 06:49:23 2000 +++ ircd-hybrid-6rc7+t11i/include/patchlevel.h Sat Dec 23 00:02:37 2000 @@ -17,5 +17,5 @@ */ #ifndef PATCHLEVEL -#define PATCHLEVEL "2.8/hybrid-6rc7" +#define PATCHLEVEL "2.8/hybrid-6rc7+t11i" #endif diff -urN ircd-hybrid-6rc7/include/s_conf.h ircd-hybrid-6rc7+t11i/include/s_conf.h --- ircd-hybrid-6rc7/include/s_conf.h Fri Dec 1 06:28:47 2000 +++ ircd-hybrid-6rc7+t11i/include/s_conf.h Fri Dec 22 23:59:40 2000 @@ -327,6 +327,7 @@ #define CONF_OPER_K 32 #define CONF_OPER_REHASH 64 #define CONF_OPER_DIE 128 +#define CONF_OPER_ADMIN 256 typedef struct { @@ -406,6 +407,7 @@ extern struct ConfItem* find_is_klined(const char* host, const char* name, unsigned long ip); +extern struct ConfItem* find_tkline(const char*, const char*, unsigned long); extern char* show_iline_prefix(struct Client *,struct ConfItem *,char *); extern void get_printable_conf(struct ConfItem *, char **, char **, char **, diff -urN ircd-hybrid-6rc7/include/supported.h ircd-hybrid-6rc7+t11i/include/supported.h --- ircd-hybrid-6rc7/include/supported.h Thu Jan 1 01:00:00 1970 +++ ircd-hybrid-6rc7+t11i/include/supported.h Fri Dec 22 23:59:40 2000 @@ -0,0 +1,54 @@ +/* IRC - Internet Relay Chat, include/supported.h + * Copyright (C) 1999 Perry Lorier + * + * 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, 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., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Description: This file has the featureset that ircd-hybrid announces + * on connecting a client and /version. It's in this .h + * because it's likely to be appended to frequently and + * s_user.h is included by basically everyone. + */ + +#ifndef INCLUDED_supported_h +#define INCLUDED_supported_h + +#ifndef INCLUDED_config_h +#include "config.h" +#endif +#ifndef INCLUDED_ircd_defs_h +#include "ircd_defs.h" +#endif +#ifndef INCLDUED_channel_h +#include "channel.h" +#endif + +#define FEATURES \ + "EXEMPTS"\ + " DENIES"\ + " KNOCK"\ + " MODES=%i" \ + " MAXCHANNELS=%i" \ + " MAXBANS=%i" \ + " NICKLEN=%i" \ + " TOPICLEN=%i" \ + " KICKLEN=%i" \ + " CHANTYPES=%s" \ + " PREFIX=%s" + +#define FEATURESVALUES MAXMODEPARAMS,MAXCHANNELSPERUSER,MAXBANS, \ + NICKLEN,TOPICLEN,TOPICLEN,"#&","@+" + +#endif /* INCLUDED_supported_h */ + diff -urN ircd-hybrid-6rc7/opers.txt ircd-hybrid-6rc7+t11i/opers.txt --- ircd-hybrid-6rc7/opers.txt Fri Dec 22 02:28:08 2000 +++ ircd-hybrid-6rc7+t11i/opers.txt Fri Dec 22 23:59:40 2000 @@ -23,7 +23,8 @@ * +d - Can see server debug messages. * +n - Can see client nick changes. * +b - Can see possible bot warnings. - * +x - Can see new server introduction messages. + * +x - Can see server introduction and split messages. + * +a - Is marked as a server admin in whois. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -192,6 +193,9 @@ In order to use rather than , must be on your server. ++ UNDLINE - UNDLINE + Will attempt to undline the given + + HTM - HTM [option] When no [option] is given, HTM shows the current High Traffic Mode rate and whether HTM is on or off. @@ -255,6 +259,12 @@ It takes three different opers on three different servers to do the same GLINE within a short interval, to have a GLINE triggered for a compiled time of hours. + ++ UNGLINE - UNGLINE + -- if compiled with GLINE -- + Will attempt to remove gline matching + This will only remove the gline from YOUR server, it + does not try to remove it globally. + TESTLINE - TESTLINE |ip -- Looks up given user@host or user@ip diff -urN ircd-hybrid-6rc7/src/.depend ircd-hybrid-6rc7+t11i/src/.depend --- ircd-hybrid-6rc7/src/.depend Wed Dec 29 03:28:47 1999 +++ ircd-hybrid-6rc7+t11i/src/.depend Fri Dec 22 23:59:40 2000 @@ -12,7 +12,7 @@ ../include/dbuf.h ../include/common.h ../include/ircd.h \ ../include/list.h ../include/numeric.h ../include/s_conf.h \ ../include/fileio.h ../include/motd.h ../include/send.h \ - ../include/struct.h + ../include/struct.h ../include/s_debug.h client.o: client.c ../include/client.h ../include/config.h \ ../include/setup.h ../include/ircd_defs.h ../include/dbuf.h \ ../include/class.h ../include/blalloc.h ../include/channel.h \ @@ -22,9 +22,10 @@ ../include/res.h ../include/s_bsd.h ../include/s_conf.h \ ../include/fileio.h ../include/motd.h ../include/s_log.h \ ../include/s_misc.h ../include/s_serv.h ../include/send.h \ - ../include/struct.h ../include/whowas.h + ../include/struct.h ../include/whowas.h ../include/s_debug.h dbuf.o: dbuf.c ../include/dbuf.h ../include/config.h \ - ../include/setup.h ../include/common.h ../include/irc_string.h + ../include/setup.h ../include/common.h ../include/irc_string.h \ + ../include/ircd_defs.h dline_conf.o: dline_conf.c ../include/dline_conf.h ../include/class.h \ ../include/client.h ../include/config.h ../include/setup.h \ ../include/ircd_defs.h ../include/dbuf.h ../include/common.h \ @@ -46,8 +47,10 @@ ../include/motd.h ../include/channel.h ../include/client.h \ ../include/dbuf.h ../include/common.h ../include/hash.h \ ../include/irc_string.h ../include/ircd.h ../include/numeric.h \ - ../include/send.h ../include/struct.h -irc_string.o: irc_string.c ../include/irc_string.h ../include/list.h + ../include/send.h ../include/struct.h ../include/s_debug.h +irc_string.o: irc_string.c ../include/irc_string.h \ + ../include/ircd_defs.h ../include/config.h ../include/setup.h \ + ../include/list.h ircd.o: ircd.c ../include/ircd.h ../include/config.h \ ../include/setup.h ../include/channel.h ../include/ircd_defs.h \ ../include/class.h ../include/client.h ../include/dbuf.h \ @@ -108,7 +111,7 @@ m_error.o: m_error.c ../include/m_commands.h ../include/config.h \ ../include/setup.h ../include/client.h ../include/ircd_defs.h \ ../include/dbuf.h ../include/common.h ../include/ircd.h \ - ../include/numeric.h ../include/send.h + ../include/numeric.h ../include/send.h ../include/s_debug.h m_gline.o: m_gline.c ../include/m_gline.h ../include/config.h \ ../include/setup.h ../include/ircd_defs.h ../include/channel.h \ ../include/client.h ../include/dbuf.h ../include/common.h \ @@ -229,12 +232,14 @@ ../include/irc_string.h ../include/ircd.h ../include/list.h \ ../include/numeric.h ../include/s_conf.h ../include/fileio.h \ ../include/motd.h ../include/s_serv.h ../include/s_stats.h \ - ../include/scache.h ../include/send.h ../include/struct.h + ../include/scache.h ../include/send.h ../include/struct.h \ + ../include/s_log.h m_set.o: m_set.c ../include/m_commands.h ../include/config.h \ ../include/setup.h ../include/client.h ../include/ircd_defs.h \ ../include/dbuf.h ../include/irc_string.h ../include/ircd.h \ ../include/numeric.h ../include/s_bsd.h ../include/s_serv.h \ - ../include/send.h ../include/common.h ../include/channel.h + ../include/send.h ../include/common.h ../include/channel.h \ + ../include/s_log.h m_squit.o: m_squit.c ../include/m_commands.h ../include/config.h \ ../include/setup.h ../include/client.h ../include/ircd_defs.h \ ../include/dbuf.h ../include/common.h ../include/irc_string.h \ @@ -254,7 +259,8 @@ m_svinfo.o: m_svinfo.c ../include/m_commands.h ../include/config.h \ ../include/setup.h ../include/client.h ../include/ircd_defs.h \ ../include/dbuf.h ../include/common.h ../include/irc_string.h \ - ../include/ircd.h ../include/numeric.h ../include/send.h + ../include/ircd.h ../include/numeric.h ../include/send.h \ + ../include/s_log.h m_time.o: m_time.c ../include/m_commands.h ../include/config.h \ ../include/setup.h ../include/client.h ../include/ircd_defs.h \ ../include/dbuf.h ../include/ircd.h ../include/numeric.h \ @@ -283,7 +289,8 @@ m_version.o: m_version.c ../include/m_commands.h ../include/config.h \ ../include/setup.h ../include/client.h ../include/ircd_defs.h \ ../include/dbuf.h ../include/ircd.h ../include/numeric.h \ - ../include/s_serv.h ../include/send.h + ../include/s_serv.h ../include/send.h ../include/supported.h \ + ../include/channel.h m_wallops.o: m_wallops.c ../include/m_commands.h ../include/config.h \ ../include/setup.h ../include/client.h ../include/ircd_defs.h \ ../include/dbuf.h ../include/ircd.h ../include/irc_string.h \ @@ -300,8 +307,8 @@ ../include/struct.h ../include/ircd.h ../include/numeric.h \ ../include/s_serv.h ../include/send.h ../include/list.h \ ../include/irc_string.h -match.o: match.c ../include/irc_string.h ../include/config.h \ - ../include/setup.h +match.o: match.c ../include/irc_string.h ../include/ircd_defs.h \ + ../include/config.h ../include/setup.h motd.o: motd.c ../include/motd.h ../include/ircd_defs.h \ ../include/config.h ../include/setup.h ../include/ircd.h \ ../include/s_bsd.h ../include/fileio.h ../include/res.h \ @@ -317,13 +324,14 @@ oratime.o: oratime.c ../include/oratime.h ../include/config.h \ ../include/setup.h numeric.o: numeric.c ../include/numeric.h ../include/config.h \ - ../include/setup.h ../include/irc_string.h ../include/common.h \ - messages.tab + ../include/setup.h ../include/irc_string.h ../include/ircd_defs.h \ + ../include/common.h messages.tab packet.o: packet.c ../include/packet.h ../include/client.h \ ../include/config.h ../include/setup.h ../include/ircd_defs.h \ ../include/dbuf.h ../include/common.h ../include/ircd.h \ ../include/list.h ../include/parse.h ../include/s_zip.h \ - ../zlib/zlib.h ../zlib/zconf.h ../zlib/setup.h ../include/struct.h + ../zlib/zlib.h ../zlib/zconf.h ../zlib/setup.h ../include/struct.h \ + ../include/irc_string.h parse.o: parse.c ../include/parse.h ../include/channel.h \ ../include/config.h ../include/setup.h ../include/ircd_defs.h \ ../include/client.h ../include/dbuf.h ../include/common.h \ @@ -335,7 +343,7 @@ ../include/setup.h ../include/ircd_defs.h ../include/dbuf.h \ ../include/common.h ../include/irc_string.h ../include/ircd.h \ ../include/numeric.h ../include/restart.h ../include/s_bsd.h \ - ../include/send.h ../include/struct.h + ../include/send.h ../include/struct.h ../include/s_debug.h restart.o: restart.c ../include/restart.h ../include/common.h \ ../include/ircd.h ../include/config.h ../include/setup.h \ ../include/send.h ../include/struct.h ../include/s_debug.h \ @@ -364,7 +372,7 @@ ../include/ircd.h ../include/list.h ../include/listener.h \ ../include/mtrie_conf.h ../include/numeric.h ../include/res.h \ ../include/s_bsd.h ../include/s_log.h ../include/send.h \ - ../include/struct.h + ../include/struct.h ../include/s_debug.h s_debug.o: s_debug.c ../include/s_debug.h ../include/channel.h \ ../include/config.h ../include/setup.h ../include/ircd_defs.h \ ../include/class.h ../include/client.h ../include/dbuf.h \ @@ -374,8 +382,8 @@ ../include/s_log.h ../include/scache.h ../include/send.h \ ../include/struct.h s_log.o: s_log.c ../include/s_log.h ../include/irc_string.h \ - ../include/ircd.h ../include/config.h ../include/setup.h \ - ../include/s_misc.h + ../include/ircd_defs.h ../include/config.h ../include/setup.h \ + ../include/ircd.h ../include/s_misc.h s_misc.o: s_misc.c ../include/s_misc.h ../include/client.h \ ../include/config.h ../include/setup.h ../include/ircd_defs.h \ ../include/dbuf.h ../include/common.h ../include/irc_string.h \ @@ -390,9 +398,10 @@ ../include/irc_string.h ../include/ircd.h ../include/list.h \ ../include/numeric.h ../include/res.h ../include/struct.h \ ../include/s_bsd.h ../include/s_conf.h ../include/fileio.h \ - ../include/motd.h ../include/s_stats.h ../include/s_user.h \ - ../include/s_zip.h ../zlib/zlib.h ../zlib/zconf.h ../zlib/setup.h \ - ../include/scache.h ../include/send.h + ../include/motd.h ../include/s_log.h ../include/s_stats.h \ + ../include/s_user.h ../include/s_zip.h ../zlib/zlib.h ../zlib/zconf.h \ + ../zlib/setup.h ../include/scache.h ../include/send.h \ + ../include/s_debug.h s_stats.o: s_stats.c ../include/s_stats.h ../include/config.h \ ../include/setup.h ../include/client.h ../include/ircd_defs.h \ ../include/dbuf.h ../include/irc_string.h ../include/ircd.h \ @@ -406,7 +415,8 @@ ../include/msg.h ../include/numeric.h ../include/s_bsd.h \ ../include/s_conf.h ../include/fileio.h ../include/s_log.h \ ../include/s_serv.h ../include/s_stats.h ../include/scache.h \ - ../include/send.h ../include/struct.h ../include/whowas.h + ../include/send.h ../include/struct.h ../include/supported.h \ + ../include/whowas.h s_zip.o: s_zip.c ../include/s_zip.h ../include/config.h \ ../include/setup.h ../zlib/zlib.h ../zlib/zconf.h ../zlib/setup.h \ ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \ @@ -423,7 +433,8 @@ ../include/m_commands.h ../include/numeric.h ../include/s_bsd.h \ ../include/s_serv.h ../include/s_zip.h ../zlib/zlib.h ../zlib/zconf.h \ ../zlib/setup.h ../include/sprintf_irc.h ../include/struct.h \ - ../include/s_conf.h ../include/fileio.h ../include/motd.h + ../include/s_conf.h ../include/fileio.h ../include/motd.h \ + ../include/s_debug.h ../include/s_log.h sprintf_irc.o: sprintf_irc.c ../include/sprintf_irc.h whowas.o: whowas.c ../include/whowas.h ../include/ircd_defs.h \ ../include/config.h ../include/setup.h ../include/client.h \ diff -urN ircd-hybrid-6rc7/src/channel.c ircd-hybrid-6rc7+t11i/src/channel.c --- ircd-hybrid-6rc7/src/channel.c Mon Nov 27 04:11:49 2000 +++ ircd-hybrid-6rc7+t11i/src/channel.c Fri Dec 22 23:59:41 2000 @@ -93,6 +93,7 @@ static void set_deopped(struct Client *,struct Channel *,int); static char *PartFmt = ":%s PART %s"; +static char *PartMsgFmt = ":%s PART %s :%s"; /* * some buffers for rebuilding channel/nick lists with ,'s */ @@ -783,10 +784,17 @@ lp = find_user_link(chptr->members, cptr); - if (chptr->mode.mode & MODE_MODERATED && - (!lp || !(lp->flags & (CHFL_CHANOP|CHFL_VOICE)))) + if (lp && lp->flags & (CHFL_CHANOP|CHFL_VOICE)) + return 0; + + if (chptr->mode.mode & MODE_MODERATED) return (MODE_MODERATED); +#ifdef QUIET_IF_BANNED + if (MyClient(cptr) && (is_banned(cptr, chptr) == CHFL_BAN)) + return (MODE_BAN); +#endif + if (chptr->mode.mode & MODE_NOPRIVMSGS && !lp) return (MODE_NOPRIVMSGS); @@ -881,7 +889,7 @@ } else if (*parabuf) send = 1; - if (count == 3) + if (count == MAXMODEPARAMS) send = 1; if (send) { @@ -891,7 +899,7 @@ *parabuf = '\0'; cp = modebuf; *cp++ = '+'; - if (count != 3) + if (count != MAXMODEPARAMS) { (void)strcpy(parabuf, name); *cp++ = flag; @@ -2330,7 +2338,7 @@ "User %s (%s@%s) is attempting to join locally juped channel %s", sptr->name, sptr->username, sptr->host,chptr->chname); - return (ERR_BADCHANNAME); + return (ERR_UNAVAILRESOURCE); } #endif @@ -2560,7 +2568,9 @@ channel = chptr->nextch; if (chptr->nextch) chptr->nextch->prevch = chptr->prevch; - +#ifdef TOPIC_INFO + MyFree(chptr->topic_info); +#endif #ifdef FLUD free_fluders(NULL, chptr); #endif @@ -2867,7 +2877,6 @@ void remove_empty_channels() { Link *tmp; - Link *obtmp; struct Channel *next_empty_channel; for(;empty_channel_list; @@ -2898,36 +2907,7 @@ while ((tmp = empty_channel_list->invites)) del_invite(tmp->value.cptr, empty_channel_list); - tmp = empty_channel_list->banlist; - while (tmp) - { - obtmp = tmp; - tmp = tmp->next; -#ifdef BAN_INFO - MyFree(obtmp->value.banptr->banstr); - MyFree(obtmp->value.banptr->who); - MyFree(obtmp->value.banptr); -#else - MyFree(obtmp->value.cp); -#endif - free_link(obtmp); - } - - tmp = empty_channel_list->exceptlist; - while (tmp) - { - obtmp = tmp; - tmp = tmp->next; -#ifdef BAN_INFO - MyFree(obtmp->value.banptr->banstr); - MyFree(obtmp->value.banptr->who); - MyFree(obtmp->value.banptr); -#else - MyFree(obtmp->value.cp); -#endif - free_link(obtmp); - } - empty_channel_list->banlist = empty_channel_list->exceptlist = NULL; + free_bans_exceptions_denies(empty_channel_list); if (empty_channel_list->prevch) empty_channel_list->prevch->nextch = empty_channel_list->nextch; @@ -2935,7 +2915,9 @@ channel = empty_channel_list->nextch; if (empty_channel_list->nextch) empty_channel_list->nextch->prevch = empty_channel_list->prevch; - +#ifdef TOPIC_INFO + MyFree(empty_channel_list->topic_info); +#endif #ifdef FLUD free_fluders(NULL, empty_channel_list); #endif @@ -3077,8 +3059,8 @@ while ((lp = sptr->user->channel)) { chptr = lp->value.chptr; - sendto_channel_butserv(chptr, sptr, PartFmt, - parv[0], chptr->chname); + sendto_channel_butserv(chptr, sptr, PartMsgFmt, + parv[0], chptr->chname, "Left all channels"); remove_user_from_channel(sptr, chptr, 0); } @@ -3348,7 +3330,7 @@ #ifdef TOPIC_INFO sendto_one(sptr, form_str(RPL_TOPICWHOTIME), me.name, parv[0], name, - chptr->topic_nick, + chptr->topic_info, chptr->topic_time); #endif } @@ -3368,6 +3350,7 @@ ** m_part ** parv[0] = sender prefix ** parv[1] = channel +** parv[2] = reason */ int m_part(struct Client *cptr, struct Client *sptr, @@ -3376,6 +3359,7 @@ { struct Channel *chptr; char *p, *name; + char *reason = NULL; if (parc < 2 || parv[1][0] == '\0') { @@ -3384,6 +3368,9 @@ return 0; } + if (parc > 2 && parv[2][0] != '\0') + reason = parv[2]; + name = strtoken( &p, parv[1], ","); #ifdef ANTI_SPAMBOT /* Dianora */ @@ -3448,10 +3435,20 @@ /* ** Remove user from the old channel (if any) */ - - sendto_match_servs(chptr, cptr, PartFmt, parv[0], name); - - sendto_channel_butserv(chptr, sptr, PartFmt, parv[0], name); + + if (reason && !can_send(sptr, chptr)) + { + sendto_match_servs(chptr, cptr, PartMsgFmt, + parv[0], name, reason); + sendto_channel_butserv(chptr, sptr, PartMsgFmt, + parv[0], name, reason); + } + else + { + sendto_match_servs(chptr, cptr, PartFmt, parv[0], name); + sendto_channel_butserv(chptr, sptr, PartFmt, parv[0], name); + } + remove_user_from_channel(sptr, chptr, 0); name = strtoken(&p, (char *)NULL, ","); } @@ -3839,11 +3836,19 @@ */ strncpy_irc(chptr->topic, topic, TOPICLEN); #ifdef TOPIC_INFO - /* - * XXX - this truncates the topic_nick if - * strlen(sptr->name) > NICKLEN - */ - strncpy_irc(chptr->topic_nick, sptr->name, NICKLEN); + MyFree(chptr->topic_info); +#ifdef TOPIC_UH + chptr->topic_info = + (char *)MyMalloc(strlen(sptr->name)+ + strlen(sptr->username)+ + strlen(sptr->host)+3); + ircsprintf(chptr->topic_info, "%s!%s@%s", + sptr->name, sptr->username, sptr->host); +#else + chptr->topic_info = + (char *)MyMalloc(strlen(sptr->name) + 1); + strncpy_irc(chptr->topic_info, sptr->name, NICKLEN); +#endif chptr->topic_time = CurrentTime; #endif sendto_match_servs(chptr, cptr,":%s TOPIC %s :%s", @@ -3870,7 +3875,7 @@ #ifdef TOPIC_INFO sendto_one(sptr, form_str(RPL_TOPICWHOTIME), me.name, parv[0], chptr->chname, - chptr->topic_nick, + chptr->topic_info, chptr->topic_time); #endif } diff -urN ircd-hybrid-6rc7/src/client.c ircd-hybrid-6rc7+t11i/src/client.c --- ircd-hybrid-6rc7/src/client.c Fri Dec 1 06:28:47 2000 +++ ircd-hybrid-6rc7+t11i/src/client.c Fri Dec 22 23:59:41 2000 @@ -520,6 +520,8 @@ { sendto_ops("No response from %s, closing link", get_client_name(cptr, FALSE)); + log(L_NOTICE, "No response from %s, closing link", + get_client_name(cptr, FALSE)); } /* * this is used for KILL lines with time restrictions @@ -664,6 +666,8 @@ { --Count.server; + sendto_realops_flags(FLAGS_EXTERNAL, "Server %s split from %s", + cptr->name, cptr->servptr->name); #ifdef NEED_SPLITCODE /* Don't bother checking for a split, if split code * is deactivated with server_split_recovery_time == 0 diff -urN ircd-hybrid-6rc7/src/m_gline.c ircd-hybrid-6rc7+t11i/src/m_gline.c --- ircd-hybrid-6rc7/src/m_gline.c Fri Dec 1 06:28:48 2000 +++ ircd-hybrid-6rc7+t11i/src/m_gline.c Fri Dec 22 23:59:41 2000 @@ -685,6 +685,58 @@ } /* + * remove_gline_match + * + * inputs - user@host + * output - 1 if successfully removed, otherwise 0 + * side effects - + */ +int remove_gline_match(const char* user, const char* host) +{ + aConfItem *kill_list_ptr; /* used for the link list only */ + aConfItem *last_list_ptr; + aConfItem *tmp_list_ptr; + + if(glines) + { + kill_list_ptr = last_list_ptr = glines; + + while(kill_list_ptr) + { + if(!irccmp(kill_list_ptr->host,host) && + !irccmp(kill_list_ptr->name,user)) /* this gline matches */ + { + if(glines == kill_list_ptr) + { + /* Its pointing to first one in link list*/ + /* so, bypass this one, remember bad things can happen + if you try to use an already freed pointer.. */ + + glines = last_list_ptr = tmp_list_ptr = + kill_list_ptr->next; + } + else + { + /* its in the middle of the list, so link around it */ + tmp_list_ptr = last_list_ptr->next = kill_list_ptr->next; + } + free_conf(kill_list_ptr); + kill_list_ptr = tmp_list_ptr; + return 1; + } + else + { + last_list_ptr = kill_list_ptr; + kill_list_ptr = kill_list_ptr->next; + } + } + return 0; + } + else + return 0; +} + +/* * expire_pending_glines * * inputs - NONE @@ -809,7 +861,11 @@ if( (irccmp(gline_pending_ptr->user,user) == 0) && (irccmp(gline_pending_ptr->host,host) ==0 ) ) { +#ifdef GLINE_STRICT_VOTE + if(((irccmp(gline_pending_ptr->oper_user1,oper_user) == 0) || +#else if(((irccmp(gline_pending_ptr->oper_user1,oper_user) == 0) && +#endif (irccmp(gline_pending_ptr->oper_host1,oper_host) == 0)) || (irccmp(gline_pending_ptr->oper_server1,oper_server) == 0) ) { @@ -821,8 +877,11 @@ if(gline_pending_ptr->oper_user2[0] != '\0') { /* if two other opers on two different servers have voted yes */ - +#ifdef GLINE_STRICT_VOTE + if(((irccmp(gline_pending_ptr->oper_user2,oper_user)==0) || +#else if(((irccmp(gline_pending_ptr->oper_user2,oper_user)==0) && +#endif (irccmp(gline_pending_ptr->oper_host2,oper_host)==0)) || (irccmp(gline_pending_ptr->oper_server2,oper_server)==0)) { diff -urN ircd-hybrid-6rc7/src/m_kline.c ircd-hybrid-6rc7+t11i/src/m_kline.c --- ircd-hybrid-6rc7/src/m_kline.c Tue Aug 22 06:03:59 2000 +++ ircd-hybrid-6rc7+t11i/src/m_kline.c Sat Dec 23 00:21:05 2000 @@ -706,6 +706,19 @@ return 0; } } + if (temporary_kline_time && (aconf = find_tkline(host,user,(unsigned long)ip))) + { + char *reason; + + reason = aconf->passwd ? aconf->passwd : ""; + sendto_one(sptr, + ":%s NOTICE %s :[%s@%s] already temp K-lined by [%s@%s] - %s", + me.name, + parv[0], + user,host, + aconf->user,aconf->host,reason); + return 0; + } #endif current_date = smalldate((time_t) 0); @@ -736,6 +749,12 @@ dline_in_progress = NO; nextping = CurrentTime; sendto_realops("%s added temporary %d min. K-Line for [%s@%s] [%s]", + parv[0], + temporary_kline_time, + user, + host, + reason ? reason : "No reason"); + log(L_TRACE, "%s added temporary %d min. K-Line for [%s@%s] [%s]", parv[0], temporary_kline_time, user, diff -urN ircd-hybrid-6rc7/src/m_server.c ircd-hybrid-6rc7+t11i/src/m_server.c --- ircd-hybrid-6rc7/src/m_server.c Fri Nov 24 18:24:37 2000 +++ ircd-hybrid-6rc7+t11i/src/m_server.c Fri Dec 22 23:59:41 2000 @@ -36,6 +36,7 @@ #include "scache.h" /* find_or_add */ #include "send.h" /* sendto_one */ #include "struct.h" /* bleah */ +#include "s_log.h" #include #include @@ -259,6 +260,8 @@ { sendto_realops("Link %s cancelled, server %s already exists", get_client_name(bcptr, TRUE), host); + log(L_NOTICE, "Link %s cancelled, server %s already exists", + get_client_name(bcptr, TRUE), host); return exit_client(bcptr, bcptr, &me, "Server Exists"); } /* @@ -274,6 +277,8 @@ strcpy(nbuf, get_client_name(bcptr, TRUE)); sendto_realops("Link %s cancelled, server %s reintroduced by %s", nbuf, host, get_client_name(cptr, TRUE)); + log(L_NOTICE, "Link %s cancelled, server %s reintroduced by %s", + nbuf, host, get_client_name(cptr, TRUE)); exit_client(bcptr, bcptr, &me, "Server Exists"); } @@ -295,6 +300,8 @@ sendto_one(cptr,"ERROR :Nickname %s already exists!", host); sendto_ops("Link %s cancelled: Server/nick collision on %s", /* inpath */ get_client_name(cptr,FALSE), host); + log(L_NOTICE, "Link %s cancelled: Server/nick collision on %s", + /* inpath */ get_client_name(cptr,FALSE), host); return exit_client(cptr, cptr, cptr, "Nick as Server"); } diff -urN ircd-hybrid-6rc7/src/m_squit.c ircd-hybrid-6rc7+t11i/src/m_squit.c --- ircd-hybrid-6rc7/src/m_squit.c Sat Jul 31 09:23:00 1999 +++ ircd-hybrid-6rc7+t11i/src/m_squit.c Fri Dec 22 23:59:41 2000 @@ -227,9 +227,12 @@ log(L_TRACE, "SQUIT From %s : %s (%s)", parv[0], server, comment); } else if (MyConnect(acptr)) - sendto_ops("Received SQUIT %s from %s (%s)", - acptr->name, get_client_name(sptr,FALSE), comment); - + { + sendto_ops("Received SQUIT %s from %s (%s)", + acptr->name, get_client_name(sptr,FALSE), comment); + log(L_NOTICE, "Received SQUIT %s from %s (%s)", + acptr->name, get_client_name(sptr,FALSE), comment); + } return exit_client(cptr, acptr, sptr, comment); } diff -urN ircd-hybrid-6rc7/src/m_stats.c ircd-hybrid-6rc7+t11i/src/m_stats.c --- ircd-hybrid-6rc7/src/m_stats.c Tue Nov 21 06:49:30 2000 +++ ircd-hybrid-6rc7+t11i/src/m_stats.c Fri Dec 22 23:59:41 2000 @@ -529,6 +529,14 @@ ); } } +#else +#ifdef STATS_P_NOTICE + if (stat == 'p') + sendto_realops_flags(FLAGS_SPY, + "STATS p requested by %s (%s@%s) [%s]", + sptr->name, sptr->username, sptr->host, + sptr->user->server); +#endif #endif return 0; } diff -urN ircd-hybrid-6rc7/src/m_svinfo.c ircd-hybrid-6rc7+t11i/src/m_svinfo.c --- ircd-hybrid-6rc7/src/m_svinfo.c Tue Oct 17 07:20:50 2000 +++ ircd-hybrid-6rc7+t11i/src/m_svinfo.c Fri Dec 22 23:59:41 2000 @@ -29,6 +29,7 @@ #include "ircd.h" #include "numeric.h" #include "send.h" +#include "s_log.h" #include #include @@ -132,6 +133,9 @@ if (deltat > TS_MAX_DELTA) { sendto_realops( + "Link %s dropped, excessive TS delta (my TS=%d, their TS=%d, delta=%d)", + get_client_name(sptr, TRUE), CurrentTime, theirtime,deltat); + log(L_NOTICE, "Link %s dropped, excessive TS delta (my TS=%d, their TS=%d, delta=%d)", get_client_name(sptr, TRUE), CurrentTime, theirtime,deltat); return exit_client(sptr, sptr, sptr, "Excessive TS delta"); diff -urN ircd-hybrid-6rc7/src/m_unkline.c ircd-hybrid-6rc7+t11i/src/m_unkline.c --- ircd-hybrid-6rc7/src/m_unkline.c Sat Nov 18 19:11:12 2000 +++ ircd-hybrid-6rc7+t11i/src/m_unkline.c Fri Dec 22 23:59:41 2000 @@ -23,6 +23,9 @@ * * $Id: m_unkline.c,v 1.39 2000/11/18 19:11:12 lusky Exp $ */ +#ifdef GLINES +#include "m_gline.h" +#endif #include "m_commands.h" #include "channel.h" #include "client.h" @@ -406,3 +409,298 @@ } return NO; } + +/* +** m_undline +** added May 28th 2000 by Toby Verrall +** based totally on m_unkline +** +** parv[0] = sender nick +** parv[1] = dline to remove +*/ +int m_undline (aClient *cptr,aClient *sptr,int parc,char *parv[]) +{ + FBFILE* in; + FBFILE* out; + int pairme = NO; + char buf[BUFSIZE]; + char buff[BUFSIZE]; /* matches line definition in s_conf.c */ + char temppath[256]; + + const char *filename; /* filename to use for undline */ + + char *cidr; + char *p; + unsigned long ip_host; + unsigned long ip_mask; + int error_on_write = NO; + mode_t oldumask; + + ircsprintf(temppath, "%s.tmp", ConfigFileEntry.dlinefile); + + if (check_registered(sptr)) + { + return -1; + } + + if (!IsAnOper(sptr)) + { + sendto_one(sptr, form_str(ERR_NOPRIVILEGES), me.name, + parv[0]); + return 0; + } + + if (!IsSetOperUnkline(sptr)) + { + sendto_one(sptr,":%s NOTICE %s :You have no U flag",me.name, + parv[0]); + return 0; + } + + if ( parc < 2 ) + { + sendto_one(sptr, form_str(ERR_NEEDMOREPARAMS), + me.name, parv[0], "UNDLINE"); + return 0; + } + + cidr = parv[1]; + + if (!is_address(cidr,&ip_host,&ip_mask)) + { + sendto_one(sptr, ":%s NOTICE %s :Invalid parameters", + me.name, parv[0]); + return 0; + } + + filename = get_conf_name(DLINE_TYPE); + + if( (in = fbopen(filename, "r")) == 0) + { + sendto_one(sptr, ":%s NOTICE %s :Cannot open %s", + me.name,parv[0],filename); + return 0; + } + + oldumask = umask(0); /* ircd is normally too paranoid */ + if( (out = fbopen(temppath, "w")) == 0) + { + sendto_one(sptr, ":%s NOTICE %s :Cannot open %s", + me.name,parv[0],temppath); + fbclose(in); + umask(oldumask); /* Restore the old umask */ + return 0; + } + umask(oldumask); /* Restore the old umask */ + + +/* +#toot!~toot@127.0.0.1 D'd: 123.4.5.0/24:test (2000/05/28 12.48) +D:123.4.5.0/24:test (2000/05/28 12.48) +*/ + + while(fbgets(buf, sizeof(buf), in)) + { + if((buf[1] == ':') && ((buf[0] == 'd') || (buf[0] == 'D'))) + { + /* its a D: line */ + char *found_cidr; + + strncpy_irc(buff, buf, BUFSIZE); /* extra paranoia */ + + p = strchr(buff,'\n'); + if(p) + *p = '\0'; + + found_cidr = buff + 2; /* point past the D: */ + p = strchr(found_cidr,':'); + if(p == (char *)NULL) + { + sendto_one(sptr, ":%s NOTICE %s :D-Line file corrupted", + me.name, parv[0]); + sendto_one(sptr, ":%s NOTICE %s :Couldn't find CIDR", + me.name, parv[0]); + if(!error_on_write) + error_on_write = flush_write(sptr, out, buf, temppath); + continue; /* This D line is corrupted ignore */ + } + *p = '\0'; + + if(irccmp(cidr,found_cidr)) + { + if(!error_on_write) + error_on_write = flush_write(sptr, out, buf, temppath); + } + else + pairme++; + + } + else if(buf[0] == '#') + { + char *found_cidr; + + strncpy_irc(buff, buf, BUFSIZE); + +/* +#toot!~toot@127.0.0.1 D'd: 123.4.5.0/24:test (2000/05/28 12.48) +D:123.4.5.0/24:test (2000/05/28 12.48) + +If its a comment coment line, i.e. +#ignore this line +Then just ignore the line +*/ + + p = strchr(buff,':'); + if(p == (char *)NULL) + { + if(!error_on_write) + error_on_write = flush_write(sptr, out, buf, temppath); + continue; + } + *p = '\0'; + p++; + + found_cidr = p; + p = strchr(found_cidr,':'); + + if(p == (char *)NULL) + { + if(!error_on_write) + error_on_write = flush_write(sptr, out, buf, temppath); + continue; + } + *p = '\0'; + + while(*found_cidr == ' ') + found_cidr++; + + + if( (irccmp(found_cidr,cidr))) + { + if(!error_on_write) + error_on_write = flush_write(sptr, out, buf, temppath); + } + } + + else /* its the ircd.conf file, and not a D line or comment */ + { + if(!error_on_write) + error_on_write = flush_write(sptr, out, buf, temppath); + } + } + + fbclose(in); + + + if(!error_on_write) + { + fbclose(out); + (void)rename(temppath, filename); + rehash(cptr,sptr,0); + } + else + { + sendto_one(sptr,":%s NOTICE %s :Couldn't write D-line file, aborted", + me.name,parv[0]); + return -1; + } + + if(!pairme) + { + sendto_one(sptr, ":%s NOTICE %s :No D-Line for %s", + me.name, parv[0],cidr); + return 0; + } + + sendto_one(sptr, ":%s NOTICE %s :D-Line for [%s] is removed", + me.name, parv[0], cidr); + sendto_ops("%s has removed the D-Line for: [%s]", + parv[0], cidr); + + log(L_NOTICE, "%s removed D-Line for [%s]", parv[0], cidr); + return 0; +} + +/* +** m_ungline +** added May 29th 2000 by Toby Verrall +** +** parv[0] = sender nick +** parv[1] = gline to remove +*/ + +int m_ungline (aClient *cptr,aClient *sptr,int parc,char *parv[]) +{ +#ifdef GLINES + + char *user,*host; + + if (check_registered(sptr)) + { + return -1; + } + + if (!IsOper(sptr)) + { + sendto_one(sptr, form_str(ERR_NOPRIVILEGES), me.name, + parv[0]); + return 0; + } + + if (!IsSetOperUnkline(sptr) || !IsSetOperGline(sptr)) + { + sendto_one(sptr,":%s NOTICE %s :You have no U and G flag", + me.name,parv[0]); + return 0; + } + + if ( parc < 2 ) + { + sendto_one(sptr, form_str(ERR_NEEDMOREPARAMS), + me.name, parv[0], "UNGLINE"); + return 0; + } + + if ( (host = strchr(parv[1], '@')) || *parv[1] == '*' ) + { + /* Explicit user@host mask given */ + + if(host) /* Found user@host */ + { + user = parv[1]; /* here is user part */ + *(host++) = '\0'; /* and now here is host */ + } + else + { + user = "*"; /* no @ found, assume its *@somehost */ + host = parv[1]; + } + } + else + { + sendto_one(sptr, ":%s NOTICE %s :Invalid parameters", + me.name, parv[0]); + return 0; + } + + if(remove_gline_match(user, host)) + { + sendto_one(sptr, ":%s NOTICE %s :Un-glined [%s@%s]", + me.name, parv[0],user, host); + sendto_ops("%s has removed the G-Line for: [%s@%s]", + parv[0], user, host ); + log(L_NOTICE, "%s removed G-Line for [%s@%s]", + parv[0], user, host); + return 0; + } + else + { + sendto_one(sptr, ":%s NOTICE %s :No G-Line for %s@%s", + me.name, parv[0],user,host); + return 0; + } +#else + sendto_one(sptr,":%s NOTICE %s :UNGLINE disabled",me.name,parv[0]); +#endif +} + diff -urN ircd-hybrid-6rc7/src/m_version.c ircd-hybrid-6rc7+t11i/src/m_version.c --- ircd-hybrid-6rc7/src/m_version.c Sat Jul 31 05:48:04 1999 +++ ircd-hybrid-6rc7+t11i/src/m_version.c Fri Dec 22 23:59:41 2000 @@ -28,6 +28,7 @@ #include "numeric.h" #include "s_serv.h" #include "send.h" +#include "supported.h" /* * m_functions execute protocol messages on this server: @@ -93,16 +94,26 @@ */ int m_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { + char featurebuf[512]; + + ircsprintf(featurebuf, FEATURES, FEATURESVALUES); + if (IsAnOper(sptr)) { if (hunt_server(cptr, sptr, ":%s VERSION :%s", 1, parc, parv) == HUNTED_ISME) - sendto_one(sptr, form_str(RPL_VERSION), me.name, - parv[0], version, serno, debugmode, me.name, serveropts); + { + sendto_one(sptr, form_str(RPL_VERSION), me.name, + parv[0], version, serno, debugmode, me.name, serveropts); + sendto_one(sptr, form_str(RPL_ISUPPORT), me.name, parv[0], featurebuf); + } } else - sendto_one(sptr, form_str(RPL_VERSION), me.name, - parv[0], version, serno, debugmode, me.name, serveropts); + { + sendto_one(sptr, form_str(RPL_VERSION), me.name, + parv[0], version, serno, debugmode, me.name, serveropts); + sendto_one(sptr, form_str(RPL_ISUPPORT), me.name, parv[0], featurebuf); + } return 0; } diff -urN ircd-hybrid-6rc7/src/m_whois.c ircd-hybrid-6rc7+t11i/src/m_whois.c --- ircd-hybrid-6rc7/src/m_whois.c Fri Nov 24 17:36:30 2000 +++ ircd-hybrid-6rc7+t11i/src/m_whois.c Fri Dec 22 23:59:41 2000 @@ -287,6 +287,10 @@ if (IsAnOper(acptr)) sendto_one(sptr, form_str(RPL_WHOISOPERATOR), me.name, parv[0], name); + + if (acptr->umodes & FLAGS_ADMIN) + sendto_one(sptr, form_str(RPL_WHOISADMIN), + me.name, parv[0], name); #ifdef WHOIS_NOTICE if ((MyOper(acptr)) && ((acptr)->umodes & FLAGS_SPY) && (MyConnect(sptr)) && (IsPerson(sptr)) && (acptr != sptr)) @@ -430,6 +434,10 @@ if (IsAnOper(acptr)) sendto_one(sptr, form_str(RPL_WHOISOPERATOR), me.name, parv[0], name); + + if (acptr->umodes & FLAGS_ADMIN) + sendto_one(sptr, form_str(RPL_WHOISADMIN), + me.name, parv[0], name); #ifdef WHOIS_NOTICE if ((MyOper(acptr)) && ((acptr)->umodes & FLAGS_SPY) && (MyConnect(sptr)) && (IsPerson(sptr)) && (acptr != sptr)) diff -urN ircd-hybrid-6rc7/src/messages.tab ircd-hybrid-6rc7+t11i/src/messages.tab --- ircd-hybrid-6rc7/src/messages.tab Wed Nov 22 05:46:28 2000 +++ ircd-hybrid-6rc7+t11i/src/messages.tab Fri Dec 22 23:59:41 2000 @@ -24,11 +24,11 @@ static char * replies[] = { /* 000 */ (char *)NULL, -/* 001 RPL_WELCOME, */ ":%s 001 %s :Welcome to the Internet Relay Network %s", -/* 002 RPL_YOURHOST,*/ ":%s 002 %s :Your host is %s, running version %s", -/* 003 RPL_CREATED, */ ":%s 003 %s :This server was created %s", -/* 004 RPL_MYINFO, */ ":%s 004 %s %s %s oiwszcrkfydnxb biklmnopstved", -/* 005 */ (char *)NULL, +/* 001 RPL_WELCOME, */ ":%s 001 %s :Welcome to the Internet Relay Network %s", +/* 002 RPL_YOURHOST,*/ ":%s 002 %s :Your host is %s, running version %s", +/* 003 RPL_CREATED, */ ":%s 003 %s :This server was created %s", +/* 004 RPL_MYINFO, */ ":%s 004 %s %s %s oiwszcrkfydnxba biklmnopstved", +/* 005 RPL_ISUPPORT, */ ":%s 005 %s %s :are supported by this server", /* 006 */ (char *)NULL, /* 007 */ (char *)NULL, /* 008 */ (char *)NULL, @@ -335,7 +335,7 @@ /* 305 RPL_UNAWAY, */ ":%s 305 %s :You are no longer marked as being away", /* 306 RPL_NOWAWAY, */ ":%s 306 %s :You have been marked as being away", /* 307 */ (char *)NULL, -/* 308 */ (char *)NULL, +/* 308 RPL_WHOISADMIN, */ ":%s 308 %s %s :is a Server Administrator", /* 309 */ (char *)NULL, /* 310 */ (char *)NULL, /* 311 RPL_WHOISUSER, */ ":%s 311 %s %s %s %s * :%s", diff -urN ircd-hybrid-6rc7/src/messages_cust.tab ircd-hybrid-6rc7+t11i/src/messages_cust.tab --- ircd-hybrid-6rc7/src/messages_cust.tab Wed Nov 22 05:46:28 2000 +++ ircd-hybrid-6rc7+t11i/src/messages_cust.tab Fri Dec 22 23:59:41 2000 @@ -25,11 +25,11 @@ static char * replies[] = { /* 000 */ (char *)NULL, -/* 001 RPL_WELCOME, */ ":%s 001 %s :Welcome to the Internet Relay Network %s", -/* 002 RPL_YOURHOST,*/ ":%s 002 %s :Your host is %s, running version %s", -/* 003 RPL_CREATED, */ ":%s 003 %s :This server was created %s", -/* 004 RPL_MYINFO, */ ":%s 004 %s %s %s oiwszcrkfydnxb biklmnopstved", -/* 005 */ (char *)NULL, +/* 001 RPL_WELCOME, */ ":%s 001 %s :Welcome to the Internet Relay Network %s", +/* 002 RPL_YOURHOST,*/ ":%s 002 %s :Your host is %s, running version %s", +/* 003 RPL_CREATED, */ ":%s 003 %s :This server was created %s", +/* 004 RPL_MYINFO, */ ":%s 004 %s %s %s oiwszcrkfydnxba biklmnopstved", +/* 005 RPL_ISUPPORT, */ ":%s 005 %s %s :are supported by this server", /* 006 */ (char *)NULL, /* 007 */ (char *)NULL, /* 008 */ (char *)NULL, @@ -266,7 +266,7 @@ /* 239 */ (char *)NULL, /* 240 */ (char *)NULL, /* 241 RPL_STATSLLINE, */ ":%s 241 %s %c %s * %s %d %d", -/* 242 RPL_STATSUPTIME,*/ ":%s 242 %s :Dianora hasn't messed with the server code now in %d days, %d:%02d:%02d", +/* 242 RPL_STATSUPTIME,*/ ":%s 242 %s :Server Up %d days, %d:%02d:%02d", /* 243 RPL_STATSOLINE, */ ":%s 243 %s %c %s@%s * %s %s %d %s", /* 244 RPL_STATSHLINE, */ ":%s 244 %s %c %s * %s %d %d", /* 245 RPL_STATSSLINE, */ ":%s 245 %s %c %s * %s %d %d", @@ -336,7 +336,7 @@ /* 305 RPL_UNAWAY, */ ":%s 305 %s :OK, you're not /away anymore. Did you have fun?", /* 306 RPL_NOWAWAY, */ ":%s 306 %s :OK, you're /away now. Hurry back!", /* 307 */ (char *)NULL, -/* 308 */ (char *)NULL, +/* 308 RPL_WHOISADMIN, */ ":%s 308 %s %s :is a Goon Gumpa (Server Admin)", /* 309 */ (char *)NULL, /* 310 */ (char *)NULL, /* 311 RPL_WHOISUSER, */ ":%s 311 %s %s %s %s * :%s", diff -urN ircd-hybrid-6rc7/src/s_bsd.c ircd-hybrid-6rc7+t11i/src/s_bsd.c --- ircd-hybrid-6rc7/src/s_bsd.c Fri Dec 22 01:05:03 2000 +++ ircd-hybrid-6rc7+t11i/src/s_bsd.c Sat Dec 23 00:06:21 2000 @@ -184,12 +184,17 @@ { struct ConfItem* aconf = (struct ConfItem*) vptr; aconf->dns_pending = 0; - if (reply) { - memcpy(&aconf->ipnum, reply->hp->h_addr, sizeof(struct in_addr)); - connect_server(aconf, 0, reply); - } + + if (reply) + { + memcpy(&aconf->ipnum, reply->hp->h_addr, sizeof(struct in_addr)); + connect_server(aconf, 0, reply); + } else - sendto_realops("Connect to %s failed: host lookup", aconf->host); + { + sendto_realops("Connect to %s failed: host lookup", aconf->host); + log(L_NOTICE, "Connect to %s failed: host lookup", aconf->host); + } } /* @@ -917,8 +922,12 @@ int connected = CurrentTime - cptr->firsttime; if (0 == error) - sendto_ops("Server %s closed the connection", - get_client_name(cptr, FALSE)); + { + sendto_ops("Server %s closed the connection", + get_client_name(cptr, FALSE)); + log(L_NOTICE, "Server %s closed the connection", + get_client_name(cptr, FALSE)); + } else report_error("Lost connection to %s:%s", get_client_name(cptr, TRUE), current_error); diff -urN ircd-hybrid-6rc7/src/s_conf.c ircd-hybrid-6rc7+t11i/src/s_conf.c --- ircd-hybrid-6rc7/src/s_conf.c Fri Dec 1 06:28:50 2000 +++ ircd-hybrid-6rc7+t11i/src/s_conf.c Fri Dec 22 23:59:41 2000 @@ -84,7 +84,6 @@ static void add_q_line(struct ConfItem *); static void clear_q_lines(void); static void clear_special_conf(struct ConfItem **); -static struct ConfItem* find_tkline(const char*, const char*, unsigned long); struct ConfItem *temporary_klines = NULL; struct ConfItem *temporary_ip_klines = NULL; @@ -1469,6 +1468,7 @@ { aQlineItem *qp; struct ConfItem *aconf; + struct Channel *chptr; char *host; char *user; char *pass; @@ -1490,6 +1490,14 @@ me.name, sptr->name, name, pass, user, host); } } +#ifdef JUPE_CHANNEL + /* show channels set +j */ + for (chptr = channel; chptr; chptr = chptr->nextch) + if (chptr->mode.mode & MODE_JUPED) + sendto_one(sptr, form_str(RPL_STATSQLINE), + me.name, sptr->name, chptr->chname, + "channel is set +j", "-", "-"); +#endif } /* @@ -2665,7 +2673,7 @@ * thats expected to be done by caller.... *sigh* -Dianora */ -static struct ConfItem* find_tkline(const char* host, const char* user, unsigned long ip) +struct ConfItem* find_tkline(const char* host, const char* user, unsigned long ip) { struct ConfItem *kill_list_ptr; /* used for the link list only */ struct ConfItem *last_list_ptr; @@ -2971,6 +2979,10 @@ int_privs |= CONF_OPER_DIE; /* allow die */ else if(*privs == 'd') int_privs &= ~CONF_OPER_DIE; /* disallow die */ + else if(*privs == 'A') + int_privs |= CONF_OPER_ADMIN; /* allow umode +a */ + else if(*privs == 'a') + int_privs &= ~CONF_OPER_ADMIN; privs++; } return(int_privs); @@ -3064,6 +3076,15 @@ else *privs_ptr++ = 'd'; + if(port & CONF_OPER_ADMIN) + { + if(cptr) + SetOperAdmin(cptr); + *privs_ptr++ = 'A'; + } + else + *privs_ptr++ = 'a'; + *privs_ptr = '\0'; return(privs_out); @@ -3104,6 +3125,8 @@ int_flags |= FLAGS_DEBUG; else if(*flags == 'n') int_flags |= FLAGS_NCHANGE; + else if(*flags == 'a') + int_flags |= FLAGS_ADMIN; flags++; } @@ -3147,6 +3170,8 @@ *flags_ptr++ = 'd'; if(flags & FLAGS_NCHANGE) *flags_ptr++ = 'n'; + if(flags & FLAGS_ADMIN) + *flags_ptr++ = 'a'; *flags_ptr = '\0'; return(flags_out); diff -urN ircd-hybrid-6rc7/src/s_serv.c ircd-hybrid-6rc7+t11i/src/s_serv.c --- ircd-hybrid-6rc7/src/s_serv.c Tue Nov 21 06:49:32 2000 +++ ircd-hybrid-6rc7+t11i/src/s_serv.c Fri Dec 22 23:59:41 2000 @@ -617,6 +617,9 @@ sendto_realops("Username mismatch [%s]v[%s] : %s", n_conf->user, cptr->username, get_client_name(cptr, TRUE)); + log(L_NOTICE, "Username mismatch [%s]v[%s] : %s", + n_conf->user, cptr->username, + get_client_name(cptr, TRUE)); sendto_one(cptr, "ERROR :No Username Match"); return exit_client(cptr, cptr, cptr, "Bad User"); } @@ -631,6 +634,8 @@ zip_free(cptr); sendto_realops("Unable to setup compressed link for %s", get_client_name(cptr, TRUE)); + log(L_NOTICE, "Unable to setup compressed link for %s", + get_client_name(cptr, TRUE)); return exit_client(cptr, cptr, &me, "zip_init() failed"); } cptr->flags2 |= (FLAGS2_ZIP|FLAGS2_ZIPFIRST); diff -urN ircd-hybrid-6rc7/src/s_user.c ircd-hybrid-6rc7+t11i/src/s_user.c --- ircd-hybrid-6rc7/src/s_user.c Fri Dec 22 02:28:12 2000 +++ ircd-hybrid-6rc7+t11i/src/s_user.c Fri Dec 22 23:59:41 2000 @@ -45,6 +45,7 @@ #include "scache.h" #include "send.h" #include "struct.h" +#include "supported.h" #include "whowas.h" #include "flud.h" @@ -77,7 +78,8 @@ /* table of ascii char letters to corresponding bitmask */ static FLAG_ITEM user_modes[] = -{ +{ + {FLAGS_ADMIN, 'a'}, {FLAGS_BOTS, 'b'}, {FLAGS_CCONN, 'c'}, {FLAGS_DEBUG, 'd'}, @@ -133,7 +135,7 @@ 0, /* Z 0x5A */ 0, 0, 0, 0, 0, /* 0x5F */ /* 0x60 */ 0, - 0, /* a */ + FLAGS_ADMIN, /* a */ FLAGS_BOTS, /* b */ FLAGS_CCONN, /* c */ FLAGS_DEBUG, /* d */ @@ -528,6 +530,7 @@ anUser* user = sptr->user; char* reason; char tmpstr2[512]; + char featurebuf[512]; assert(0 != sptr); assert(sptr->username != username); @@ -825,6 +828,8 @@ sendto_one(sptr, form_str(RPL_CREATED),me.name,nick,creation); sendto_one(sptr, form_str(RPL_MYINFO), me.name, parv[0], me.name, version); + ircsprintf(featurebuf, FEATURES, FEATURESVALUES); + sendto_one(sptr, form_str(RPL_ISUPPORT), me.name, nick, featurebuf); show_lusers(sptr, sptr, 1, parv); #ifdef SHORT_MOTD @@ -1427,8 +1432,8 @@ sendto_realops_flags(FLAGS_REJ, "Quarantined nick [%s] from user %s", nick,get_client_name(cptr, FALSE)); - sendto_one(sptr, form_str(ERR_ERRONEUSNICKNAME), - me.name, parv[0], parv[1]); + sendto_one(sptr, form_str(ERR_UNAVAILRESOURCE), + me.name, BadPtr(parv[0]) ? "*" : parv[0], nick); return 0; } @@ -2070,6 +2075,13 @@ sendto_one(sptr,":%s NOTICE %s :*** You need oper and N flag for +n", me.name,parv[0]); sptr->umodes &= ~FLAGS_NCHANGE; /* only tcm's really need this */ + } + + if (MyConnect(sptr) && (sptr->umodes & FLAGS_ADMIN) && !IsSetOperAdmin(sptr)) + { + sendto_one(sptr,":%s NOTICE %s :*** You need oper and A flag for +a", + me.name,parv[0]); + sptr->umodes &= ~FLAGS_ADMIN; } if (!(setflags & FLAGS_INVISIBLE) && IsInvisible(sptr))