diff -uNrd ircd-hybrid-6.3.1.dist/BUGS ircd-hybrid-6.3.1/BUGS --- ircd-hybrid-6.3.1.dist/BUGS Wed Dec 31 19:00:00 1969 +++ ircd-hybrid-6.3.1/BUGS Wed Apr 30 10:28:35 2003 @@ -0,0 +1,20 @@ +This is a list of known bugs/open issues with Hybrid 6.3.1 that will +likely never be fixed. + +o Large numbers of temporary KLINE's cause performance to drop. + Depending on the resources of the server, between 2000 and 4000 + temporary KLINE's will make the server lag. The solution is only + present in ircd-ratbox and hybrid 7's +lmh4 patch, multiple lists, + each checked at different times (and intervals). For large servers, + it is not recommended to use tkline times over 1440. + +o There are unconfirmed reports of mtrie "losing" klines or ilines with + heavy load and large numbers of lines. + +o There are unconfirmed reports of a remotely exploitable buffer overflow. + +o Duplicate KLINE's can be added by having multiple user@* klines in the + conf and issuing REHASH. This is most often a result of .include'ing + kline.conf. + NOTE: This is fixed as of +fr24. + diff -uNrd ircd-hybrid-6.3.1.dist/ChangeLog ircd-hybrid-6.3.1/ChangeLog --- ircd-hybrid-6.3.1.dist/ChangeLog Wed Apr 17 23:16:01 2002 +++ ircd-hybrid-6.3.1/ChangeLog Sat Apr 19 21:09:57 2003 @@ -1,3 +1,89 @@ +androsyn 2003/04/06 17:42:04 EDT (20030406_1) + + Modified files: + src s_auth.c + Log: + The case is inverted on this test. Take a peek at the example clients in + the adns source distribution and you'll see what I mean :) + + Revision Changes Path + 1.54 +1 -1 ircd-hybrid-6/src/s_auth.c + + + +androsyn 2003/04/06 17:10:38 EDT (20030406_0) + + Modified files: + include res.h + src adns.c s_auth.c + Log: + adns fixes from hybrid-7. I have yet to see this bug crash a hybrid-6 + server *but* its still possible, just harder I think. + + Revision Changes Path + 1.17 +3 -3 ircd-hybrid-6/include/res.h + 1.11 +6 -6 ircd-hybrid-6/src/adns.c + 1.53 +3 -3 ircd-hybrid-6/src/s_auth.c + +XXX There were some items here that were not included. These are items +that I patched manually in +fr. See the +fr ChangeLog for more information + + +androsyn 2002/08/02 17:57:53 EDT (20020802_0) + + Modified files: + src channel.c + Log: + Change knock disable to work with +p and not +s. + + Revision Changes Path + 1.234 +2 -2 ircd-hybrid-6/src/channel.c + + + +androsyn 2002/07/11 20:04:08 EDT (20020712_0) + + Modified files: + . configure + adns Makefile.in + autoconf configure.in + include setup.h.in + Log: + Changes to make configure detect ranlib and use it for libadns.a. This + should probably go into a hybrid 6.3.2 + + Revision Changes Path + 1.4 +3 -2 ircd-hybrid-6/adns/Makefile.in + 1.29 +1 -0 ircd-hybrid-6/autoconf/configure.in + 1.30 +111 -80 ircd-hybrid-6/configure + 1.18 +0 -1 ircd-hybrid-6/include/setup.h.in + + + +androsyn 2002/06/12 15:31:24 EDT (20020612_0) + + Modified files: + src sprintf_irc.c + Log: + Make %lu return 0 for 0 and not 000000000 + + Revision Changes Path + 1.12 +6 -0 ircd-hybrid-6/src/sprintf_irc.c + + + +androsyn 2002/04/28 04:13:05 EDT (20020428_0) + + Modified files: + src s_conf.c + Log: + Fixed a potential NULL dereference in the dns code.. + + Revision Changes Path + 1.237 +1 -1 ircd-hybrid-6/src/s_conf.c + + + lusky 2002/04/17 23:15:59 EDT (20020418_1) Modified files: diff -uNrd ircd-hybrid-6.3.1.dist/Makefile.in ircd-hybrid-6.3.1/Makefile.in --- ircd-hybrid-6.3.1.dist/Makefile.in Thu Dec 6 23:13:18 2001 +++ ircd-hybrid-6.3.1/Makefile.in Fri May 2 12:03:55 2003 @@ -22,7 +22,9 @@ RM=@RM@ # Default CFLAGS -CFLAGS = -g -O2 -DNDEBUG +CFLAGS = @CFLAGS@ -DNDEBUG + +LDFLAGS = @LDFLAGS@ # Default make flags - you may want to uncomment this on a multicpu machine #MFLAGS = -j 4 @@ -34,49 +36,6 @@ # You may need to define the FD_SETSIZE in order to overrule # the system one. #CFLAGS= -DNDEBUG -g -O2 -D"FD_SETSIZE=1024" -# -# NOTE: The rest of these definitions may or may not work, I haven't tested them --JRL -# -# use the following on MIPS: -#CFLAGS= -DNDEBUG -systype bsd43 -DSYSTYPE_BSD43 -# For Irix 4.x (SGI), use the following: -#CFLAGS= -DNDEBUG -g -cckr -# -# on NEXT use: -#CFLAGS= -DNDEBUG -bsd -#on NeXT other than 2.0: -#IRCDLIBS= -lsys_s -# -# AIX 370 flags -#CFLAGS= -DNDEBUG -D_BSD -Hxa -#IRCDLIBS= -lbsd -# -# Dynix/ptx V2.0.x -#CFLAGS= -DNDEBUG -O -Xo -#IRCDLIBS= -lsocket -linet -lnsl -lseq -# -# Dynix/ptx V1.x.x -#IRCDLIBS= -lsocket -linet -lnsl -lseq -# -#use the following on SUN OS without nameserver libraries inside libc -#IRCDLIBS=-lresolv -# -# ESIX -#CFLAGS= -DNDEBUG -O -I/usr/ucbinclude -#IRCDLIBS=-L/usr/ucblib -L/usr/lib -lsocket -lucb -lns -lnsl -# -# LDFLAGS - flags to send the loader (ld). SunOS users may want to add -# -Bstatic here. -# -#LDFLAGS=-Bstatic -# -#Dell SVR4 -#CC=gcc -#CFLAGS= -DNDEBUG -O2 -#IRCDLIBS=-lsocket -lnsl -lucb -#IRCLIBS=-lcurses -lresolv -lsocket -lnsl -lucb - - SHELL=/bin/sh SUBDIRS=adns src tools diff -uNrd ircd-hybrid-6.3.1.dist/README.FR ircd-hybrid-6.3.1/README.FR --- ircd-hybrid-6.3.1.dist/README.FR Wed Dec 31 19:00:00 1969 +++ ircd-hybrid-6.3.1/README.FR Sat May 10 13:21:23 2003 @@ -0,0 +1,492 @@ ++fr patches - Hwy + +The +fr patches are a collection of things I find useful in a Hybrid 6.x +server. These are mostly local patches, not affecting the network in any +way. The global affecting ones are clearly marked as such. + +The current set of features include: +o The maximum local and global client connections are optionally saved + between restarts +o Optional /quote XLINE, with this comes /quote SET XLINETYPE to define + which mode you wish to use for any following XLINE +o Optional encrypted I: line passwords +o Optional gecos in the client connection line, same format as hybrid 7 +o Optional "ping cookies", formerly used as an anti-ip spoof measure, now + useful in protecting against some drones. +o Optional unsupported remote /whois notification {global - policy} +o Optional limited HTTP proxy protection +o Optional global clone checking {Only limits local users} +o PART messages {global - unsupporting servers will ignore the parameter} +o Optional silence on ban {global - policy} (warning, can be CPU intensive) +o Unauthorized client connections are sent to the +u usermode +o TOPIC info includes the user@host as well as the nick of the client who + set the topic +o Administrator mode, it currently does not do anything except mark the oper + as an administrator +o csircd like FLAGS command, used in almost the same manner +o Optional "Quit:" marking of user /quit's +o Restricted clients (little i: lines) get sent numeric 484 rather than a + notice (compatability with hybrid 7 and ircnet 2.10) +o Optionally notify client who issue STATS and have it ignored {can affect + remote users} +o Optionally notify client who issue a remote WHOIS and have it ignored + {can affect remote users} +o Optionally allow negative ports to be used in C: lines, allowing an + administrator to set a port without having it automatically connect. + With this comes hybrid 7/ircnet 2.11's /connect server 0 [remote] to + use the default port or the port specified in the C: line. {The remote + hub has to understand the connect 0 syntax} +o STATS p shows administrator status +o Times/dates sent by the server can be localized to the LANG setting in + your ircd account's shell +o The "is now an irc operator" notice displays administrator access. +o STATS ? shows the TS version of directly linked servers +o The maximum TKLINE time is changeable with /quote SET +o The server introduced (+x) notice includes the hop count and server info + text (IRCnet and +leguin like) {can break scripts} +o fl_'s temporary DLINE patch is included +o billy-jon's resolving hostname patch is included +o Optional unsupported deoper notices (umode -o and quit) +o Extended STATS v +o +l usermode to view LOCOPS +o Optionally allow opers to join and speak in juped channels {policy} +o Temporary KLINE expiration notices are optional +o Optionally propogate AWAY (compliance with hybrid 7 and the next release of + csircd), and optionally burst AWAY on top of this {global affecting, uses + more bandwidth} +o Optionally revert USERHOST to RFC specifications (stock Hybrid 7's fixes + an issue with mIRC and spoofed hostnames, but can break EPIC and mIRC's + userlist) +o RPL_WELCOME (001) is consistent with hybrid 7 +o Send a NOTICE to opers when /quote CLOSE is used +o Added MAP +o Optionally add /wallchops, a compatability shim for undernet users/clients +o kill -USR1 pid from the command line triggers a REHASH MOTD. +o Optional blocking of STATS c and ? from non-opers. +o Corrections and enhancements to GLINE. +o Adding a permanent kline while a temporary kline exists will remove the + temporary kline and add the permanent one in its place. +o RPL_WHOISACTUALLY, displays the real IP for users as in ircd-ratbox. +o Removes SLAVE_SERVERS, but allows propagation of remote KLINE/UNKLINE if + we are defined as a hub. +o Adds ENCAP, needed for compatability with ircd-ratbox and csircd. +o Adds ETRACE, used by modern monitor bots. + +o Corrections to stock Hybrid 6.3.1 since release. + +Requirements: + +You MUST have the following itmes to use this patch: +o A working snprintf() +o Working POSIX locale support + +Below is basically a ChangeLog of the +fr patch: + ++fr1 + +Against 6.3rc1 +Included: SAVE_MAXCLIENT, XLINE_COMMAND, CRYPT_AUTH_PASSWORD, and + GECOS_CLICONNECT +9 Dec 2001 + ++fr2 + +Against 6.3rc2 +Added: ANTI_IP_SPOOF, REMOTE_WHOIS_NOTICE*, POST_REGISTER + +* - I do not support this, it was added by request only. + +11 Dec 2001 + ++fr3 + +Against 6.3rc2 +Added: CHECK_CLONE, IDENT_ANAL + +11 Dec 2001 + ++fr4 + +Against 6.3rc3 +Added: SEND_ISUPPORT, PART_MESSAGES, SILENCE_ON_BAN, MODE_UNAUTH + +12 Dec 2001 + ++fr5 + +Against 6.3rc3 +Added: TOPIC_UH, ADMIN_MODE +Correction To: REMOTE_WHOIS_NOTICE + +12 Dec 2001 + ++fr6 + +Against 6.3rc3 +Added: FLAGS_COMMAND, FLAGS_ANNOUNCE +Changed: CHECK_CLONE messages now go to +r opers, not +s, + Cleanup of CHECK_CLONE + +13 Dec 2001 + ++fr7 + +Against 6.3rc4 +Added: CLIENT_EXIT +Correction To: XLINE_COMMAND, fixed a double free +Removed: SEND_ISUPPORT (It's stock H6.3 now) +Changed: FLAGS_ANNOUNCE used everywhere it's used on csircd now +Changed: The Clone Period and number can be changed with /quote SET +Changed: Restricted mode (little i:) clients are sent numeric 484 rather + than a NOTICE, like IRCnet and Hyb7. This can be used to spot + eggdrops, as they will QUIT with the message 'i-lines suck' + if it gets a 484 numeric. + +22 Dec 2001 + ++fr8 + +Against 6.3rc5 +Added: STATS_IGNORED_NOTICE, WHOIS_TRYAGAIN + +4 Jan 2002 + ++fr9 + +Against 6.3rc6 +Added: PRESERVE_SQUIT_REASONS, NEG_PORT + +6 Feb 2002 + ++fr10 + +Against 6.3 release +Changed: STATS p now shows admin status in addition to showing local/global + Valid characters are: A O o (x is an error condition that should + never happen). + + Admin mode is set by default upon OPER. + +Merged: 6.3+locale patch, providing localised, multilingual date settings. + +WARNING: The locale patch thus requires POSIX locale support, and will NOT + compile without it. + +17 Feb 2002 + ++fr11 + +Against 6.3 release +Removed: PRESERVE_SQUIT_REASONS (I don't believe it's possible with Hybrid + 6's structure) + +Change: The character shown in the oper NOTICE uses the characters as in + STATS p + +Merged: 6.3+qotd1 patch, providing a Quote of the day system, disabled + by default + +24 Feb 2002 + ++fr12 + +Against 6.3 release + +Added: SIGTRAP handling, for FreeBSD and gdb detach +Added: Show TS version for directly linked servers in STATS ? + +Merged: 6.3+maxtktime patch, Provide definable maximum TKLINE times, + settable with /quote SET + +Included: Patches since 6.3 release + +5 Mar 2002 + ++fr13 + +Against 6.3.1 release + +Changed: Time/Date localization month/day order is not supported on + Slackware and likely other Linux machines. Separated out + into "Day Month" order. They will still have the month names + localized, but the order will now be fixed. + +Added: An IRCnet like server connection notice, including the hopcount + and info. (Idea from IRCnet and +leguin) + +Merged: Lee's (fl_'s) temp dline patch (flamed.net) +Merged: Bill's (billy-jon's) resolving hostname patch (flamed.net) + +Included with 6.3.1: Patches since 6.3 release, SIGTRAP handling + +19 Apr 2002 + ++fr14 + +Against 6.3.1 release + +Changed: Localization changed to be space padded rather than 0 padded in + the day of the month. + +Added: DEOPER_NOTICE (Disabled by default) + +Merged: Lee and jv's STATS v patch + +Merged: Lee's locops umode patch, backported from H7 + +Merged: My JUPE Bypass patch, allowing opers to join and speak in juped + channels. + +14 May 2002 + ++fr15 + +Changed: Minor correction to /info from stock Hybrid 6.3.1 + Added a fix from Androsyn since 6.3.1 + Made tkline expiration notices optional + Made FLAGS work with our +l mode, as LWALLOPS + +Removed: IDENT_ANAL + +Added: PROPAGATE_AWAY, REVERT_USERHOST +Added: /quote SET XLINETYPE, allowing an oper with XLINE_COMMAND enabled + to change the type of XLINE created. + +Corrected: A case where current set and unset flags NOTICES were sent to + the source user twice if FLAGS_ANNOUNCE was enabled. + +23 May 2002 + ++fr16 + +Changed: Added PUT and GET to POST_REGISTER, backported from current -7 + RPL_WELCOME (001) made consistent with -7 plus it includes + the username and sockhost of the connecting client (an attempt + to correct mirc when spoofed) + +Added: Send a notice to opers when a /quote CLOSE is issued + +Corrected: A compile error with XLINE_COMMAND off + +24 May 2002 + ++fr17 + +Against: 6.3.1 + +Added: BURST_AWAY, WALLCHOPS, OLD_KNOCK + +Added: /quote MAP (with +y "spy"ing), Temporary DLINE expiration notice is + now optional + +Changed: All fixes since 6.3.1 release (possible NULL dereference, LTRACE + IP leak, KNOCK change to +p, ranlib check for OpenBSD, %lu to + 0 instead of 000000000) + +Changed: Updated RPL_ISUPPORT tokens to current "standards" + +Changed: Make the server ignore "unknown user mode" numerics from remote + servers. This is due to an issue where csircd servers will complain + about the +a usermode even if it's received from a remote server. + +Changed: Some of the old "show oper reasons in klines/dlines" is back. The + hybrid structure destroys any chance of showing them on + /stats k/K/D, unfortunately. + +Corrected: Fixed a core when using locked kline files (such as using viklines) + and corrected a race condition where some may become lost in + memory. + +Changed: Changed Lee and jv's STATS v extension to be formatted like STATS u + and STATS v in ircd-ratbox. + +Changed: Client Exit: becomes Quit: in compliance with hybrid 7 and ratbox. + +Changed: Remote WHOIS notice includes the servername of the source, from + dilli + +Removed: QOTD patch, it's better to keep it separate. + +4 Sept 2002 + ++fr18 + +Against: 6.3.1 release + +Added: SHOW_JUPE_MODE + +Changed: All zlib errors still using the error code now use the error string. + +Corrected: A case where an oper could set @host klines, with a NULL user + field. + +Changed: MODE_UNAUTH is on permanently + +Added: Added user mode +j, show users trying to join juped channels. As + per request, locally juping and locally unjuping notices are not + changed. + +23 Sept 2002 + ++fr19 + +Against: 6.3.1 release + +Corrected: The server field in remote whois notice was in the wrong place. + +Corrected: XLINETYPE was missing from the /set help text, added. + +Updated: mkpasswd.c + +Corrected: An issue where an admin can /umode -o and still be displayed + as an IRC administrator. + +17 Oct 2002 + ++fr20 + +Against: 6.3.1 release + +Changed: POST_REGISTER to act more like Androsyn's version in hybrid 7. + +Cleaned Up: FLAGS_COMMAND + +Added: SIGUSR1 handling, rereads the motd file. + +25 Nov 2002 + ++fr21 + +Against: 6.3.1 release + +Changed: Enabled "spy" on LTRACE, showing remote LTRACE requests in + addition to local LTRACE requests. + +Added: LTRACE IP hide fix, that seems to have disappeared from Hybrid 6 + CVS + +Added: GLINE patches/fixes from EFnet opers/admins: +|======== +|1. Even though we can't support IPv6, still allow opers on this server +| to vote for GLINE's for IPv6 users (As long as the : only exists in +| the hostname.) +|2. Cosmetic corrections to the "already voted" message. +|3. When a gline is triggered, expire any GLINE requests matching it from +| the pending list. +|======== + +Corrected: Invalid usage of resource parameters in STATS r (though some + remain inaccurate due to overflow of the long values) + +Added: Options to block STATS c and ? from non-opers + +6 Jan 2003 + ++fr22 + +Against: 6.3.1 release + +Fixed: A core that was introduced with the GLINE patch + +25 Jan 2003 + ++fr23 + +Against: 6.3.1 release + +Included: Androsyn's fix for adns from Hybrid 6's cvs. +NOTE: Hybrid 6 CVS was NOT chosed as the base for this because of +ELEET_OPERS, S: lines, and the conflicting +l mode. + +Removed: Numeric 308, RPL_WHOISADMIN. This is considered vanity on +EFnet and is thus gone. It will still be shown in /stats p, I'm awaiting +a decision in Hybrid 7/ratbox before changing this. + +Changed: vimotd/viklines installed as symbolic links rather than hard +links as per discusson on hybrid@the-project.org. + +Added: RPL_WHOISACTUALLY, in the ircd-ratbox format, numeric 338. This +is intended to help spot DNS spoofers. This option is always on. + +Changed: ADMIN_MODE is always defined now. + +Changed: When an operator sets a permanent kline, and a temporary kline +for that user/host/ip already exists, remove the temporary kline and add +the permanent kline. If another temporary kline for that user/host/ip +exists, act as before, don't allow another temporary to override. + +Removed: SLAVE_SERVERS, it doesn't work that well, and is better done in +other ways. In addition, it will interfere with the below patch that was +included. + +Included: fl's KLN/UNKLN propagation patch, needed to allow Hybrid 7/csircd/ +ircd-ratbox remote KLINE and UNKLINE commands to propagate through a Hyb6+fr +hub. This functionality does not let users on the server set remote KLINE's +and UNKLINE's, nor does it let the server accept remote KLINE's and UNKLINE's. +This functionality is also only available on hubs, since it would do no good +on a leaf server. + +Added: The ENCAP command, for compatability with ircd-ratbox and csircd. +Currently, no one uses ENCAP for anything, but the framework and CAPAB are +both in place for when someone does. + +Added: The ETRACE command, for modern monitor bots that track gecos in +addition to nick!user@host and class. Included doc/ETRACE.txt to document +the change. + +Removed: CUSTOM_ERR, ETRACE requires me to move the last valid numeric from +504 to 999, and I did not consider CUSTOM_ERR worth my time to migrate. + +Changed: Reformatted MAP to be consistent with ircd-ratbox. + +Added: The I: line flag {, used to exempt a user from the clone checks. + +22 Apr 2003 + ++fr24 + +Updated: mkpasswd.c from the master site + +Updated: viconf.c from ircd-ratbox + +Changed: Split out m_flags() and support functions into src/m_flags.c and +include/m_flags.h and put the CORRECT license on the files. + +Corrected: 2 cases where duplicate klines could be added to the server +were fixed. + +Corrected: 2 cases where duplicate ilines could be added to the server +were fixed. + +Merged: Some fixes from xyst's current Hyb6 CVS: +1. Removed the id field from struct User. +2. Corrections to the logic of ERROR handling, all ERROR's are logged + with the real IP. The other defines only apply to the notice(s) sent + to opers. +3. Changed the defaulting to class 0 notice. + +Added: Temporary KLINE and DLINE shortcuts, /quote KLINE 1d user@host :blah +will kline a user for 1 day, 1440 minutes. d, w, h, m are all accepted, +and a number without a type specifier will default to minutes. + +Removed: Some unused (anymore) numerics were removed. + +Fixed: Corrected many of the compiler warnings, and allowed CFLAGS to be +specified on the command line, ie $ CFLAGS="-O2 -g -static" ./configure. Also +allowed LDFLAGS to be specified on the command line. + +Changed: KNOCK to use numerics as in Hybrid 7/ircd-ratbox + +Changed: WHOISACTUALLY to be consistant with the recent ircd-ratbox change + +5 May 2003 + ++fr25 + +Corrected: MacOS-X/Darwin compilation issues + +Updated: mkpasswd.c again + +Changed: WHOISACTUALLY will display if you are spoofed and WHOIS'ing yourself. + +Included: Lee's final ENCAP protocol document. diff -uNrd ircd-hybrid-6.3.1.dist/adns/.depend ircd-hybrid-6.3.1/adns/.depend --- ircd-hybrid-6.3.1.dist/adns/.depend Tue Dec 11 21:02:02 2001 +++ ircd-hybrid-6.3.1/adns/.depend Sat May 3 10:22:12 2003 @@ -1,4 +1,3 @@ -# $Id .depend,v 0.0 2001/12/09 17:37:18 lusky Exp $ check.o: check.c internal.h ../include/config.h ../include/setup.h \ adns.h ../include/irc_string.h ../include/ircd_defs.h dlist.h event.o: event.c internal.h ../include/config.h ../include/setup.h \ diff -uNrd ircd-hybrid-6.3.1.dist/adns/Makefile.in ircd-hybrid-6.3.1/adns/Makefile.in --- ircd-hybrid-6.3.1.dist/adns/Makefile.in Thu Dec 6 23:13:21 2001 +++ ircd-hybrid-6.3.1/adns/Makefile.in Sat Apr 19 21:06:44 2003 @@ -1,10 +1,11 @@ # # Makefile.in for ircd/adns # -# $Id: Makefile.in,v 1.3 2001/12/07 04:13:21 jdc Exp $ +# $Id: Makefile.in,v 1.4 2002/07/12 00:04:02 androsyn Exp $ CC = @CC@ RM = @RM@ MKDEP = ${CC} -MM +RANLIB = @RANLIB@ IRCDLIBS = @LIBS@ @@ -51,7 +52,8 @@ libadns.a: ${OBJS} rm -f $@ - ${AR} csqv $@ ${OBJS} + ${AR} cqv $@ ${OBJS} + ${RANLIB} $@ all: libadns.a diff -uNrd ircd-hybrid-6.3.1.dist/adns/check.c ircd-hybrid-6.3.1/adns/check.c --- ircd-hybrid-6.3.1.dist/adns/check.c Tue Dec 4 11:12:10 2001 +++ ircd-hybrid-6.3.1/adns/check.c Thu May 8 11:09:58 2003 @@ -31,6 +31,12 @@ #include "internal.h" +/* This crap is needed to make it compile on OS X + * Leave it to apple to take a perfectly good preprocessor and fuck it + * up. + */ +#define unused_arg /**/ + void adns_checkconsistency(adns_state ads, adns_query qu) { adns__consistency(ads,qu,cc_user); } @@ -185,16 +191,16 @@ if (qu) { switch (qu->state) { case query_tosend: - DLIST_ASSERTON(qu, search, ads->udpw, ); + DLIST_ASSERTON(qu, search, ads->udpw, unused_arg); break; case query_tcpw: - DLIST_ASSERTON(qu, search, ads->tcpw, ); + DLIST_ASSERTON(qu, search, ads->tcpw, unused_arg); break; case query_childw: - DLIST_ASSERTON(qu, search, ads->childw, ); + DLIST_ASSERTON(qu, search, ads->childw, unused_arg); break; case query_done: - DLIST_ASSERTON(qu, search, ads->output, ); + DLIST_ASSERTON(qu, search, ads->output, unused_arg); break; default: assert(!"specific query state"); diff -uNrd ircd-hybrid-6.3.1.dist/adns/dlist.h ircd-hybrid-6.3.1/adns/dlist.h --- ircd-hybrid-6.3.1.dist/adns/dlist.h Tue Dec 4 11:12:11 2001 +++ ircd-hybrid-6.3.1/adns/dlist.h Thu May 8 11:11:11 2003 @@ -32,6 +32,8 @@ #ifndef ADNS_DLIST_H_INCLUDED #define ADNS_DLIST_H_INCLUDED +#define unused_arg /**/ + #define DLIST_INIT(list) ((list).head= (list).tail= 0) #define DLINK_INIT(link) ((link).next= (link).back= 0) @@ -51,7 +53,7 @@ (list).tail= (node); \ } while(0) -#define DLIST_UNLINK(list,node) DLIST_UNLINK_PART(list,node,) -#define DLIST_LINK_TAIL(list,node) DLIST_LINK_TAIL_PART(list,node,) +#define DLIST_UNLINK(list,node) DLIST_UNLINK_PART(list,node,unused_arg) +#define DLIST_LINK_TAIL(list,node) DLIST_LINK_TAIL_PART(list,node,unused_arg) #endif diff -uNrd ircd-hybrid-6.3.1.dist/autoconf/acconfig.h ircd-hybrid-6.3.1/autoconf/acconfig.h --- ircd-hybrid-6.3.1.dist/autoconf/acconfig.h Sun Dec 9 14:02:06 2001 +++ ircd-hybrid-6.3.1/autoconf/acconfig.h Sat Apr 19 21:06:44 2003 @@ -30,3 +30,6 @@ /* Define if you have SYSV non-blocking sockets (FIONBIO) */ #undef NBLOCK_SYSV +/* Define if you have the setlocale() system call. */ +#undef USE_SETLOCALE + diff -uNrd ircd-hybrid-6.3.1.dist/autoconf/config.guess ircd-hybrid-6.3.1/autoconf/config.guess --- ircd-hybrid-6.3.1.dist/autoconf/config.guess Thu Oct 5 23:00:51 2000 +++ ircd-hybrid-6.3.1/autoconf/config.guess Thu May 8 10:52:20 2003 @@ -1,7 +1,6 @@ #! /bin/sh -# $Id: config.guess,v 1.2 2000/10/06 03:00:51 lusky Exp $ # Attempt to guess a canonical system name. -# Copyright (C) 1992, 93, 94, 95, 1996 Free Software Foundation, Inc. +# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -53,11 +52,53 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//'` + cat <dummy.s + .globl main + .ent main +main: + .frame \$30,0,\$26,0 + .prologue 0 + .long 0x47e03d80 # implver $0 + lda \$2,259 + .long 0x47e20c21 # amask $2,$1 + srl \$1,8,\$2 + sll \$2,2,\$2 + sll \$0,3,\$0 + addl \$1,\$0,\$0 + addl \$2,\$0,\$0 + ret \$31,(\$26),1 + .end main +EOF + ${CC-cc} dummy.s -o dummy 2>/dev/null + if test "$?" = 0 ; then + ./dummy + case "$?" in + 7) + UNAME_MACHINE="alpha" + ;; + 15) + UNAME_MACHINE="alphaev5" + ;; + 14) + UNAME_MACHINE="alphaev56" + ;; + 10) + UNAME_MACHINE="alphapca56" + ;; + 16) + UNAME_MACHINE="alphaev6" + ;; + esac + fi + rm -f dummy.s dummy + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]` exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 @@ -69,12 +110,39 @@ echo m68k-cbm-netbsd${UNAME_RELEASE} exit 0 ;; amiga:OpenBSD:*:*) - echo m68k-cbm-openbsd${UNAME_RELEASE} - exit 0 ;; + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + arc64:OpenBSD:*:*) + echo mips64el-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hkmips:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; - Pyramid*:OSx*:*:*|MIS*:OSx*:*:*) + arm32:NetBSD:*:*) + echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + SR2?01:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:*|MIS*:OSx*:*:*|MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 @@ -85,6 +153,9 @@ NILE:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; @@ -109,6 +180,18 @@ sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; @@ -116,23 +199,32 @@ echo m68k-atari-netbsd${UNAME_RELEASE} exit 0 ;; atari*:OpenBSD:*:*) - echo m68k-atari-openbsd${UNAME_RELEASE} + echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3*:NetBSD:*:*) echo m68k-sun-netbsd${UNAME_RELEASE} exit 0 ;; sun3*:OpenBSD:*:*) - echo m68k-sun-openbsd${UNAME_RELEASE} + echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:NetBSD:*:*) echo m68k-apple-netbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) - echo m68k-apple-openbsd${UNAME_RELEASE} + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; + macppc:NetBSD:*:*) + echo powerpc-apple-netbsd${UNAME_RELEASE} + exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; @@ -142,6 +234,9 @@ VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; + 2020:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) sed 's/^ //' << EOF >dummy.c int main (argc, argv) int argc; char **argv; { @@ -235,7 +330,8 @@ fi exit 0 ;; *:AIX:*:4) - if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` + if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc @@ -268,12 +364,44 @@ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; - 9000/[3478]??:HP-UX:*:*) + 9000/[34678]??:HP-UX:*:*) case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;; - 9000/8?? ) HP_ARCH=hppa1.0 ;; + 9000/6?? | 9000/7?? | 9000/80[24] | 9000/8?[13679] | 9000/892 ) + sed 's/^ //' << EOF >dummy.c + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (${CC-cc} dummy.c -o dummy 2>/dev/null ) && HP_ARCH=`./dummy` + rm -f dummy.c dummy esac HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ${HP_ARCH}-hp-hpux${HPUX_REV} @@ -376,8 +504,11 @@ hp3[0-9][05]:NetBSD:*:*) echo m68k-hp-netbsd${UNAME_RELEASE} exit 0 ;; - hp3[0-9][05]:OpenBSD:*:*) - echo m68k-hp-openbsd${UNAME_RELEASE} + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; i?86:BSD/386:*:* | *:BSD/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} @@ -392,52 +523,146 @@ echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` exit 0 ;; i*:CYGWIN*:*) - echo i386-pc-cygwin32 + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin32 + echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) - echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *:Linux:*:*) + # uname on the ARM produces all sorts of strangeness, and we need to + # filter it out. + case "$UNAME_MACHINE" in + arm* | sa110*) UNAME_MACHINE="arm" ;; + esac + # The BFD linker knows what the default object file format is, so # first see if it will tell us. ld_help_string=`ld --help 2>&1` - if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i.86"; then - echo "${UNAME_MACHINE}-pc-linux-gnu" ; exit 0 - elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86linux"; then - echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 - elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86coff"; then - echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 - elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then - echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0 - elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then - echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 - elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf32ppc"; then - echo "powerpc-unknown-linux-gnu" ; exit 0 - elif test "${UNAME_MACHINE}" = "alpha" ; then - echo alpha-unknown-linux-gnu ; exit 0 - elif test "${UNAME_MACHINE}" = "sparc" ; then - echo sparc-unknown-linux-gnu ; exit 0 + ld_supported_emulations=`echo $ld_help_string \ + | sed -ne '/supported emulations:/!d + s/[ ][ ]*/ /g + s/.*supported emulations: *// + s/ .*// + p'` + case "$ld_supported_emulations" in + i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;; + i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;; + sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;; + esac + + if test "${UNAME_MACHINE}" = "alpha" ; then + sed 's/^ //' <dummy.s + .globl main + .ent main + main: + .frame \$30,0,\$26,0 + .prologue 0 + .long 0x47e03d80 # implver $0 + lda \$2,259 + .long 0x47e20c21 # amask $2,$1 + srl \$1,8,\$2 + sll \$2,2,\$2 + sll \$0,3,\$0 + addl \$1,\$0,\$0 + addl \$2,\$0,\$0 + ret \$31,(\$26),1 + .end main +EOF + LIBC="" + ${CC-cc} dummy.s -o dummy 2>/dev/null + if test "$?" = 0 ; then + ./dummy + case "$?" in + 7) + UNAME_MACHINE="alpha" + ;; + 15) + UNAME_MACHINE="alphaev5" + ;; + 14) + UNAME_MACHINE="alphaev56" + ;; + 10) + UNAME_MACHINE="alphapca56" + ;; + 16) + UNAME_MACHINE="alphaev6" + ;; + esac + + objdump --private-headers dummy | \ + grep ld.so.1 > /dev/null + if test "$?" = 0 ; then + LIBC="libc1" + fi + fi + rm -f dummy.s dummy + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 + elif test "${UNAME_MACHINE}" = "mips" ; then + cat >dummy.c </dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 + rm -f dummy.c dummy else - # Either a pre-BFD a.out linker (linux-gnuoldld) or one that does not give us - # useful --help. Gcc wants to distinguish between linux-gnuoldld and linux-gnuaout. - test ! -d /usr/lib/ldscripts/. \ - && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 + # Either a pre-BFD a.out linker (linux-gnuoldld) + # or one that does not give us useful --help. + # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. + # If ld does not provide *any* "supported emulations:" + # that means it is gnuoldld. + echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" + test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 + + case "${UNAME_MACHINE}" in + i?86) + VENDOR=pc; + ;; + *) + VENDOR=unknown; + ;; + esac # Determine whether the default compiler is a.out or elf cat >dummy.c < main(argc, argv) -int argc; -char *argv[]; + int argc; + char *argv[]; { #ifdef __ELF__ - printf ("%s-pc-linux-gnu\n", argv[1]); +# ifdef __GLIBC__ +# if __GLIBC__ >= 2 + printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); +# else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); +# endif +# else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); +# endif #else - printf ("%s-pc-linux-gnuaout\n", argv[1]); + printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); #endif return 0; } @@ -450,6 +675,14 @@ i?86:DYNIX/ptx:4*:*) echo i386-sequent-sysv4 exit 0 ;; + i?86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} @@ -471,6 +704,18 @@ echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; + i?86:UnixWare:*:*) + if /bin/uname -X 2>/dev/null >/dev/null ; then + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + fi + echo ${UNAME_MACHINE}-unixware-${UNAME_RELEASE}-${UNAME_VERSION} + exit 0 ;; + pc:*:*:*) + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; @@ -530,6 +775,10 @@ echo ns32k-sni-sysv fi exit 0 ;; + PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm @@ -542,17 +791,25 @@ mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; - R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*) + news*:NEWS-OS:*:6*) + echo mips-sony-newsos6 + exit 0 ;; + R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; - PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff -uNrd ircd-hybrid-6.3.1.dist/autoconf/config.sub ircd-hybrid-6.3.1/autoconf/config.sub --- ircd-hybrid-6.3.1.dist/autoconf/config.sub Thu Oct 5 23:00:51 2000 +++ ircd-hybrid-6.3.1/autoconf/config.sub Thu May 8 10:52:25 2003 @@ -1,7 +1,6 @@ #! /bin/sh -# $Id: config.sub,v 1.2 2000/10/06 03:00:51 lusky Exp $ # Configuration validation subroutine script, version 1.1. -# Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. +# Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc. # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. @@ -150,19 +149,20 @@ case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. - tahoe | i860 | m68k | m68000 | m88k | ns32k | arm \ - | arme[lb] | pyramid \ - | tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \ - | alpha | we32k | ns16k | clipper | i370 | sh \ - | powerpc | powerpcle | 1750a | dsp16xx | mips64 | mipsel \ - | pdp11 | mips64el | mips64orion | mips64orionel \ - | sparc | sparclet | sparclite | sparc64) + tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ + | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ + | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \ + | alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \ + | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \ + | mips64 | mipsel | mips64el | mips64orion | mips64orionel \ + | mipstx39 | mipstx39el \ + | sparc | sparclet | sparclite | sparc64 | v850) basic_machine=$basic_machine-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. - i[3456]86) + i[34567]86) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. @@ -171,14 +171,18 @@ exit 1 ;; # Recognize the basic CPU types with company name. - vax-* | tahoe-* | i[3456]86-* | i860-* | m68k-* | m68000-* | m88k-* \ - | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \ - | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \ - | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \ - | hppa-* | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \ - | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \ - | pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \ - | mips64el-* | mips64orion-* | mips64orionel-* | f301-*) + vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \ + | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ + | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ + | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \ + | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \ + | alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \ + | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \ + | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ + | sparc64-* | mips64-* | mipsel-* \ + | mips64el-* | mips64orion-* | mips64orionel-* \ + | mipstx39-* | mipstx39el-* \ + | f301-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. @@ -205,9 +209,9 @@ amiga | amiga-*) basic_machine=m68k-cbm ;; - amigados) + amigaos | amigados) basic_machine=m68k-cbm - os=-amigados + os=-amigaos ;; amigaunix | amix) basic_machine=m68k-cbm @@ -346,19 +350,19 @@ os=-mvs ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? - i[3456]86v32) + i[34567]86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; - i[3456]86v4*) + i[34567]86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; - i[3456]86v) + i[34567]86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; - i[3456]86sol2) + i[34567]86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; @@ -390,6 +394,14 @@ miniframe) basic_machine=m68000-convergent ;; + mipsel*-linux*) + basic_machine=mipsel-unknown + os=-linux-gnu + ;; + mips*-linux*) + basic_machine=mips-unknown + os=-linux-gnu + ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; @@ -457,25 +469,23 @@ pc532 | pc532-*) basic_machine=ns32k-pc532 ;; - pentium | p5) - basic_machine=i586-intel + pentium | p5 | k5 | nexen) + basic_machine=i586-pc ;; - pentiumpro | p6) - basic_machine=i686-intel + pentiumpro | p6 | k6 | 6x86) + basic_machine=i686-pc ;; - pentium-* | p5-*) + pentiumii | pentium2) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | nexen-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - pentiumpro-* | p6-*) + pentiumpro-* | p6-* | k6-* | 6x86-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - k5) - # We don't have specific support for AMD's K5 yet, so just call it a Pentium - basic_machine=i586-amd - ;; - nexen) - # We don't have specific support for Nexgen yet, so just call it a Pentium - basic_machine=i586-nexgen + pentiumii-* | pentium2-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould @@ -559,6 +569,12 @@ basic_machine=i386-sequent os=-dynix ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; tower | tower-32) basic_machine=m68k-ncr ;; @@ -578,7 +594,7 @@ basic_machine=vax-dec os=-vms ;; - vpp*|vx|vx-*) + vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) @@ -608,7 +624,11 @@ # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. mips) - basic_machine=mips-mips + if [ x$os = x-linux-gnu ]; then + basic_machine=mips-unknown + else + basic_machine=mips-mips + fi ;; romp) basic_machine=romp-ibm @@ -669,9 +689,12 @@ -solaris) os=-solaris2 ;; - -unixware* | svr4*) + -svr4*) os=-sysv4 ;; + -unixware*) + os=-sysv4.2uw + ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; @@ -682,15 +705,16 @@ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -linux-gnu* | -uxpv*) + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -linux*) @@ -803,6 +827,9 @@ sparc-* | *-sun) os=-sunos4.1.1 ;; + *-be) + os=-beos + ;; *-ibm) os=-aix ;; @@ -816,7 +843,7 @@ os=-sysv ;; *-cbm) - os=-amigados + os=-amigaos ;; *-dg) os=-dgux diff -uNrd ircd-hybrid-6.3.1.dist/autoconf/configure.in ircd-hybrid-6.3.1/autoconf/configure.in --- ircd-hybrid-6.3.1.dist/autoconf/configure.in Sun Jan 27 23:36:52 2002 +++ ircd-hybrid-6.3.1/autoconf/configure.in Thu May 8 11:16:50 2003 @@ -1,4 +1,4 @@ -dnl $Id: configure.in,v 1.28 2002/01/28 04:36:52 androsyn Exp $ +dnl $Id: configure.in,v 1.29 2002/07/12 00:04:04 androsyn Exp $ dnl Process this file with autoconf to produce a configure script. AC_INIT(include/class.h) @@ -13,11 +13,12 @@ dnl Checks for programs. AC_PROG_CC AC_ISC_POSIX -AC_CANONICAL_SYSTEM +dnl AC_CANONICAL_SYSTEM AC_PROG_MAKE_SET AC_PATH_PROG(RM,rm) AC_PATH_PROG(CP,cp) AC_PROG_INSTALL +AC_PROG_RANLIB AC_C_INLINE dnl Checks for libraries. @@ -28,7 +29,7 @@ dnl Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS(sys/param.h sys/select.h errno.h string.h stddef.h getopt.h crypt.h) +AC_CHECK_HEADERS(sys/param.h sys/select.h errno.h string.h stddef.h getopt.h crypt.h locale.h) dnl Check for stdarg.h - if we can't find it, halt configure AC_CHECK_HEADER(stdarg.h, , AC_MSG_ERROR(** stdarg.h could not be found - ircd-hybrid will not compile without it **)) @@ -40,6 +41,9 @@ dnl for zlib 1.0.2 or higher by looking for zlibVersion(). AC_CHECK_LIB(z, deflate) AC_CHECK_FUNC(zlibVersion, , AC_MSG_WARN(zlib 1.0.2 or higher required for ZIPLINK support)) + +dnl check for setlocale() call +AC_CHECK_FUNC(setlocale, AC_DEFINE(USE_SETLOCALE),) dnl check for poll() call AC_CHECK_FUNC(poll, AC_DEFINE(USE_POLL),) diff -uNrd ircd-hybrid-6.3.1.dist/configure ircd-hybrid-6.3.1/configure --- ircd-hybrid-6.3.1.dist/configure Sun Jan 27 23:36:49 2002 +++ ircd-hybrid-6.3.1/configure Thu May 8 11:16:53 2003 @@ -28,6 +28,7 @@ program_transform_name=s,x,x, silent= site= +sitefile= srcdir= target=NONE verbose= @@ -142,6 +143,7 @@ --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -312,6 +314,11 @@ -site=* | --site=* | --sit=*) site="$ac_optarg" ;; + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -477,12 +484,16 @@ srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi fi +else + CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -551,7 +562,7 @@ # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:555: checking for $ac_word" >&5 +echo "configure:566: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -581,7 +592,7 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:585: checking for $ac_word" >&5 +echo "configure:596: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -632,7 +643,7 @@ # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:636: checking for $ac_word" >&5 +echo "configure:647: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -664,7 +675,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:668: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:679: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -675,12 +686,12 @@ cat > conftest.$ac_ext << EOF -#line 679 "configure" +#line 690 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -706,12 +717,12 @@ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:710: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:721: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:715: checking whether we are using GNU C" >&5 +echo "configure:726: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -720,7 +731,7 @@ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:724: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:735: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -739,7 +750,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:743: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:754: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -771,7 +782,7 @@ fi echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:775: checking for POSIXized ISC" >&5 +echo "configure:786: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then @@ -791,97 +802,8 @@ ISC= fi - -# Do some error checking and defaulting for the host and target type. -# The inputs are: -# configure --host=HOST --target=TARGET --build=BUILD NONOPT -# -# The rules are: -# 1. You are not allowed to specify --host, --target, and nonopt at the -# same time. -# 2. Host defaults to nonopt. -# 3. If nonopt is not specified, then host defaults to the current host, -# as determined by config.guess. -# 4. Target and build default to nonopt. -# 5. If nonopt is not specified, then target and build default to host. - -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -case $host---$target---$nonopt in -NONE---*---* | *---NONE---* | *---*---NONE) ;; -*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; -esac - - -# Make sure we can run config.sub. -if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : -else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } -fi - -echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:823: checking host system type" >&5 - -host_alias=$host -case "$host_alias" in -NONE) - case $nonopt in - NONE) - if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : - else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } - fi ;; - *) host_alias=$nonopt ;; - esac ;; -esac - -host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$host" 1>&6 - -echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:844: checking target system type" >&5 - -target_alias=$target -case "$target_alias" in -NONE) - case $nonopt in - NONE) target_alias=$host_alias ;; - *) target_alias=$nonopt ;; - esac ;; -esac - -target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` -target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$target" 1>&6 - -echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:862: checking build system type" >&5 - -build_alias=$build -case "$build_alias" in -NONE) - case $nonopt in - NONE) build_alias=$host_alias ;; - *) build_alias=$nonopt ;; - esac ;; -esac - -build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` -build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$build" 1>&6 - -test "$host_alias" != "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - NONENONEs,x,x, && - program_prefix=${target_alias}- - echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:885: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:807: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -910,7 +832,7 @@ # Extract the first word of "rm", so it can be a program name with args. set dummy rm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:914: checking for $ac_word" >&5 +echo "configure:836: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_RM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -945,7 +867,7 @@ # Extract the first word of "cp", so it can be a program name with args. set dummy cp; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:949: checking for $ac_word" >&5 +echo "configure:871: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_CP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -989,7 +911,7 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:993: checking for a BSD compatible install" >&5 +echo "configure:915: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1041,22 +963,52 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' +# Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:970: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:1046: checking for inline" >&5 +echo "configure:998: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -1083,7 +1035,7 @@ echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:1087: checking for socket in -lsocket" >&5 +echo "configure:1039: checking for socket in -lsocket" >&5 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1091,7 +1043,7 @@ ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1130,12 +1082,12 @@ fi echo $ac_n "checking for crypt""... $ac_c" 1>&6 -echo "configure:1134: checking for crypt" >&5 +echo "configure:1086: checking for crypt" >&5 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_crypt=yes" else @@ -1176,7 +1128,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for crypt in -ldescrypt""... $ac_c" 1>&6 -echo "configure:1180: checking for crypt in -ldescrypt" >&5 +echo "configure:1132: checking for crypt in -ldescrypt" >&5 ac_lib_var=`echo descrypt'_'crypt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1184,7 +1136,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldescrypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1221,7 +1173,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:1225: checking for crypt in -lcrypt" >&5 +echo "configure:1177: checking for crypt in -lcrypt" >&5 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1229,7 +1181,7 @@ ac_save_LIBS="$LIBS" LIBS="-lcrypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1272,12 +1224,12 @@ fi echo $ac_n "checking for inet_ntoa""... $ac_c" 1>&6 -echo "configure:1276: checking for inet_ntoa" >&5 +echo "configure:1228: checking for inet_ntoa" >&5 if eval "test \"`echo '$''{'ac_cv_func_inet_ntoa'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_inet_ntoa=yes" else @@ -1318,7 +1270,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for inet_ntoa in -lnsl""... $ac_c" 1>&6 -echo "configure:1322: checking for inet_ntoa in -lnsl" >&5 +echo "configure:1274: checking for inet_ntoa in -lnsl" >&5 ac_lib_var=`echo nsl'_'inet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1326,7 +1278,7 @@ ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1367,12 +1319,12 @@ fi echo $ac_n "checking for inet_aton""... $ac_c" 1>&6 -echo "configure:1371: checking for inet_aton" >&5 +echo "configure:1323: checking for inet_aton" >&5 if eval "test \"`echo '$''{'ac_cv_func_inet_aton'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_inet_aton=yes" else @@ -1413,7 +1365,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6 -echo "configure:1417: checking for inet_aton in -lresolv" >&5 +echo "configure:1369: checking for inet_aton in -lresolv" >&5 ac_lib_var=`echo resolv'_'inet_aton | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1421,7 +1373,7 @@ ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1463,7 +1415,7 @@ echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1467: checking how to run the C preprocessor" >&5 +echo "configure:1419: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1478,13 +1430,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1488: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1440: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1495,13 +1447,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1505: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1457: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1512,13 +1464,13 @@ rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1522: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1474: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1543,12 +1495,12 @@ echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1547: checking for ANSI C header files" >&5 +echo "configure:1499: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1556,7 +1508,7 @@ #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1560: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1512: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1573,7 +1525,7 @@ if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1591,7 +1543,7 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1612,7 +1564,7 @@ : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1623,7 +1575,7 @@ exit (0); } EOF -if { (eval echo configure:1627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1646,21 +1598,21 @@ fi -for ac_hdr in sys/param.h sys/select.h errno.h string.h stddef.h getopt.h crypt.h +for ac_hdr in sys/param.h sys/select.h errno.h string.h stddef.h getopt.h crypt.h locale.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1654: checking for $ac_hdr" >&5 +echo "configure:1606: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1664: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1616: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1689,17 +1641,17 @@ ac_safe=`echo "stdarg.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for stdarg.h""... $ac_c" 1>&6 -echo "configure:1693: checking for stdarg.h" >&5 +echo "configure:1645: checking for stdarg.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1703: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1655: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1724,13 +1676,13 @@ if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:1728: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:1680: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP @@ -1748,7 +1700,7 @@ if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -1771,7 +1723,7 @@ echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6 -echo "configure:1775: checking for deflate in -lz" >&5 +echo "configure:1727: checking for deflate in -lz" >&5 ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1779,7 +1731,7 @@ ac_save_LIBS="$LIBS" LIBS="-lz $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1818,12 +1770,12 @@ fi echo $ac_n "checking for zlibVersion""... $ac_c" 1>&6 -echo "configure:1822: checking for zlibVersion" >&5 +echo "configure:1774: checking for zlibVersion" >&5 if eval "test \"`echo '$''{'ac_cv_func_zlibVersion'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_zlibVersion=yes" else @@ -1867,13 +1819,65 @@ fi +echo $ac_n "checking for setlocale""... $ac_c" 1>&6 +echo "configure:1824: checking for setlocale" >&5 +if eval "test \"`echo '$''{'ac_cv_func_setlocale'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char setlocale(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_setlocale) || defined (__stub___setlocale) +choke me +#else +setlocale(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_setlocale=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_setlocale=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'setlocale`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define USE_SETLOCALE 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + + echo $ac_n "checking for poll""... $ac_c" 1>&6 -echo "configure:1872: checking for poll" >&5 +echo "configure:1876: checking for poll" >&5 if eval "test \"`echo '$''{'ac_cv_func_poll'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_poll=yes" else @@ -1920,12 +1924,12 @@ echo $ac_n "checking for non-blocking socket implementation""... $ac_c" 1>&6 -echo "configure:1924: checking for non-blocking socket implementation" >&5 +echo "configure:1928: checking for non-blocking socket implementation" >&5 if test "$cross_compiling" = yes; then echo "$ac_t""cross compiling " 1>&6 else cat > conftest.$ac_ext < @@ -1957,7 +1961,7 @@ } EOF -if { (eval echo configure:1961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cat >> confdefs.h <<\EOF #define NBLOCK_POSIX 1 @@ -1975,17 +1979,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1979: checking for $ac_hdr" >&5 +echo "configure:1983: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1989: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2014,12 +2018,12 @@ for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2018: checking for $ac_func" >&5 +echo "configure:2022: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2067,7 +2071,7 @@ done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:2071: checking for working mmap" >&5 +echo "configure:2075: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2075,7 +2079,7 @@ ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -2242,7 +2246,7 @@ echo "$ac_t""unable to test" 1>&6 else cat > conftest.$ac_ext < @@ -2274,7 +2278,7 @@ } EOF -if { (eval echo configure:2278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cat >> confdefs.h <<\EOF #define NBLOCK_BSD 1 @@ -2292,7 +2296,7 @@ echo "$ac_t""unable to test" 1>&6 else cat > conftest.$ac_ext < @@ -2324,7 +2328,7 @@ } EOF -if { (eval echo configure:2328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cat >> confdefs.h <<\EOF #define NBLOCK_SYSV 1 @@ -2339,12 +2343,12 @@ echo $ac_n "checking signal implementation""... $ac_c" 1>&6 -echo "configure:2343: checking signal implementation" >&5 +echo "configure:2347: checking signal implementation" >&5 if test "$cross_compiling" = yes; then echo "$ac_t""unknown" 1>&6 else cat > conftest.$ac_ext < @@ -2358,7 +2362,7 @@ } EOF -if { (eval echo configure:2362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cat >> confdefs.h <<\EOF #define POSIX_SIGNALS 1 @@ -2372,7 +2376,7 @@ echo "$ac_t""uknown" 1>&6 else cat > conftest.$ac_ext < @@ -2393,7 +2397,7 @@ } EOF -if { (eval echo configure:2397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cat >> confdefs.h <<\EOF #define BSD_RELIABLE_SIGNALS 1 @@ -2552,27 +2556,13 @@ s%@PACKAGE@%$PACKAGE%g s%@VERSION@%$VERSION%g s%@CC@%$CC%g -s%@host@%$host%g -s%@host_alias@%$host_alias%g -s%@host_cpu@%$host_cpu%g -s%@host_vendor@%$host_vendor%g -s%@host_os@%$host_os%g -s%@target@%$target%g -s%@target_alias@%$target_alias%g -s%@target_cpu@%$target_cpu%g -s%@target_vendor@%$target_vendor%g -s%@target_os@%$target_os%g -s%@build@%$build%g -s%@build_alias@%$build_alias%g -s%@build_cpu@%$build_cpu%g -s%@build_vendor@%$build_vendor%g -s%@build_os@%$build_os%g s%@SET_MAKE@%$SET_MAKE%g s%@RM@%$RM%g s%@CP@%$CP%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@RANLIB@%$RANLIB%g s%@CPP@%$CPP%g CEOF diff -uNrd ircd-hybrid-6.3.1.dist/doc/ETRACE.txt ircd-hybrid-6.3.1/doc/ETRACE.txt --- ircd-hybrid-6.3.1.dist/doc/ETRACE.txt Wed Dec 31 19:00:00 1969 +++ ircd-hybrid-6.3.1/doc/ETRACE.txt Mon Apr 21 16:19:14 2003 @@ -0,0 +1,70 @@ +ETRACE Protocol (as implemented by ircd-ratbox and Hybrid 6+fr) + +ETRACE is used to provide monitor bots with all of the information they +should need, including GECOS data (which is absent from a standard TRACE). + +The ETRACE command is only available to local opered connections. The +command takes no parameters. + +ETRACE will retun the following numerics: + +: 709 : + +Where the field is "Oper" or "User" +and the field is "255.255.255.255" for a spoofed connection. + +: 262 :End of TRACE + +The original ETRACE proposal is included below. The actual implementation +differs from the proposal. + +---------------------------------------------------------------------------- + +ETRACE Proposal 15 déc 2002 +Revision 0.3 + +As we presently stand, gecos data is provided in the client connection +notice in Hybrid 7, ircd-ratbox, and Hybrid 6 servers running +fr or +the standalone gecos-cliconnect.diff patch. This gecos data is then +tracked by TCM and other monitor bots and scripts. + +The issue occurs when the monitor connects to the server. TRACE does +not currently include the gecos data, and in my opinion should not. +This issue also occurs when the monitor is asked to refresh its tables, +as in .trace in TCM. + +I propose creating a new, local only command, restricted to operators +with the nick_changes = yes; / N oper flag. This command will list +all local users in a format that is very easy for a monitor to parse. +It will NOT include all of the data typically included with TRACE. + +Command: ETRACE +Parameters: NONE +Output: + +: 604 Oper : +: 605 User : +: 606 :End of ETRACE + +The numerics 604 and 605 were chosen to match the standard TRACE +numerics for opers and users, 204 and 205. + +I have not yet created a reference implementation. When I do, the +patches/modules will be found here. + +W. Campbell +Sarisa/Hwy +irc.rt.ru + +Comments Section: + +Is ETRACE the best name? I chose ETRACE for "Extended TRACE". ULIST +was proposed as another name for the command. XTRACE was also proposed, +also meaning "eXtended TRACE". + +This command is truly a temporary measure, the true solution is creating +another client type (for example MONITOR) that will act like an oper +but be sent data in an easily parsed format. + +Should a parameter be accepted, for example match() against the gecos? + diff -uNrd ircd-hybrid-6.3.1.dist/doc/encap.txt ircd-hybrid-6.3.1/doc/encap.txt --- ircd-hybrid-6.3.1.dist/doc/encap.txt Wed Dec 31 19:00:00 1969 +++ ircd-hybrid-6.3.1/doc/encap.txt Sat May 10 09:35:03 2003 @@ -0,0 +1,35 @@ +ENCAP DEFINITION +---------------- + +Preamble +-------- + +This document defines the specification for the ENCAP command. + +ENCAP is designed to help fix the situation where new commands do +not propagate over hub servers running older code. + +Definition +---------- + +Support for the ENCAP command is given by the CAPAB token "ENCAP". + +The format of ENCAP is: + : ENCAP + + - The entity generating the command. + + - The entity the command is destined for. This may + include wildcards for servers, but not clients. + + If the wildcard does not match the current server, the + command should be propagated and ignored. + + - The subcommand we're propagating over ENCAP. If the + subcommand is not recognised by the current server, the + command should be propagated and ignored. + + - The parameters that the subcommand have. + + + diff -uNrd ircd-hybrid-6.3.1.dist/doc/example.conf ircd-hybrid-6.3.1/doc/example.conf --- ircd-hybrid-6.3.1.dist/doc/example.conf Sun Dec 30 02:50:33 2001 +++ ircd-hybrid-6.3.1/doc/example.conf Tue Apr 22 10:24:57 2003 @@ -189,6 +189,10 @@ ## ## < This user is exempt from idle restrictions if IDLE_CHECK is defined ## +## / This user must have a resolving host to connect to the server +## +## { This user is exempt from clone checks if CHECK_CLONE is defined +## ## Examples ## c) I:NOMATCH::^db@koruna.varner.com::3 @@ -227,6 +231,7 @@ ## disable an opers use of /rehash ## D/d - allow the use of /die or /restart. Default is d for disallowing ## /die /restart +## A/a - allow the use of usermode +a, mark the oper as an admin ## ## Default flags for opers are GKORUH ## Default flags for local ops, KUH @@ -326,6 +331,10 @@ # IRC will actively try to connect to that server. You should have at least # one such line. # +# If the port number is negative, the server will set the absolute value of +# the port as the default for that server link, but not actively autoconnect +# to the server. +# # If an N: line contains four fields, the fourth should contain a number that # specifies how many components of your own server's name to strip off the # front and be replaced with a *. This is done to implement hostmasking. @@ -429,25 +438,8 @@ # d:199.0.154.0/24:Don't D line ais.net: -# -# server "clusters" -# U: lines treat each of these servers as being part of your server cluster -# klines placed on this server will be forwarded to the servers named -# in the U lines here. LOCOPS will also be forwarded, but will appear -# as "SLOCOPS" instead of "LOCOPS" -# -# i.e. irc_hub.somewhere.net has leaf servers irc1.somewhere.net -# irc2.somewhere.net - -# Hub server would have -U:irc1.somewhere.net: -U:irc2.somewhere.net - -# each client server would have -U:irc_hub.somewhere.net +# server "clusters" (U: lines) are no longer present. -# -# # Q lines, not the old server Q lines, but Quarantine lines for # nicks. Only checked at NICK time, i.e. if added and hashed in # will not kill users who match this nick. diff -uNrd ircd-hybrid-6.3.1.dist/include/channel.h ircd-hybrid-6.3.1/include/channel.h --- ircd-hybrid-6.3.1.dist/include/channel.h Thu Dec 6 15:56:08 2001 +++ ircd-hybrid-6.3.1/include/channel.h Sat Apr 19 21:06:44 2003 @@ -56,7 +56,11 @@ struct Mode mode; char topic[TOPICLEN + 1]; #ifdef TOPIC_INFO +#ifdef TOPIC_UH + char topic_nick[NICKLEN + HOSTLEN + USERLEN + 3]; +#else char topic_nick[NICKLEN + 1]; +#endif /* TOPIC_UH */ time_t topic_time; #endif int users; diff -uNrd ircd-hybrid-6.3.1.dist/include/client.h ircd-hybrid-6.3.1/include/client.h --- ircd-hybrid-6.3.1.dist/include/client.h Sun Feb 17 00:58:09 2002 +++ ircd-hybrid-6.3.1/include/client.h Tue Apr 29 22:27:23 2003 @@ -51,8 +51,6 @@ #define HOSTIPLEN 16 /* Length of dotted quad form of IP */ /* - Dianora */ #define PASSWDLEN 20 -#define IDLEN 12 /* this is the maximum length, not the actual - generated length; DO NOT CHANGE! */ #define CLIENT_BUFSIZE 512 /* must be at least 512 bytes */ /* @@ -79,7 +77,6 @@ time_t last; int refcnt; /* Number of times this block is referenced */ int joined; /* number of channels joined */ - char id[IDLEN + 1]; /* for future use *hint* */ const char* server; /* pointer to scached server name */ /* ** In a perfect world the 'server' name @@ -103,6 +100,7 @@ struct Client* servers; /* Servers on this server */ struct Client* users; /* Users on this server */ int tsversion; /* ts version sent in SVINFO */ + unsigned int usercnt; }; struct Client @@ -238,6 +236,9 @@ time_t last_nick_change; int number_of_nick_changes; #endif +#ifdef ANTI_IP_SPOOF + unsigned int random_ping; +#endif time_t last_knock; /* don't allow knock to flood */ /* * client->sockhost contains the ip address gotten from the socket as a @@ -337,9 +338,13 @@ #define FLAGS_INVISIBLE 0x0400 /* makes user invisible */ #define FLAGS_BOTS 0x0800 /* shows bots */ #define FLAGS_EXTERNAL 0x1000 /* show servers introduced */ +#define FLAGS_UNAUTH 0x2000 /* show unauth messages */ /* 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 Administrator */ +#define FLAGS_LOCOPS 0x20000 /* local wallops */ +#define FLAGS_JUPE 0x40000 /* client joining juped channel */ /* *sigh* overflow flags */ #define FLAGS2_RESTRICTED 0x0001 /* restricted client */ @@ -349,6 +354,10 @@ #define FLAGS2_F_LINED 0x0010 /* client is graced with F line */ #define FLAGS2_EXEMPTGLINE 0x2000 /* client can't be G-lined */ +#ifdef ANTI_IP_SPOOF +# define FLAGS2_GOT_ANTI_SPOOF_PING 0x800000 +#endif + /* oper priv flags */ #define FLAGS2_OPER_GLOBAL_KILL 0x0020 /* oper can global kill */ #define FLAGS2_OPER_REMOTE 0x0040 /* oper can do squits/connects */ @@ -358,6 +367,7 @@ #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 0x01000000 /* oper is an admin */ #define FLAGS2_OPER_FLAGS (FLAGS2_OPER_GLOBAL_KILL | \ FLAGS2_OPER_REMOTE | \ FLAGS2_OPER_UNKLINE | \ @@ -365,7 +375,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 */ @@ -383,11 +395,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_UNAUTH | FLAGS_LOCOPS | FLAGS_JUPE ) #ifndef OPER_UMODES #define OPER_UMODES (FLAGS_OPER | FLAGS_WALLOP | FLAGS_SERVNOTICE | \ @@ -434,6 +447,8 @@ #define SendServNotice(x) (((x)->umodes & FLAGS_SERVNOTICE) && IsAnOper(x)) #define SendOperwall(x) ((x)->umodes & FLAGS_OPERWALL) #define SendCConnNotice(x) ((x)->umodes & FLAGS_CCONN) +#define SendUnauthNotice(x) ((x)->umodes & FLAGS_UNAUTH) +#define SendJupeNotice(x) ((x)->umodes & FLAGS_JUPE) #define SendRejNotice(x) ((x)->umodes & FLAGS_REJ) #define SendSkillNotice(x) ((x)->umodes & FLAGS_SKILL) #define SendFullNotice(x) ((x)->umodes & FLAGS_FULL) @@ -441,6 +456,7 @@ #define SendDebugNotice(x) ((x)->umodes & FLAGS_DEBUG) #define SendNickChange(x) ((x)->umodes & FLAGS_NCHANGE) #define SetWallops(x) ((x)->umodes |= FLAGS_WALLOP) +#define SendLocops(x) (((x)->umodes & FLAGS_LOCOPS) && IsAnOper(x)) #ifdef REJECT_HOLD @@ -503,6 +519,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 -uNrd ircd-hybrid-6.3.1.dist/include/config.h ircd-hybrid-6.3.1/include/config.h --- ircd-hybrid-6.3.1.dist/include/config.h Sun Feb 17 00:58:09 2002 +++ ircd-hybrid-6.3.1/include/config.h Fri May 2 11:33:29 2003 @@ -111,6 +111,224 @@ #define HPATH "opers.txt" #define OPATH "opers.motd" +/* +fr patches - Hwy + * Each is optional... + */ + +/* SAVE_MAXCLIENT - store the max local and global client connections + * into the file specified by MXPATH at the interval specified by + * SAVE_TIME + * Credits: Hwy, idea from bahamut + */ +#define SAVE_MAXCLIENT +#ifdef SAVE_MAXCLIENT +# define MXPATH "ircd.max" +# define SAVE_TIME 3600 +#endif + +/* + * XLINE_COMMAND - Enable a command to dynamically add an X: line + * Credits: Hwy + */ +#undef XLINE_COMMAND + +/* Don't touch these */ +#define XLINE_WARN 0 +#define XLINE_REJECT 1 +#define XLINE_SILENT 2 + +/* Set the default type of XLINE to be created, can be changed with + * /quote SET XLINETYPE [WARN|REJECT|SILENT]. + */ +#define DEFAULT_XLINETYPE XLINE_WARN + +/* + * CRYPT_AUTH_PASSWORD - I: line passwords need to be crypted with + * mkpasswd to be valid + * Credits: Hwy/larne + */ +#undef CRYPT_AUTH_PASSWORD + +/* + * GECOS_CLICONNECT - show the gecos when a user connects in the +c notice + * + * NOTE: This MAY break oper scripts that parse the +c notice! + * Credits: Hwy, backported from -7 + */ +#define GECOS_CLICONNECT + +/* ANTI_IP_SPOOF - protects against TCP sequence guessing attacks + * Define this if you want the server to send a random ping at USER or NICK + * to defeat IP sequence spoofers. Note, this will stop _some_ very few + * clients from using the server. MIRC/IRCII clients are fine with this though + * + * IP sequence spoofing is obsolete...but for the time being...you can + * use this same code to defeat certain dumb drones and certain types of + * dumb bots. + * + * Credits: JailBird, taken from FEFr5 with some fixes by Hwy + */ +#undef ANTI_IP_SPOOF + +/* REMOTE_WHOIS_NOTICE - Spy on users, even if they are remote */ +#undef REMOTE_WHOIS_NOTICE + +/* POST_REGISTER - Reject a client that issues the POST, GET, or PUT + * commands during registration. This is often done by HTTP proxies. + * Credits: Hwy, backported from -7 + */ +#define POST_REGISTER + +/* CHECK_CLONE - Clonebot Protection. This feature blocks connections if more + * than CHECK_CLONE_LIMIT clients connect from the same host to ANY server on + * the network within CHECK_CLONE_PERIOD seconds. The feature is enabled + * CHECK_CLONE_DELAY seconds after the server is started. + * + * CHECK_CLONE_LIMIT and CHECK_CLONE_PERIOD are the defaults. They can be + * changed with /quote SET. CHECK_CLONE_DELAY is only used upon server + * boot, so it's not a SET'table option. + * + * Credits: SeKs, ripped from FEFr5 + */ +#define CHECK_CLONE +#define CHECK_CLONE_LIMIT 5 /* recommended value 2 */ +#define CHECK_CLONE_PERIOD 30 /* recommended value 20 */ +#define CHECK_CLONE_DELAY 90 /* 90 secs should be ok */ + +/* PART_MESSAGES - PART can include a comment, IRCnet and Dalnet style + * The message will get ignored by servers that do not understand... + * H6+tXi, H6+ins, H7, H6.3+fr all support this. + * Credits: toot + */ +#define PART_MESSAGES + +/* SILENCE_ON_BAN - Banned users cannot speak in a channel, IRCnet style + * Credits: toot + */ +#define SILENCE_ON_BAN + +/* TOPIC_UH - IRCnet style nick!user@host topic info. + * Credits: toot, modified by Hwy + */ +#define TOPIC_UH + +/* FLAGS_COMMAND - Enable the csircd like FLAGS command + * Credits: Hwy (backported from H7 contrib/m_flags.c) + */ +#define FLAGS_COMMAND + +/* FLAGS_ANNOUNCE - Announce the client's current and missing flags + * when they register, csircd like + */ +#define FLAGS_ANNOUNCE + +/* CLIENT_EXIT - Mark local client /quit's with "Quit: " + * Credits: larne (stolen from +ins) + */ +#define CLIENT_EXIT + +/* STATS_IGNORED_NOTICE - Send a 419 numeric to a user who has a STATS + * request ignored + * Credits: Idea by someone from the EFnet.org forum, code by Hwy + */ +#define STATS_IGNORED_NOTICE + +/* WHOIS_TRYAGAIN - When a remote WHOIS request is ignored, send a "Load + * too high" numeric to let them know it was ignored. Stock Hybrid will + * not send this notice, just silently ignore it. Sending a notice CAN + * increase sendQ. + */ +#define WHOIS_TRYAGAIN + +/* NEG_PORT - Allow a negative port number to be used in a C: line to + * specify a port number, but disable autoconnect on that C: line + * Idea from jv's +hemp patch for IRCnet + * + * Enabling this option will also hide the "autoconnect is disabled" warnings + * that will normally be sent every connection frequency minutes + */ +#define NEG_PORT + +/* DEFAULT_MAXTKTIME - Use this to set the default maximum TKLINE time + * in minutes. This option can be changed at runtime using /quote SET + * MAXTKTIME minutes + */ +#define DEFAULT_MAXTKTIME (60*24) + +/* DEOPER_NOTICE - Use this to see when opers remove their operator status + * or quit. - Spying... Hwy + */ +#undef DEOPER_NOTICE + +/* JUPE_BYPASS - Use this to allow opers to join and speak in juped (+j) + * channels, useful for under attack channels, drone channels, and oper + * channels + */ +#define JUPE_BYPASS + +/* TKLINE_EXPIRE_NOTICE - Use this to enable or disable the stock Hybrid + * temporary kline expiration notice + */ +#define TKLINE_EXPIRE_NOTICE + +/* TDLINE_EXPIRE_NOTICE - Use this to enable or disable fl_'s temporary + * dline expiration notice + */ +#define TDLINE_EXPIRE_NOTICE + +/* PROPAGATE_AWAY - Propogate AWAY messages to (and from) other servers. + * This allows users to see you marked as AWAY on distant servers, without + * resorting to using remote WHOIS. This is standard in Hybrid 7 and will + * be standard in the next csircd version, so it should be available to + * Hybrid 6 users as well. + */ +#define PROPAGATE_AWAY + +/* BURST_AWAY - If AWAY messages are propagated, then burst them to a + * connecting server as well. Hybrid 7 does NOT do this. + * + * NOTE: This will increase your burst size. + */ +#define BURST_AWAY + +/* REVERT_USERHOST - Revert USERHOST to the original behavior, making + * USERHOST on yourself return the hostname (even if it is spoofed) rather + * than your real IP. This will break mIRC's SERVER method of finding your + * IP when a user runs behind a NAT, but will fix the possible problems + * with client's userlists (adding protection for yourself) + */ +#define REVERT_USERHOST + +/* WALLCHOPS - A compatability shim for undernet users, /wallchops does + * the same thing as Hybrid's notice @#channel. This is useful for scripts + * only + */ +#undef WALLCHOPS + +/* LOCAL_HACKOPS - Allow opers to hack ops in LOCAL channels (Only LOCAL + * channels, &channels). This setting only affects the local server and + * does NOT allow global (#channels) to be hacked. + * + * This is done via /mode + * + */ +#undef LOCAL_HACKOPS + +/* OLD_KNOCK - KNOCK was changed since 6.3.1 release to have +p disable + * KNOCK'ing into the channel. The old behaviour was to have +s disable + * KNOCK. This setting reverts it to +p to be consistant with previous + * servers. + */ +#undef OLD_KNOCK + +/* SHOW_JUPE_MODE - Show the +j when a user or operator issues MODE #channel + * Idea from dilli + * + */ +#undef SHOW_JUPE_MODE + +/* End of +fr */ + /* HIDE_OPS * Define this to prevent non chanops from seeing what ops a channel has * NOT ADEQUATELY TESTED YET, DON'T USE ON PRODUCTION NETWORK --Rodder @@ -191,13 +409,7 @@ */ #define TS5_ONLY -/* SLAVE_SERVERS - Use this to send LOCOPS and KLINES to servers you define - * uses U: lines in ircd.conf, each server defined in an U: line - * is sent a copy of the locally placed K-line, and will also - * accept K-lines from those servers. - * This is useful for sites with more than one client server. - */ -#undef SLAVE_SERVERS +/* SLAVE_SERVERS was removed */ /* FNAME_USERLOG and FNAME_OPERLOG - logs of local USERS and OPERS * Define this filename to maintain a list of persons who log @@ -230,14 +442,7 @@ */ #define WARN_NO_NLINE -/* CUSTOM_ERR - colorful notice/error/messages - * Defining this will use custom notice/error/messages from - * src/messages.tab instead of stock ones in src/messages_cust.tab - * If you prefer the "colorful" messages that Hybrid was known for, - * or if you wish to customize the messages, define this. - * Otherwise leave it undef'd for plain ole boring messages. - */ -#undef CUSTOM_ERR +/* CUSTOM_ERR has been removed. */ /* FAILED_OPER_NOTICE - send a notice to all opers when someone * tries to /oper and uses an incorrect password. @@ -336,6 +541,13 @@ #undef O_LINES_OPER_ONLY #define P_LINES_OPER_ONLY #undef U_LINES_OPER_ONLY +#undef C_LINES_OPER_ONLY + +/* STATS_QMARK_OPER_ONLY - Block /stats ? from non opers. This is not + * recommended, as it makes it harder for opers to check on a link when + * they cannot connect to their oper server. + */ +#undef STATS_QMARK_OPER_ONLY /* SPOOF_NOTICE - See a notice when a user connects with a * spoofed I: line @@ -369,7 +581,7 @@ #undef WHOIS_NOTICE /* WHOIS_WAIT - minimum seconds between remote use of WHOIS before - * max use count is reset + * max use count is reset. 0 will disable */ #define WHOIS_WAIT 1 @@ -439,8 +651,9 @@ * OPER_UMODES LOCOP_UMODES - set these to be the initial umodes when OPER'ing * These can be over-ridden in ircd.conf file, with flags in last O field */ -#define OPER_UMODES (FLAGS_OPER|FLAGS_WALLOP|FLAGS_SERVNOTICE|FLAGS_OPERWALL) -#define LOCOP_UMODES (FLAGS_LOCOP|FLAGS_WALLOP|FLAGS_SERVNOTICE) +#define OPER_UMODES (FLAGS_OPER|FLAGS_WALLOP|FLAGS_SERVNOTICE|FLAGS_OPERWALL|\ + FLAGS_LOCOPS) +#define LOCOP_UMODES (FLAGS_LOCOP|FLAGS_WALLOP|FLAGS_SERVNOTICE|FLAGS_LOCOPS) /* MAXIMUM LINKS - max links for class 0 if no Y: line configured * diff -uNrd ircd-hybrid-6.3.1.dist/include/config.h.dist ircd-hybrid-6.3.1/include/config.h.dist --- ircd-hybrid-6.3.1.dist/include/config.h.dist Sun Feb 17 00:58:09 2002 +++ ircd-hybrid-6.3.1/include/config.h.dist Fri May 2 11:33:47 2003 @@ -111,6 +111,224 @@ #define HPATH "opers.txt" #define OPATH "opers.motd" +/* +fr patches - Hwy + * Each is optional... + */ + +/* SAVE_MAXCLIENT - store the max local and global client connections + * into the file specified by MXPATH at the interval specified by + * SAVE_TIME + * Credits: Hwy, idea from bahamut + */ +#define SAVE_MAXCLIENT +#ifdef SAVE_MAXCLIENT +# define MXPATH "ircd.max" +# define SAVE_TIME 3600 +#endif + +/* + * XLINE_COMMAND - Enable a command to dynamically add an X: line + * Credits: Hwy + */ +#undef XLINE_COMMAND + +/* Don't touch these */ +#define XLINE_WARN 0 +#define XLINE_REJECT 1 +#define XLINE_SILENT 2 + +/* Set the default type of XLINE to be created, can be changed with + * /quote SET XLINETYPE [WARN|REJECT|SILENT]. + */ +#define DEFAULT_XLINETYPE XLINE_WARN + +/* + * CRYPT_AUTH_PASSWORD - I: line passwords need to be crypted with + * mkpasswd to be valid + * Credits: Hwy/larne + */ +#undef CRYPT_AUTH_PASSWORD + +/* + * GECOS_CLICONNECT - show the gecos when a user connects in the +c notice + * + * NOTE: This MAY break oper scripts that parse the +c notice! + * Credits: Hwy, backported from -7 + */ +#define GECOS_CLICONNECT + +/* ANTI_IP_SPOOF - protects against TCP sequence guessing attacks + * Define this if you want the server to send a random ping at USER or NICK + * to defeat IP sequence spoofers. Note, this will stop _some_ very few + * clients from using the server. MIRC/IRCII clients are fine with this though + * + * IP sequence spoofing is obsolete...but for the time being...you can + * use this same code to defeat certain dumb drones and certain types of + * dumb bots. + * + * Credits: JailBird, taken from FEFr5 with some fixes by Hwy + */ +#undef ANTI_IP_SPOOF + +/* REMOTE_WHOIS_NOTICE - Spy on users, even if they are remote */ +#undef REMOTE_WHOIS_NOTICE + +/* POST_REGISTER - Reject a client that issues the POST, GET, or PUT + * commands during registration. This is often done by HTTP proxies. + * Credits: Hwy, backported from -7 + */ +#define POST_REGISTER + +/* CHECK_CLONE - Clonebot Protection. This feature blocks connections if more + * than CHECK_CLONE_LIMIT clients connect from the same host to ANY server on + * the network within CHECK_CLONE_PERIOD seconds. The feature is enabled + * CHECK_CLONE_DELAY seconds after the server is started. + * + * CHECK_CLONE_LIMIT and CHECK_CLONE_PERIOD are the defaults. They can be + * changed with /quote SET. CHECK_CLONE_DELAY is only used upon server + * boot, so it's not a SET'table option. + * + * Credits: SeKs, ripped from FEFr5 + */ +#define CHECK_CLONE +#define CHECK_CLONE_LIMIT 5 /* recommended value 2 */ +#define CHECK_CLONE_PERIOD 30 /* recommended value 20 */ +#define CHECK_CLONE_DELAY 90 /* 90 secs should be ok */ + +/* PART_MESSAGES - PART can include a comment, IRCnet and Dalnet style + * The message will get ignored by servers that do not understand... + * H6+tXi, H6+ins, H7, H6.3+fr all support this. + * Credits: toot + */ +#define PART_MESSAGES + +/* SILENCE_ON_BAN - Banned users cannot speak in a channel, IRCnet style + * Credits: toot + */ +#define SILENCE_ON_BAN + +/* TOPIC_UH - IRCnet style nick!user@host topic info. + * Credits: toot, modified by Hwy + */ +#define TOPIC_UH + +/* FLAGS_COMMAND - Enable the csircd like FLAGS command + * Credits: Hwy (backported from H7 contrib/m_flags.c) + */ +#define FLAGS_COMMAND + +/* FLAGS_ANNOUNCE - Announce the client's current and missing flags + * when they register, csircd like + */ +#define FLAGS_ANNOUNCE + +/* CLIENT_EXIT - Mark local client /quit's with "Quit: " + * Credits: larne (stolen from +ins) + */ +#define CLIENT_EXIT + +/* STATS_IGNORED_NOTICE - Send a 419 numeric to a user who has a STATS + * request ignored + * Credits: Idea by someone from the EFnet.org forum, code by Hwy + */ +#define STATS_IGNORED_NOTICE + +/* WHOIS_TRYAGAIN - When a remote WHOIS request is ignored, send a "Load + * too high" numeric to let them know it was ignored. Stock Hybrid will + * not send this notice, just silently ignore it. Sending a notice CAN + * increase sendQ. + */ +#define WHOIS_TRYAGAIN + +/* NEG_PORT - Allow a negative port number to be used in a C: line to + * specify a port number, but disable autoconnect on that C: line + * Idea from jv's +hemp patch for IRCnet + * + * Enabling this option will also hide the "autoconnect is disabled" warnings + * that will normally be sent every connection frequency minutes + */ +#define NEG_PORT + +/* DEFAULT_MAXTKTIME - Use this to set the default maximum TKLINE time + * in minutes. This option can be changed at runtime using /quote SET + * MAXTKTIME minutes + */ +#define DEFAULT_MAXTKTIME (60*24) + +/* DEOPER_NOTICE - Use this to see when opers remove their operator status + * or quit. - Spying... Hwy + */ +#undef DEOPER_NOTICE + +/* JUPE_BYPASS - Use this to allow opers to join and speak in juped (+j) + * channels, useful for under attack channels, drone channels, and oper + * channels + */ +#define JUPE_BYPASS + +/* TKLINE_EXPIRE_NOTICE - Use this to enable or disable the stock Hybrid + * temporary kline expiration notice + */ +#define TKLINE_EXPIRE_NOTICE + +/* TDLINE_EXPIRE_NOTICE - Use this to enable or disable fl_'s temporary + * dline expiration notice + */ +#define TDLINE_EXPIRE_NOTICE + +/* PROPAGATE_AWAY - Propogate AWAY messages to (and from) other servers. + * This allows users to see you marked as AWAY on distant servers, without + * resorting to using remote WHOIS. This is standard in Hybrid 7 and will + * be standard in the next csircd version, so it should be available to + * Hybrid 6 users as well. + */ +#define PROPAGATE_AWAY + +/* BURST_AWAY - If AWAY messages are propagated, then burst them to a + * connecting server as well. Hybrid 7 does NOT do this. + * + * NOTE: This will increase your burst size. + */ +#define BURST_AWAY + +/* REVERT_USERHOST - Revert USERHOST to the original behavior, making + * USERHOST on yourself return the hostname (even if it is spoofed) rather + * than your real IP. This will break mIRC's SERVER method of finding your + * IP when a user runs behind a NAT, but will fix the possible problems + * with client's userlists (adding protection for yourself) + */ +#define REVERT_USERHOST + +/* WALLCHOPS - A compatability shim for undernet users, /wallchops does + * the same thing as Hybrid's notice @#channel. This is useful for scripts + * only + */ +#undef WALLCHOPS + +/* LOCAL_HACKOPS - Allow opers to hack ops in LOCAL channels (Only LOCAL + * channels, &channels). This setting only affects the local server and + * does NOT allow global (#channels) to be hacked. + * + * This is done via /mode + * + */ +#undef LOCAL_HACKOPS + +/* OLD_KNOCK - KNOCK was changed since 6.3.1 release to have +p disable + * KNOCK'ing into the channel. The old behaviour was to have +s disable + * KNOCK. This setting reverts it to +p to be consistant with previous + * servers. + */ +#undef OLD_KNOCK + +/* SHOW_JUPE_MODE - Show the +j when a user or operator issues MODE #channel + * Idea from dilli + * + */ +#undef SHOW_JUPE_MODE + +/* End of +fr */ + /* HIDE_OPS * Define this to prevent non chanops from seeing what ops a channel has * NOT ADEQUATELY TESTED YET, DON'T USE ON PRODUCTION NETWORK --Rodder @@ -191,13 +409,7 @@ */ #define TS5_ONLY -/* SLAVE_SERVERS - Use this to send LOCOPS and KLINES to servers you define - * uses U: lines in ircd.conf, each server defined in an U: line - * is sent a copy of the locally placed K-line, and will also - * accept K-lines from those servers. - * This is useful for sites with more than one client server. - */ -#undef SLAVE_SERVERS +/* SLAVE_SERVERS was removed */ /* FNAME_USERLOG and FNAME_OPERLOG - logs of local USERS and OPERS * Define this filename to maintain a list of persons who log @@ -230,14 +442,7 @@ */ #define WARN_NO_NLINE -/* CUSTOM_ERR - colorful notice/error/messages - * Defining this will use custom notice/error/messages from - * src/messages.tab instead of stock ones in src/messages_cust.tab - * If you prefer the "colorful" messages that Hybrid was known for, - * or if you wish to customize the messages, define this. - * Otherwise leave it undef'd for plain ole boring messages. - */ -#undef CUSTOM_ERR +/* CUSTOM_ERR has been removed. */ /* FAILED_OPER_NOTICE - send a notice to all opers when someone * tries to /oper and uses an incorrect password. @@ -336,6 +541,13 @@ #undef O_LINES_OPER_ONLY #define P_LINES_OPER_ONLY #undef U_LINES_OPER_ONLY +#undef C_LINES_OPER_ONLY + +/* STATS_QMARK_OPER_ONLY - Block /stats ? from non opers. This is not + * recommended, as it makes it harder for opers to check on a link when + * they cannot connect to their oper server. + */ +#undef STATS_QMARK_OPER_ONLY /* SPOOF_NOTICE - See a notice when a user connects with a * spoofed I: line @@ -369,7 +581,7 @@ #undef WHOIS_NOTICE /* WHOIS_WAIT - minimum seconds between remote use of WHOIS before - * max use count is reset + * max use count is reset. 0 will disable */ #define WHOIS_WAIT 1 @@ -439,8 +651,9 @@ * OPER_UMODES LOCOP_UMODES - set these to be the initial umodes when OPER'ing * These can be over-ridden in ircd.conf file, with flags in last O field */ -#define OPER_UMODES (FLAGS_OPER|FLAGS_WALLOP|FLAGS_SERVNOTICE|FLAGS_OPERWALL) -#define LOCOP_UMODES (FLAGS_LOCOP|FLAGS_WALLOP|FLAGS_SERVNOTICE) +#define OPER_UMODES (FLAGS_OPER|FLAGS_WALLOP|FLAGS_SERVNOTICE|FLAGS_OPERWALL|\ + FLAGS_LOCOPS) +#define LOCOP_UMODES (FLAGS_LOCOP|FLAGS_WALLOP|FLAGS_SERVNOTICE|FLAGS_LOCOPS) /* MAXIMUM LINKS - max links for class 0 if no Y: line configured * diff -uNrd ircd-hybrid-6.3.1.dist/include/ircd.h ircd-hybrid-6.3.1/include/ircd.h --- ircd-hybrid-6.3.1.dist/include/ircd.h Thu Dec 13 18:16:34 2001 +++ ircd-hybrid-6.3.1/include/ircd.h Sat Apr 19 21:06:44 2003 @@ -41,6 +41,8 @@ int noisy_htm; /* noisy htm or not ? */ int lifesux; + int maxtktime; /* maximum TKLINE time */ + #ifdef IDLE_CHECK int idletime; #endif @@ -66,6 +68,15 @@ int spam_num; int spam_time; #endif + +#ifdef CHECK_CLONE + int clone_num; + int clone_period; +#endif + +#ifdef XLINE_COMMAND + int xlinetype; +#endif }; struct Counter { @@ -108,6 +119,7 @@ #define SPLITNUM GlobalSetOptions.split_smallnet_size #define SPLITUSERS GlobalSetOptions.split_smallnet_users +#define MAXTKTIME GlobalSetOptions.maxtktime extern char* debugmode; extern int debuglevel; @@ -123,6 +135,7 @@ extern int cold_start; extern int dline_in_progress; extern int dorehash; +extern int doremotd; extern int rehashed; extern float currlife; extern struct Client me; @@ -151,4 +164,9 @@ * complain */ #define MAX_SETBACK_TIME 1800 + +#ifdef SAVE_MAXCLIENT +extern void write_stats(void); +#endif + #endif diff -uNrd ircd-hybrid-6.3.1.dist/include/m_commands.h ircd-hybrid-6.3.1/include/m_commands.h --- ircd-hybrid-6.3.1.dist/include/m_commands.h Thu Nov 29 01:28:23 2001 +++ ircd-hybrid-6.3.1/include/m_commands.h Mon Apr 21 20:44:43 2003 @@ -34,6 +34,9 @@ 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 **); +#ifdef XLINE_COMMAND +extern int m_xline(struct Client *,struct Client *,int,char **); +#endif extern int m_gline(struct Client *,struct Client *,int,char **); extern int m_ungline(struct Client *,struct Client *,int,char **); @@ -99,4 +102,21 @@ extern int m_dns(struct Client *,struct Client *,int,char **); extern int m_htm(struct Client *,struct Client *,int,char **); extern int m_set(struct Client *,struct Client *,int,char **); + +#ifdef POST_REGISTER +extern int m_webproxy(struct Client *,struct Client *,int,char **); +#endif + +#ifdef FLAGS_COMMAND +extern int m_flags(struct Client *, struct Client *, int, char **); +#endif + +extern int m_map(struct Client *,struct Client *,int,char **); +extern int m_etrace(struct Client *,struct Client *,int,char **); +extern int m_encap(struct Client *,struct Client *,int,char **); + +#ifdef WALLCHOPS +extern int m_wallchops(struct Client *,struct Client *,int,char **); +#endif + #endif /* INCLUDED_m_commands_h */ diff -uNrd ircd-hybrid-6.3.1.dist/include/m_flags.h ircd-hybrid-6.3.1/include/m_flags.h --- ircd-hybrid-6.3.1.dist/include/m_flags.h Wed Dec 31 19:00:00 1969 +++ ircd-hybrid-6.3.1/include/m_flags.h Sat Apr 26 19:36:56 2003 @@ -0,0 +1,43 @@ +/* + * m_flags.h: Implements comstud-style mode flags. + * + * Copyright 2002 by W. Campbell and the ircd-hybrid development team + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1.Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2.Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3.The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $Id: m_flags.c,v 1.12 2002/11/21 20:16:30 leeh Exp $ + */ + +#include "config.h" + +#ifndef FLAGS_H +#define FLAGS_H + +#ifdef FLAGS_COMMAND +char *set_flags_to_string(struct Client *client_p); +char *unset_flags_to_string(struct Client *client_p); +#endif + +#endif diff -uNrd ircd-hybrid-6.3.1.dist/include/m_info.h ircd-hybrid-6.3.1/include/m_info.h --- ircd-hybrid-6.3.1.dist/include/m_info.h Fri Dec 7 00:09:27 2001 +++ ircd-hybrid-6.3.1/include/m_info.h Mon Apr 21 16:03:35 2003 @@ -137,12 +137,6 @@ { "CRYPT_LINK_PASSWORD", "OFF", 0, "Encrypt Server Passwords" }, #endif /* CRYPT_LINK_PASSWORD */ -#ifdef CUSTOM_ERR - { "CUSTOM_ERR", "ON", 0, "Customized error messages" }, -#else - { "CUSTOM_ERR", "OFF", 0, "Customized error messages" }, -#endif /* CUSTOM_ERR */ - #ifdef DEBUGMODE { "DEBUGMODE", "ON", 0, "Debugging Mode" }, #else @@ -270,6 +264,12 @@ { "HIDE_SERVERS_IPS", "OFF", 0, "Hide server's IP's from all users" }, #endif /* HIDE_SERVERS_IPS */ +#ifdef HIDE_SPOOF_IPS + { "HIDE_SPOOF_IPS", "ON", 0, "Hide spoofed IP's from all users" }, +#else + { "HIDE_SPOOF_IPS", "OFF", 0, "Hide spoofed IP's from all users" }, +#endif /* HIDE_SPOOF_IPS */ + #ifdef HPATH { "HPATH", HPATH, 0, "Path to Operator Help File" }, #else @@ -446,6 +446,12 @@ { "NO_FAKE_GLINES", "OFF", 0, "Do not allow GLINES from users that do not exist" }, #endif /* NO_FAKE_GLINES */ +#ifdef NO_CREATE_ON_SPLIT + { "NO_CREATE_ON_SPLIT", "ON", 0, "Users Cannot Create Channels During a NetSplit" }, +#else + { "NO_CREATE_ON_SPLIT", "OFF", 0, "Users Cannot Create Channels During a NetSplit" }, +#endif + #ifdef NO_JOIN_ON_SPLIT { "NO_JOIN_ON_SPLIT", "ON", 0, "Users Cannot Join Channels During a NetSplit" }, #else @@ -583,12 +589,6 @@ { "SHOW_INVISIBLE_LUSERS", "OFF", 0, "Show Invisible Clients in LUSERS" }, #endif /* SHOW_INVISIBLE_LUSERS */ -#ifdef SLAVE_SERVERS - { "SLAVE_SERVERS", "ON", 0, "Send LOCOPS and K-lines to U: lined Servers" }, -#else - { "SLAVE_SERVERS", "OFF", 0, "Send LOCOPS and K-lines to U: lined Servers" }, -#endif /* SLAVE_SERVERS */ - #ifdef SPATH { "SPATH", SPATH, 0, "Path to Server Executable" }, #else @@ -717,6 +717,198 @@ #else { "ZIP_LINKS", "OFF", 0, "Compress Server to Server Links" }, #endif /* ZIP_LINKS */ + +/* +fr extensions */ + +#ifdef SAVE_MAXCLIENT + { "SAVE_MAXCLIENT", "ON", 0, "Save LUSERS Statistics in a Persistant File" }, + { "MXPATH", MXPATH, 0, "LUSERS Savestate File" }, + { "SAVE_TIME", "", SAVE_TIME, "Time Interval Between Syncs" }, +#else + { "SAVE_MAXCLIENT", "OFF", 0, "Save LUSERS Statistics in a Persistant File" }, +#endif + +#ifdef XLINE_COMMAND + { "XLINE_COMMAND", "ON", 0, "Operator XLINE Command" }, +#else + { "XLINE_COMMAND", "OFF", 0, "Operator XLINE Command" }, +#endif + +#ifdef CRYPT_AUTH_PASSWORD + { "CRYPT_AUTH_PASSWORD", "ON", 0, "Encrypted I: Line Passwords" }, +#else + { "CRYPT_AUTH_PASSWORD", "OFF", 0, "Encrypted I: Line Passwords" }, +#endif + +#ifdef GECOS_CLICONNECT + { "GECOS_CLICONNECT", "ON", 0, "Show Gecos on Client Connect Notices" }, +#else + { "GECOS_CLICONNECT", "OFF", 0, "Show Gecos on Client Connect Notices" }, +#endif + +#ifdef ANTI_IP_SPOOF + { "ANTI_IP_SPOOF", "ON", 0, "Force a client to answer a PONG to register" }, +#else + { "ANTI_IP_SPOOF", "OFF", 0, "Force a client to answer a PONG to register" }, +#endif + +#ifdef REMOTE_WHOIS_NOTICE + { "REMOTE_WHOIS_NOTICE", "ON", 0, "Spy on remote users doing a WHOIS on opers" }, +#else + { "REMOTE_WHOIS_NOTICE", "OFF", 0, "Spy on remote users doing a WHOIS on opers" }, +#endif + +#ifdef POST_REGISTER + { "POST_REGISTER", "ON", 0, "Enable the POST/GET/PUT commands during registration" }, +#else + { "POST_REGISTER", "OFF", 0, "Enable the POST/GET/PUT commands during registration" }, +#endif + +#ifdef CHECK_CLONE + { "CHECK_CLONE", "ON", 0, "Network-Wide Clonebot Checking" }, +#else + { "CHECK_CLONE", "OFF", 0, "Network-Wide Clonebot Checking" }, +#endif + +#ifdef CHECK_CLONE_LIMIT + { "CHECK_CLONE_LIMIT", "", CHECK_CLONE_LIMIT, "Default Maximum Allowed Number of Clones" }, +#else + { "CHECK_CLONE_LIMIT", "NONE", 0, "Default Maximum Allowed Number of Clons" }, +#endif + +#ifdef CHECK_CLONE_PERIOD + { "CHECK_CLONE_PERIOD", "", CHECK_CLONE_PERIOD, "Default Clone Check Period" }, +#else + { "CHECK_CLONE_PERIOD", "NONE", 0, "Default Clone Check Period" }, +#endif + +#ifdef CHECK_CLONE_DELAY + { "CHECK_CLONE_DELAY", "", CHECK_CLONE_DELAY, "Clone Check Delay" }, +#else + { "CHECK_CLONE_DELAY", "NONE", 0, "Clone Check Delay" }, +#endif + +#ifdef PART_MESSAGES + { "PART_MESSAGES", "ON", 0, "Allow PART comments" }, +#else + { "PART_MESSAGES", "OFF", 0, "Allow PART comments" }, +#endif + +#ifdef SILENCE_ON_BAN + { "SILENCE_ON_BAN", "ON", 0, "Banned users cannot speak" }, +#else + { "SILENCE_ON_BAN", "OFF", 0, "Banned users cannot speak" }, +#endif + +#ifdef TOPIC_UH + { "TOPIC_UH", "ON", 0, "Show nick!user@host in topic info" }, +#else + { "TOPIC_UH", "OFF", 0, "Show nick!user@host in topic info" }, +#endif + + { "ADMIN_MODE", "ON", 0, "Administrator mode" }, + +#ifdef FLAGS_COMMAND + { "FLAGS_COMMAND", "ON", 0, "csircd like FLAGS command" }, +#else + { "FLAGS_COMMAND", "OFF", 0, "csircd like FLAGS command" }, +#endif + +#ifdef FLAGS_ANNOUNCE + { "FLAGS_ANNOUNCE", "ON", 0, "Notify the user what FLAGS they have on connect" }, +#else + { "FLAGS_ANNOUNCE", "OFF", 0, "Notify the user what FLAGS they have on connect" }, +#endif + +#ifdef CLIENT_EXIT + { "CLIENT_EXIT", "ON", 0, "Mark local client /quit's with Client Exited" }, +#else + { "CLIENT_EXIT", "OFF", 0, "Mark local client /quit's with Client Exited" }, +#endif + +#ifdef STATS_IGNORED_NOTICE + { "STATS_IGNORED_NOTICE", "ON", 0, "Send a notice to users when a STATS is ignored" }, +#else + { "STATS_IGNORED_NOTICE", "OFF", 0, "Send a notice to users when a STATS is ignored" }, +#endif + +#ifdef WHOIS_TRYAGAIN + { "WHOIS_TRYAGAIN", "ON", 0, "Send a 'Load too high' numeric to users with ignored remote WHOIS" }, +#else + { "WHOIS_TRYAGAIN", "OFF", 0, "Send a 'Load too high' numeric to users with ignored remote WHOIS" }, +#endif + +#ifdef NEG_PORT + { "NEG_PORT", "ON", 0, "A negative port in a C: line disables autoconnect" }, +#else + { "NEG_PORT", "OFF", 0, "A negative port in a C: line disables autoconnect" }, +#endif + +#ifdef DEOPER_NOTICE + { "DEOPER_NOTICE", "ON", 0, "Show a notice when opers leave operator status" }, +#else + { "DEOPER_NOTICE", "OFF", 0, "Show a notice when opers leave operator status" }, +#endif + +#ifdef JUPE_BYPASS + { "JUPE_BYPASS", "ON", 0, "Opers can join and speak in juped channels" }, +#else + { "JUPE_BYPASS", "OFF", 0, "Opers can join and speak in juped channels" }, +#endif + +#ifdef TKLINE_EXPIRE_NOTICE + { "TKLINE_EXPIRE_NOTICE", "ON", 0, "Display a notice when a tkline expires" }, +#else + { "TKLINE_EXPIRE_NOTICE", "OFF", 0, "Display a notice when a tkline expires" }, +#endif + +#ifdef TDLINE_EXPIRE_NOTICE + { "TDLINE_EXPIRE_NOTICE", "ON", 0, "Display a notice when a tdline expires" }, +#else + { "TDLINE_EXPIRE_NOTICE", "OFF", 0, "Display a notice when a tdline expires" }, +#endif + +#ifdef PROPAGATE_AWAY + { "PROPAGATE_AWAY", "ON", 0, "Propagate AWAY messages to other servers" }, +#else + { "PROPAGATE_AWAY", "OFF", 0, "Propagate AWAY messages to other servers" }, +#endif + +#ifdef BURST_AWAY + { "BURST_AWAY", "ON", 0, "Send AWAY messages on burst" }, +#else + { "BURST_AWAY", "OFF", 0, "Send AWAY messages on burst" }, +#endif + +#ifdef REVERT_USERHOST + { "REVERT_USERHOST", "ON", 0, "Revert USERHOST to the original behaviour" }, +#else + { "REVERT_USERHOST", "OFF", 0, "Revert USERHOST to the original behaviour" }, +#endif + +#ifdef WALLCHOPS + { "WALLCHOPS", "ON", 0, "Adds WALLCHOPS for ircu client compatability" }, +#else + { "WALLCHOPS", "OFF", 0, "Adds WALLCHOPS for ircu client compatability" }, +#endif + +#ifdef LOCAL_HACKOPS + { "LOCAL_HACKOPS", "ON", 0, "Allow LOCAL (&channels) to be hacked by opers" }, +#else + { "LOCAL_HACKOPS", "OFF", 0, "Allow LOCAL (&channels) to be hacked by opers" }, +#endif + +#ifdef OLD_KNOCK + { "OLD_KNOCK", "ON", 0, "Revert KNOCK to previous versions functionality." }, +#else + { "OLD_KNOCK", "OFF", 0, "Revert KNOCK to previous versions functionality." }, +#endif + +#ifdef SHOW_JUPE_MODE + { "SHOW_JUPE_MODE", "ON", 0, "Show +j when a user or oper issues MODE #channel." }, +#else + { "SHOW_JUPE_MODE", "OFF", 0, "Show +j when a user or oper issues MODE #channel." }, +#endif /* * since we don't want to include the world here, NULL probably diff -uNrd ircd-hybrid-6.3.1.dist/include/m_kline.h ircd-hybrid-6.3.1/include/m_kline.h --- ircd-hybrid-6.3.1.dist/include/m_kline.h Tue Dec 4 03:26:49 2001 +++ ircd-hybrid-6.3.1/include/m_kline.h Mon Apr 21 12:04:32 2003 @@ -27,7 +27,6 @@ { struct PKDlines* next; struct Client* sptr; - struct Client* rcptr; char* user; /* username of K/D lined user */ char* host; /* hostname of K/D lined user */ char* reason; /* reason they are K/D lined */ diff -uNrd ircd-hybrid-6.3.1.dist/include/msg.h ircd-hybrid-6.3.1/include/msg.h --- ircd-hybrid-6.3.1.dist/include/msg.h Fri Dec 7 21:38:15 2001 +++ ircd-hybrid-6.3.1/include/msg.h Mon Apr 21 20:45:20 2003 @@ -116,6 +116,11 @@ #define MSG_UNKLINE "UNKLINE" /* UNKLINE */ #define MSG_DLINE "DLINE" /* DLINE */ #define MSG_UNDLINE "UNDLINE" /* UNDLINE */ +#define MSG_XLINE "XLINE" /* XLINE */ +#define MSG_POST "POST" /* POST */ +#define MSG_GET "GET" /* GET */ +#define MSG_PUT "PUT" /* PUT */ +#define MSG_FLAGS "FLAGS" /* FLAGS */ #define MSG_HTM "HTM" /* HTM */ #define MSG_SET "SET" /* SET */ @@ -128,6 +133,10 @@ #endif /* LWALLOPS */ #define MSG_KNOCK "KNOCK" /* KNOCK */ +#define MSG_MAP "MAP" /* MAP */ +#define MSG_ETRACE "ETRACE" +#define MSG_ENCAP "ENCAP" +#define MSG_WALLCHOPS "WALLCHOPS" /* WALLCHOPS */ #define MAXPARA 15 @@ -176,11 +185,24 @@ #ifdef LWALLOPS { MSG_LWALLOPS,m_locops, 0, MAXPARA, 1, 0, 0, 0L }, #endif /* LWALLOPS */ +#ifdef POST_REGISTER + { MSG_POST, m_webproxy, 0, MAXPARA, 1, 1, 0, 0L }, + { MSG_PUT, m_webproxy, 0, MAXPARA, 1, 1, 0, 0L }, + { MSG_GET, m_webproxy, 0, MAXPARA, 1, 1, 0, 0L }, +#endif /* POST_REGISTER */ +#ifdef FLAGS_COMMAND + { MSG_FLAGS, m_flags, 0, MAXPARA, 1, 0, 0, 0L }, +#endif /* FLAGS_COMMAND */ #ifdef IDLE_FROM_MSG /* Only m_private has reset idle flag set */ +#ifdef ANTI_IP_SPOOF + /* if ANTI_IP_SPOOF, allow user to PONG even when not registered */ + { MSG_PONG, m_pong, 0, MAXPARA, 1, 1, 0, 0L }, +#else { MSG_PONG, m_pong, 0, MAXPARA, 1, 0, 0, 0L }, +#endif { MSG_PING, m_ping, 0, MAXPARA, 1, 0, 0, 0L }, #else @@ -190,7 +212,12 @@ * when its 0, for IDLE_FROM_MSG ping/pong do not reset idle time */ +#ifdef ANTI_IP_SPOOF + /* if ANTI_IP_SPOOF, allow user to PONG even when not registered */ + { MSG_PONG, m_pong, 0, MAXPARA, 1, 1, 0, 0L }, +#else { MSG_PONG, m_pong, 0, MAXPARA, 1, 0, 1, 0L }, +#endif { MSG_PING, m_ping, 0, MAXPARA, 1, 0, 1, 0L }, #endif /* IDLE_FROM_MSG */ @@ -241,6 +268,9 @@ { 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 }, +#ifdef XLINE_COMMAND + { MSG_XLINE, m_xline, 0, MAXPARA, 1, 0, 0, 0L }, +#endif { 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 }, @@ -253,6 +283,12 @@ { MSG_HTM, m_htm, 0, MAXPARA, 1, 0, 0, 0L }, { MSG_SET, m_set, 0, MAXPARA, 1, 0, 0, 0L }, { MSG_TESTLINE, m_testline, 0, MAXPARA, 1, 0, 0, 0L }, + { MSG_MAP, m_map, 0, MAXPARA, 1, 0, 0, 0L }, + { MSG_ETRACE, m_etrace, 0, MAXPARA, 1, 0, 0, 0L }, + { MSG_ENCAP, m_encap, 0, MAXPARA, 1, 0, 0, 0L }, +#ifdef WALLCHOPS + { MSG_WALLCHOPS, m_wallchops, 0, MAXPARA, 1, 0, 0, 0L }, +#endif { (char *) 0, (int (*)()) 0 , 0, 0, 0, 0, 0, 0L } }; diff -uNrd ircd-hybrid-6.3.1.dist/include/numeric.h ircd-hybrid-6.3.1/include/numeric.h --- ircd-hybrid-6.3.1.dist/include/numeric.h Thu Dec 13 18:16:34 2001 +++ ircd-hybrid-6.3.1/include/numeric.h Fri May 2 17:45:33 2003 @@ -29,103 +29,6 @@ #endif /* - * -- Avalon -- 1 Sep 1992 - * - * Added RPL_TRACELOG, RPL_STATSOLINE - */ - -/* - * -- Avalon -- 13 Aug 1992 - * - * Added ERR_BADCHANNELKEY, ERR_KEYSET - */ - -/* - * -- Avalon -- 10 Aug 1992 - * - * Added RPL_SUMMONING - */ - -/* - * -- Avalon -- 5 Jul 1992 - * - * Added ERR_NICKCOLLISION - */ - -/* - * -- Avalon -- 14 Jul 1992 - * - * Added RPL_UNAWAY, RPL_NOWAWAY, ERR_NOORIGIN, ERR_FILEERROR, ERR_NOLOGIN, - * ERR_SUMMONDISABLED, ERR_USERSDISABLED, RPL_USERSSTART, RPL_USERS, - * RPL_ENDOFUSERS, RPL_NOUSERS - */ - -/* - * -- Avalon -- 12 Jul 1992 - * - * Added RPL_CLOSING RPL_CLOSEEND - */ - -/* - * -- Avalon -- 10-11 Jul 1992 - * - * Added RPL_MOTD, RPL_MOTDSTART, RPL_ENDOFMOTD, ERR_NOMOTD, - * RPL_INFO, RPL_INFOSTART, RPL_ENDOFINFO, ERR_CANTKILLSERVER, - * RPL_LUSERCLIENT, RPL_LUSEROP, RPL_LUSERUNKNOWN, RPL_LUSERCHAN, RPL_LUSERME, - * RPL_STATSUPTIME, RPL_ADMINLOC1, RPL_ADMINLOC2, RPL_ADMINME, - * RPL_ADMINEMAIL, ERR_NOADMININFO - */ - -/* - * -- Avalon -- 28 Jun 1992 - * - * Added ERR_BADCHANMASK and RPL_ENDOFWHOWAS - */ - -/* - * -- Avalon -- 13 May 1992 - * - * Added RPL_STATSLLINE - */ - -/* - * -- Avalon -- 12 Jan 1992 - * - * Added RPL_TRACELINK - */ - -/* - * -- Wumpus -- 30 Nov 1991 - * - * It's very important that you never change what a numeric means -- - * you can delete old ones (maybe) and add new ones, but never ever - * take a number and make it suddenly mean something else, or change - * an old number just for the hell of it. - */ - -/* - * -- avalon -- 19 Nov 1991 - * Added ERR_USERSDONTMATCH - * - * -- avalon -- 06 Nov 1991 - * Added RPL_BANLIST, RPL_BANLISTEND, ERR_BANNEDFROMCHAN - * - * -- avalon -- 15 Oct 1991 - * Added RPL_TRACEs (201-209) - * Added RPL_STATSs (211-219) - */ - -/* -- Jto -- 16 Jun 1990 - * A couple of new numerics added... - */ - -/* -- Jto -- 03 Jun 1990 - * Added ERR_YOUWILLBEBANNED and Check defines (sigh, had to put 'em here..) - * Added ERR_UNKNOWNMODE... - * Added ERR_CANNOTSENDTOCHAN... - */ - -/* * form_str - return a format string for a message number * messages are defined below */ @@ -141,6 +44,9 @@ #define RPL_CREATED 003 #define RPL_MYINFO 004 #define RPL_ISUPPORT 005 +#define RPL_MAP 15 +/* #define RPL_MAPMORE 16 */ /* Not currently used */ +#define RPL_MAPEND 17 /* * Numeric replies from server commands. @@ -176,16 +82,18 @@ #define RPL_STATSDLINE 225 -#define RPL_SERVLIST 234 -#define RPL_SERVLISTEND 235 +/* #define RPL_SERVLIST 234 */ +/* #define RPL_SERVLISTEND 235 */ #define RPL_STATSLLINE 241 #define RPL_STATSUPTIME 242 #define RPL_STATSOLINE 243 #define RPL_STATSHLINE 244 -#define RPL_STATSSLINE 245 +/* #define RPL_STATSSLINE 245 */ #define RPL_STATSXLINE 247 -#define RPL_STATSULINE 248 + +/* RPL_STATSULINE was 248 */ + #define RPL_STATSDEBUG 249 #define RPL_STATSCONN 250 #define RPL_LUSERCLIENT 251 @@ -198,7 +106,7 @@ #define RPL_ADMINLOC2 258 #define RPL_ADMINEMAIL 259 -#define RPL_TRACELOG 261 +/* #define RPL_TRACELOG 261 */ #define RPL_ENDOFTRACE 262 #define RPL_LOAD2HI 263 @@ -239,6 +147,8 @@ #define RPL_NOTOPIC 331 #define RPL_TOPIC 332 +#define RPL_WHOISACTUALLY 338 + #define RPL_INVITING 341 #define RPL_SUMMONING 342 @@ -252,7 +162,7 @@ #define RPL_NAMREPLY 353 #define RPL_ENDOFNAMES 366 -#define RPL_KILLDONE 361 +/* #define RPL_KILLDONE 361 */ #define RPL_CLOSING 362 #define RPL_CLOSEEND 363 #define RPL_LINKS 364 @@ -271,8 +181,8 @@ #define RPL_YOUREOPER 381 #define RPL_REHASHING 382 -#define RPL_MYPORTIS 384 -#define RPL_NOTOPERANYMORE 385 +/* #define RPL_MYPORTIS 384 */ +/* #define RPL_NOTOPERANYMORE 385 */ #define RPL_TIME 391 #define RPL_USERSSTART 392 @@ -298,10 +208,14 @@ #define ERR_NOTOPLEVEL 413 #define ERR_WILDTOPLEVEL 414 +#ifdef STATS_IGNORED_NOTICE +#define ERR_STATSIGNORED 419 +#endif + #define ERR_UNKNOWNCOMMAND 421 #define ERR_NOMOTD 422 #define ERR_NOADMININFO 423 -#define ERR_FILEERROR 424 +/* #define ERR_FILEERROR 424 */ #define ERR_NONICKNAMEGIVEN 431 #define ERR_ERRONEUSNICKNAME 432 @@ -314,8 +228,8 @@ #define ERR_NOTONCHANNEL 442 #define ERR_USERONCHANNEL 443 #define ERR_NOLOGIN 444 -#define ERR_SUMMONDISABLED 445 -#define ERR_USERSDISABLED 446 +/* #define ERR_SUMMONDISABLED 445 */ +/* #define ERR_USERSDISABLED 446 */ #define ERR_NOTREGISTERED 451 @@ -324,8 +238,8 @@ #define ERR_NOPERMFORHOST 463 #define ERR_PASSWDMISMATCH 464 #define ERR_YOUREBANNEDCREEP 465 -#define ERR_YOUWILLBEBANNED 466 -#define ERR_KEYSET 467 +/* #define ERR_YOUWILLBEBANNED 466 */ +/* #define ERR_KEYSET 467 */ #define ERR_CHANNELISFULL 471 #define ERR_UNKNOWNMODE 472 @@ -333,14 +247,15 @@ #define ERR_BANNEDFROMCHAN 474 #define ERR_BADCHANNELKEY 475 #define ERR_BADCHANMASK 476 -#define ERR_MODELESS 477 /* ircu numeric -db */ +/* #define ERR_MODELESS 477 */ /* ircu numeric -db */ #define ERR_BANLISTFULL 478 /* I stole the numeric from ircu -db */ #define ERR_BADCHANNAME 479 #define ERR_NOPRIVILEGES 481 #define ERR_CHANOPRIVSNEEDED 482 #define ERR_CANTKILLSERVER 483 -#define ERR_DESYNC 484 +#define ERR_RESTRICTED 484 /* Stolen from IRCnet -Hwy */ +#define ERR_DESYNC 484 /* Not anymore... */ #define ERR_NOOPERHOST 491 @@ -348,6 +263,18 @@ #define ERR_USERSDONTMATCH 502 #define ERR_GHOSTEDCLIENT 503 -#define ERR_LAST_ERR_MSG 504 + +#define RPL_ETRACE 709 + +#define RPL_KNOCK 710 +#define RPL_KNOCKDLVR 711 + +#define ERR_TOOMANYKNOCK 712 +#define ERR_CHANOPEN 713 +#define ERR_KNOCKONCHAN 714 +#define ERR_KNOCKDISABLED 715 + + +#define ERR_LAST_ERR_MSG 999 #endif /* INCLUDED_numeric_h */ diff -uNrd ircd-hybrid-6.3.1.dist/include/patchlevel.h ircd-hybrid-6.3.1/include/patchlevel.h --- ircd-hybrid-6.3.1.dist/include/patchlevel.h Wed Apr 17 22:54:49 2002 +++ ircd-hybrid-6.3.1/include/patchlevel.h Thu May 8 12:44:31 2003 @@ -19,5 +19,5 @@ */ #ifndef PATCHLEVEL -#define PATCHLEVEL "2.8/hybrid-6.3.1" +#define PATCHLEVEL "2.8/hybrid-6.3.1+fr25pre-fixed" #endif diff -uNrd ircd-hybrid-6.3.1.dist/include/res.h ircd-hybrid-6.3.1/include/res.h --- ircd-hybrid-6.3.1.dist/include/res.h Mon Dec 3 23:47:44 2001 +++ ircd-hybrid-6.3.1/include/res.h Sat Apr 19 21:15:38 2003 @@ -29,8 +29,8 @@ void dns_readable (int fd , void *ptr ); void dns_do_callbacks(void); void dns_select (void); -void adns_gethost (const char *name, struct DNSQuery *req ); -void adns_getaddr (struct in_addr *addr , struct DNSQuery *req ); +int adns_gethost (const char *name, struct DNSQuery *req ); +int adns_getaddr (struct in_addr *addr , struct DNSQuery *req ); void delete_adns_queries(struct DNSQuery *q); void do_adns_io(); #endif diff -uNrd ircd-hybrid-6.3.1.dist/include/s_conf.h ircd-hybrid-6.3.1/include/s_conf.h --- ircd-hybrid-6.3.1.dist/include/s_conf.h Fri Dec 14 21:42:01 2001 +++ ircd-hybrid-6.3.1/include/s_conf.h Tue Apr 22 10:08:07 2003 @@ -96,7 +96,6 @@ #define CONF_FLINE 0x8000 #define CONF_DLINE 0x20000 #define CONF_XLINE 0x40000 -#define CONF_ULINE 0x80000 #define CONF_OPS (CONF_OPERATOR | CONF_LOCOP) #define CONF_SERVER_MASK (CONF_CONNECT_SERVER | CONF_NOCONNECT_SERVER) @@ -128,9 +127,15 @@ #define CONF_FLAGS_LITTLE_I_LINE 0x8000 #endif +#define CONF_FLAGS_RESOLVE 0x10000 + +#ifdef CHECK_CLONE +#define CONF_FLAGS_CLONE_EXEMPT 0x20000 +#endif /* Macros for aConfItem */ +#define IsMustResolve(x) ((x)->flags & CONF_FLAGS_RESOLVE) #define IsLimitIp(x) ((x)->flags & CONF_FLAGS_LIMIT_IP) #define IsNoTilde(x) ((x)->flags & CONF_FLAGS_NO_TILDE) #define IsNeedIdentd(x) ((x)->flags & CONF_FLAGS_NEED_IDENTD) @@ -150,6 +155,10 @@ #define IsConfLittleI(x) ((x)->flags & CONF_FLAGS_LITTLE_I_LINE) #endif +#ifdef CHECK_CLONE +#define IsConfCloneExempt(x) ((x)->flags & CONF_FLAGS_CLONE_EXEMPT) +#endif + /* port definitions for Opers */ #define CONF_OPER_GLOBAL_KILL 1 @@ -160,6 +169,7 @@ #define CONF_OPER_K 32 #define CONF_OPER_REHASH 64 #define CONF_OPER_DIE 128 +#define CONF_OPER_ADMIN 256 typedef struct { @@ -178,8 +188,6 @@ } ConfigFileEntryType; /* aConfItems */ -/* conf uline link list root */ -extern struct ConfItem *u_conf; /* conf xline link list root */ extern struct ConfItem *x_conf; /* conf qline link list root */ @@ -189,6 +197,7 @@ extern int specific_virtual_host; /* GLOBAL - used in s_bsd.c */ extern struct ConfItem *temporary_klines; extern struct ConfItem *temporary_ip_klines; +extern struct ConfItem *temporary_dlines; extern ConfigFileEntryType ConfigFileEntry; /* GLOBAL - defined in ircd.c */ extern void clear_ip_hash_table(void); @@ -241,9 +250,16 @@ extern struct ConfItem* is_klined(const char *host, const char *name, unsigned long ip); +extern struct ConfItem* is_tklined(const char *host, + const char *name, + unsigned long ip); +extern struct ConfItem* is_pklined(const char *host, + const char *name, + unsigned long ip); extern struct ConfItem* find_is_klined(const char* host, const char* name, unsigned long ip); +extern struct ConfItem *find_tdline(unsigned long ip); extern char* show_iline_prefix(struct Client *,struct ConfItem *,char *); extern void get_printable_conf(struct ConfItem *, char **, char **, char **, char **, int *); @@ -256,23 +272,21 @@ typedef enum { CONF_TYPE, KLINE_TYPE, +#ifdef XLINE_COMMAND + DLINE_TYPE, + XLINE_TYPE +#else DLINE_TYPE +#endif } KlineType; -extern void write_kline_or_dline_to_conf_and_notice_opers( - KlineType, - struct Client *, - struct Client *, - char *, - char *, - char *, - char * - ); extern const char *get_conf_name(KlineType); extern int safe_write(struct Client *, const char *, int ,char *); extern void add_temp_kline(struct ConfItem *); +extern void add_temp_dline(struct ConfItem *); extern void flush_temp_klines(void); extern void report_temp_klines(struct Client *); +extern void report_temp_dlines(struct Client *); extern void show_temp_klines(struct Client *, struct ConfItem *); extern int is_address(char *,unsigned long *,unsigned long *); extern int rehash (struct Client *, struct Client *, int); diff -uNrd ircd-hybrid-6.3.1.dist/include/s_misc.h ircd-hybrid-6.3.1/include/s_misc.h --- ircd-hybrid-6.3.1.dist/include/s_misc.h Thu Dec 13 18:16:34 2001 +++ ircd-hybrid-6.3.1/include/s_misc.h Thu May 1 11:46:00 2003 @@ -18,6 +18,7 @@ extern char *small_file_date(time_t); extern char *make_isupport(); +int oper_time(char *); #endif diff -uNrd ircd-hybrid-6.3.1.dist/include/s_serv.h ircd-hybrid-6.3.1/include/s_serv.h --- ircd-hybrid-6.3.1.dist/include/s_serv.h Sun Dec 9 14:02:09 2001 +++ ircd-hybrid-6.3.1/include/s_serv.h Mon Apr 21 14:30:35 2003 @@ -45,6 +45,9 @@ #define CAP_EX 0x00000008 /* Can do channel +e exemptions */ #define CAP_CHW 0x00000010 /* Can do channel wall @# */ #define CAP_KNOCK 0x00000020 +#define CAP_KLN 0x00000040 +#define CAP_UNKLN 0x00000080 +#define CAP_ENCAP 0x00000100 #define DoesCAP(x) ((x)->caps) diff -uNrd ircd-hybrid-6.3.1.dist/include/s_stats.h ircd-hybrid-6.3.1/include/s_stats.h --- ircd-hybrid-6.3.1.dist/include/s_stats.h Fri Jul 30 16:14:04 1999 +++ ircd-hybrid-6.3.1/include/s_stats.h Sat Apr 19 21:06:44 2003 @@ -65,6 +65,9 @@ #ifdef FLUD unsigned int is_flud; /* users/channels flood protected */ #endif /* FLUD */ +#ifdef ANTI_IP_SPOOF + unsigned int is_ipspoof; +#endif }; extern struct ServerStatistics* ServerStats; diff -uNrd ircd-hybrid-6.3.1.dist/include/s_user.h ircd-hybrid-6.3.1/include/s_user.h --- ircd-hybrid-6.3.1.dist/include/s_user.h Wed Oct 17 11:13:31 2001 +++ ircd-hybrid-6.3.1/include/s_user.h Sat May 3 10:21:54 2003 @@ -40,6 +40,8 @@ extern void send_umode_out (struct Client*, struct Client *, int); extern int show_lusers(struct Client *, struct Client *, int, char **); extern void show_opers(struct Client* client); +extern char oper_type_char(struct Client *); +extern int register_user(struct Client *, struct Client *, char *, char *); #endif diff -uNrd ircd-hybrid-6.3.1.dist/include/send.h ircd-hybrid-6.3.1/include/send.h --- ircd-hybrid-6.3.1.dist/include/send.h Sat Feb 2 15:58:27 2002 +++ ircd-hybrid-6.3.1/include/send.h Fri May 2 18:23:48 2003 @@ -19,7 +19,7 @@ /* send.c prototypes */ -extern void send_operwall(struct Client *,char *,char *); +extern void send_operwall(struct Client *,char *,char *, int); extern void sendto_channel_type_notice(struct Client *, struct Channel *, int, char *); extern void send_knock(struct Client *, struct Client *, diff -uNrd ircd-hybrid-6.3.1.dist/include/serno.h ircd-hybrid-6.3.1/include/serno.h --- ircd-hybrid-6.3.1.dist/include/serno.h Wed Apr 17 23:16:00 2002 +++ ircd-hybrid-6.3.1/include/serno.h Sat Apr 19 21:06:44 2003 @@ -1 +1 @@ -#define SERIALNUM "20020418_1" +#define SERIALNUM "20020802_0" diff -uNrd ircd-hybrid-6.3.1.dist/include/setup.h.in ircd-hybrid-6.3.1/include/setup.h.in --- ircd-hybrid-6.3.1.dist/include/setup.h.in Sun Jan 27 23:36:54 2002 +++ ircd-hybrid-6.3.1/include/setup.h.in Sat Apr 19 21:06:44 2003 @@ -1,5 +1,4 @@ -/* $Id: setup.h.in,v 1.17 2002/01/28 04:36:54 androsyn Exp $ */ -/* include/setup.h.in. Generated automatically from autoconf/configure.in by autoheader 2.13. */ +/* include/setup.h.in. Generated automatically from configure.in by autoheader. */ /* Define if you have a working `mmap' system call. */ #undef HAVE_MMAP @@ -36,6 +35,9 @@ /* Define if you have SYSV non-blocking sockets (FIONBIO) */ #undef NBLOCK_SYSV +/* Define if you have the setlocale() system call. */ +#undef USE_SETLOCALE + /* Define if you have the getpagesize function. */ #undef HAVE_GETPAGESIZE @@ -47,6 +49,9 @@ /* Define if you have the header file. */ #undef HAVE_GETOPT_H + +/* Define if you have the header file. */ +#undef HAVE_LOCALE_H /* Define if you have the header file. */ #undef HAVE_STDDEF_H diff -uNrd ircd-hybrid-6.3.1.dist/opers.txt ircd-hybrid-6.3.1/opers.txt --- ircd-hybrid-6.3.1.dist/opers.txt Fri Dec 7 20:59:13 2001 +++ ircd-hybrid-6.3.1/opers.txt Thu May 1 15:06:42 2003 @@ -25,6 +25,11 @@ * +b - Can see possible bot warnings. * +x - Can see new server introduction and server split messages. + * +l - Can see LOCOPS messages + * +u - Can see unauthorized client messages + * +j - Can see clients trying to join juped channels + * +a - Marked as a server administrator (if compiled with + ADMIN_MODE) =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -86,6 +91,8 @@ When [port] is used, the connection will be attempted to [port]. When [port] is not used, 6667 is used as a default. + If [port] is 0 and used on a Hybrid 7 or another +fr + server, the default port in the C: line is used, or 6667 + WALLOPS - WALLOPS : Sends a WALLOPS message of to all opers @@ -123,9 +130,11 @@ -- If compiled with LTRACE -- Displays only Oper, Serv, Link, and Class reports even if the O-line is active. Useful for just showing pertinent - info of a specific server. Note however that if the - target server is not running this option then you will - still receive a normal trace output. + info of a specific server. + ++ ETRACE - ETRACE + Displays only User and Oper entries with the gecos. + This is primarily used for monitor bots. REHASH - REHASH [option] When no [option] is given, ircd will re-read the @@ -182,6 +191,10 @@ minutes as the first parameter i.e. KLINE 10 :cool off for 10 minutes + The time can now include the letters 'w', 'd', 'h', and 'm' + to specify weeks, days, hours, minutes respectively, i.e. + KLINE 1d12h :cool off + + UNKLINE - UNKLINE Will attempt to unkline the given Will unkline a temporary kline. @@ -195,9 +208,27 @@ In order to use rather than , must be on your server. + For a temporary DLINE, length of dline is given in + minutes as the first parameter i.e. + DLINE 10 :cool off for 10 minutes + + The time can now include the letters 'w', 'd', 'h', and 'm' + to specify weeks, days, hours, minutes respectively, i.e. + DLINE 1d12h :cool off + + UNDLINE - UNDLINE Will attempt to undline the given ++ XLINE - XLINE :[reason] + -- If compiled with XLINE_COMMAND -- + Adds an XLINE to the ircd.conf or klines.conf file + which will deny any connection from users using the + matched gecos field. The banned client will receive + a message saying he/she is banned because of bad + user info. + + The match text cannot have a space in it. + + HTM - HTM [option] When no [option] is given, HTM shows the current High Traffic Mode rate and whether HTM is on or off. @@ -228,6 +259,8 @@ MAX - Sets the number of max connections to . (This number cannot exceed HARD_FDLIMIT in config.h) + MAXTKTIME - Sets the maximum time permissible in a + temporary K-line in minutes. -- The following three are if compiled with FLUD -- FLUDNUM - Sets the number of flud messages to @@ -251,6 +284,14 @@ constitutes a possible spambot. SPAMTIME - Below this time on a channel counts as a join/part as above. + + -- The following is if compiled with CLONE_CHECK + CLONENUM - Sets how many clones in: + CLONEPERIOD - seconds to trigger a block + + -- The following is if compiled with XLINE_COMMAND + XLINETYPE - Sets the type of XLINE to create, + WARN, REJECT, or SILENT + GLINE - GLINE :[reason] -- if compiled with GLINE -- diff -uNrd ircd-hybrid-6.3.1.dist/src/.depend ircd-hybrid-6.3.1/src/.depend --- ircd-hybrid-6.3.1.dist/src/.depend Thu Dec 6 23:13:29 2001 +++ ircd-hybrid-6.3.1/src/.depend Sat May 3 10:22:15 2003 @@ -30,8 +30,8 @@ ../include/numeric.h ../include/res.h ../include/fileio.h \ ../include/../adns/adns.h ../include/s_bsd.h ../include/s_conf.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/s_debug.h + ../include/s_serv.h ../include/s_stats.h ../include/send.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/ircd_defs.h @@ -126,10 +126,29 @@ ../include/numeric.h ../include/s_bsd.h ../include/res.h \ ../include/fileio.h ../include/../adns/adns.h ../include/s_log.h \ ../include/send.h +m_encap.o: m_encap.c ../include/ircd.h ../include/config.h \ + ../include/setup.h ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/send.h ../include/s_conf.h \ + ../include/fileio.h ../include/motd.h ../include/s_serv.h \ + ../include/m_commands.h 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/s_debug.h + ../include/numeric.h ../include/send.h ../include/s_debug.h \ + ../include/s_log.h +m_etrace.o: m_etrace.c ../include/m_commands.h ../include/config.h \ + ../include/setup.h ../include/class.h ../include/client.h \ + ../include/ircd_defs.h ../include/dbuf.h ../include/common.h \ + ../include/hash.h ../include/irc_string.h ../include/ircd.h \ + ../include/numeric.h ../include/s_bsd.h ../include/res.h \ + ../include/fileio.h ../include/../adns/adns.h ../include/s_serv.h \ + ../include/send.h +m_flags.o: m_flags.c ../include/m_commands.h ../include/config.h \ + ../include/setup.h ../include/s_user.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/s_serv.h ../include/send.h ../include/struct.h \ + ../include/m_flags.h m_gline.o: m_gline.c ../include/m_commands.h ../include/config.h \ ../include/setup.h ../include/m_gline.h ../include/ircd_defs.h \ ../include/channel.h ../include/client.h ../include/dbuf.h \ @@ -169,7 +188,8 @@ ../include/irc_string.h ../include/ircd.h ../include/mtrie_conf.h \ ../include/numeric.h ../include/s_conf.h ../include/fileio.h \ ../include/motd.h ../include/s_log.h ../include/s_misc.h \ - ../include/send.h ../include/struct.h ../include/hash.h + ../include/s_serv.h ../include/send.h ../include/struct.h \ + ../include/hash.h m_links.o: m_links.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 \ @@ -196,6 +216,11 @@ ../include/setup.h ../include/client.h ../include/ircd_defs.h \ ../include/dbuf.h ../include/ircd.h ../include/numeric.h \ ../include/s_serv.h ../include/s_user.h ../include/send.h +m_map.o: m_map.c ../include/ircd.h ../include/config.h \ + ../include/setup.h ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/numeric.h ../include/send.h \ + ../include/s_conf.h ../include/fileio.h ../include/motd.h \ + ../include/m_commands.h m_message.o: m_message.c ../include/m_commands.h ../include/config.h \ ../include/setup.h ../include/client.h ../include/ircd_defs.h \ ../include/dbuf.h ../include/flud.h ../include/ircd.h \ @@ -228,7 +253,8 @@ m_pong.o: m_pong.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/send.h ../include/channel.h ../include/irc_string.h + ../include/send.h ../include/channel.h ../include/s_stats.h \ + ../include/irc_string.h m_quit.o: m_quit.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 \ @@ -298,7 +324,8 @@ ../include/dline_conf.h ../include/fileio.h ../include/irc_string.h \ ../include/ircd.h ../include/mtrie_conf.h ../include/numeric.h \ ../include/s_conf.h ../include/motd.h ../include/s_log.h \ - ../include/s_misc.h ../include/send.h ../include/struct.h + ../include/s_misc.h ../include/s_serv.h ../include/send.h \ + ../include/struct.h m_userhost.o: m_userhost.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 \ @@ -399,13 +426,13 @@ s_log.o: s_log.c ../include/s_log.h ../include/irc_string.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 \ +s_misc.o: s_misc.c ../include/s_misc.h ../include/channel.h \ ../include/config.h ../include/setup.h ../include/ircd_defs.h \ - ../include/dbuf.h ../include/common.h ../include/irc_string.h \ - ../include/ircd.h ../include/numeric.h ../include/res.h \ - ../include/fileio.h ../include/../adns/adns.h ../include/s_bsd.h \ - ../include/s_conf.h ../include/motd.h ../include/s_serv.h \ - ../include/send.h ../include/struct.h + ../include/client.h ../include/dbuf.h ../include/common.h \ + ../include/irc_string.h ../include/ircd.h ../include/numeric.h \ + ../include/res.h ../include/fileio.h ../include/../adns/adns.h \ + ../include/s_bsd.h ../include/s_conf.h ../include/motd.h \ + ../include/s_serv.h ../include/send.h ../include/struct.h s_serv.o: s_serv.c ../include/s_serv.h ../include/config.h \ ../include/setup.h ../include/channel.h ../include/ircd_defs.h \ ../include/class.h ../include/client.h ../include/dbuf.h \ @@ -431,7 +458,8 @@ ../include/s_bsd.h ../include/res.h ../include/fileio.h \ ../include/../adns/adns.h ../include/s_conf.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/whowas.h \ + ../include/m_flags.h s_zip.o: s_zip.c ../include/client.h ../include/config.h \ ../include/setup.h ../include/ircd_defs.h ../include/dbuf.h \ ../include/s_zip.h ../include/irc_string.h ../include/packet.h \ diff -uNrd ircd-hybrid-6.3.1.dist/src/Makefile.in ircd-hybrid-6.3.1/src/Makefile.in --- ircd-hybrid-6.3.1.dist/src/Makefile.in Thu Dec 6 23:13:29 2001 +++ ircd-hybrid-6.3.1/src/Makefile.in Fri May 2 12:04:12 2003 @@ -38,7 +38,10 @@ m_close.c \ m_connect.c \ m_die.c \ + m_encap.c \ m_error.c \ + m_etrace.c \ + m_flags.c \ m_gline.c \ m_htm.c \ m_info.c \ @@ -51,6 +54,7 @@ m_locops.c \ m_ltrace.c \ m_lusers.c \ + m_map.c \ m_message.c \ m_mode.c \ m_operwall.c \ @@ -212,8 +216,6 @@ distclean: clean ${RM} -f Makefile version.c.last - -numeric.o: messages_cust.tab include .depend diff -uNrd ircd-hybrid-6.3.1.dist/src/adns.c ircd-hybrid-6.3.1/src/adns.c --- ircd-hybrid-6.3.1.dist/src/adns.c Mon Mar 4 18:07:24 2002 +++ ircd-hybrid-6.3.1/src/adns.c Sat Apr 19 21:13:48 2003 @@ -167,28 +167,28 @@ dns_do_callbacks(); timeout_adns(); } -/* void adns_gethost(const char *name, struct DNSQuery *req); +/* int adns_gethost(const char *name, struct DNSQuery *req); * Input: A name, an address family, a DNSQuery structure. * Output: None * Side effects: Sets up a query structure and sends off a DNS query to * the DNS server to resolve an "A"(address) entry by name. */ -void adns_gethost(const char *name, struct DNSQuery *req) +int adns_gethost(const char *name, struct DNSQuery *req) { assert(dns_state->nservers > 0); - adns_submit(dns_state, name, adns_r_addr, adns_qf_owner, req, - &req->query); + return(adns_submit(dns_state, name, adns_r_addr, adns_qf_owner, req, + &req->query)); } -/* void adns_getaddr(struct irc_inaddr *addr, int aftype, +/* int adns_getaddr(struct irc_inaddr *addr, int aftype, struct DNSQuery *req); * Input: An address, an address family, a DNSQuery structure. * Output: None * Side effects: Sets up a query entry and sends it to the DNS server to * resolve an IP address to a domain name. */ -void adns_getaddr(struct in_addr *addr, +int adns_getaddr(struct in_addr *addr, struct DNSQuery *req) { struct sockaddr_in ipn; @@ -196,6 +196,6 @@ ipn.sin_family = AF_INET; ipn.sin_port = 0; ipn.sin_addr.s_addr = addr->s_addr; - adns_submit_reverse(dns_state, (struct sockaddr *)&ipn, - adns_r_ptr, adns_qf_owner|adns_qf_cname_loose|adns_qf_quoteok_anshost, req, &req->query); + return(adns_submit_reverse(dns_state, (struct sockaddr *)&ipn, + adns_r_ptr, adns_qf_owner|adns_qf_cname_loose|adns_qf_quoteok_anshost, req, &req->query)); } diff -uNrd ircd-hybrid-6.3.1.dist/src/channel.c ircd-hybrid-6.3.1/src/channel.c --- ircd-hybrid-6.3.1.dist/src/channel.c Sun Feb 17 00:58:12 2002 +++ ircd-hybrid-6.3.1/src/channel.c Fri May 2 18:21:21 2003 @@ -22,7 +22,7 @@ * These flags can be set in a define if you wish. * * - * $Id: channel.c,v 1.233 2002/02/17 05:58:12 lusky Exp $ + * $Id: channel.c,v 1.234 2002/08/02 21:57:50 androsyn Exp $ */ #include "channel.h" #include "m_commands.h" @@ -77,7 +77,11 @@ static void change_chan_flag(struct Channel *, struct Client *, int ); static void set_deopped(struct Client *,struct Channel *,int); +#ifdef PART_MESSAGES +static char *PartFmt = ":%s PART %s :%s"; +#else static char *PartFmt = ":%s PART %s"; +#endif /* * some buffers for rebuilding channel/nick lists with ,'s */ @@ -616,7 +620,11 @@ Link *lp; #ifdef JUPE_CHANNEL +#ifdef JUPE_BYPASS + if (MyClient(cptr) && chptr->juped && !IsAnOper(cptr)) +#else if (MyClient(cptr) && chptr->juped) +#endif { return 1; } @@ -631,6 +639,12 @@ if (chptr->mode.mode & MODE_NOPRIVMSGS && !lp) return (MODE_NOPRIVMSGS); +#ifdef SILENCE_ON_BAN + if (is_banned(cptr, chptr) == CHFL_BAN && + (!lp || !(lp->flags & (CHFL_CHANOP|CHFL_VOICE)))) + return (MODE_MODERATED); +#endif + return 0; } @@ -652,6 +666,11 @@ void channel_modes(struct Client *cptr, char *mbuf, char *pbuf, struct Channel *chptr) { *mbuf++ = '+'; + +#ifdef SHOW_JUPE_MODE + if (chptr->juped == 1) + *mbuf++ = 'j'; +#endif if (chptr->mode.mode & MODE_SECRET) *mbuf++ = 's'; @@ -987,6 +1006,10 @@ char *pbufw_new = parabuf_new; int ischop; +#ifdef LOCAL_HACKOPS + int isok1; + int isloc; +#endif int isok; int isdeop; int chan_op; @@ -1001,8 +1024,19 @@ /* is client marked as deopped */ isdeop = !ischop && !IsServer(sptr) && (user_mode_chan & CHFL_DEOPPED); +#ifdef LOCAL_HACKOPS + /* is an op or server or remote user on a TS channel */ + isok1 = ischop || (!isdeop && IsServer(cptr) && chptr->channelts); + + /* it's a local channel and the user is an oper */ + isloc = (chptr->chname[0] == '&') && IsAnOper(sptr); + + /* The union of the above is the final "ok" check */ + isok = isok1 || isloc; +#else /* is an op or server or remote user on a TS channel */ isok = ischop || (!isdeop && IsServer(cptr) && chptr->channelts); +#endif /* isok_c calculated later, only if needed */ @@ -1115,7 +1149,14 @@ if ((who == sptr) && (c == 'o')) { +#ifdef LOCAL_HACKOPS + /* If you're trying to op yourself and it's NOT a local channel + * with an operator source + */ + if((whatt == MODE_ADD) && !isloc) +#else if(whatt == MODE_ADD) +#endif break; } @@ -1899,9 +1940,13 @@ int ban_or_exception; #ifdef JUPE_CHANNEL +#ifdef JUPE_BYPASS + if(chptr->juped && !IsAnOper(sptr)) +#else if(chptr->juped) +#endif { - sendto_ops_flags(FLAGS_SPY, + sendto_ops_flags(FLAGS_JUPE, "User %s (%s@%s) is attempting to join locally juped channel %s", sptr->name, sptr->username, sptr->host,chptr->chname); @@ -2304,7 +2349,11 @@ { chptr = lp->value.chptr; sendto_channel_butserv(chptr, sptr, PartFmt, +#ifdef PART_MESSAGES + parv[0], chptr->chname, ""); +#else parv[0], chptr->chname); +#endif remove_user_from_channel(sptr, chptr, 0); } @@ -2634,9 +2683,17 @@ ** Remove user from the old channel (if any) */ +#ifdef PART_MESSAGES + sendto_match_servs(chptr, cptr, PartFmt, parv[0], name, + (parc == 3) ? parv[2] : ""); + + sendto_channel_butserv(chptr, sptr, PartFmt, parv[0], name, + (parc == 3) ? parv[2] : ""); +#else sendto_match_servs(chptr, cptr, PartFmt, parv[0], name); sendto_channel_butserv(chptr, sptr, PartFmt, parv[0], name); +#endif remove_user_from_channel(sptr, chptr, 0); name = strtoken(&p, (char *)NULL, ","); } @@ -2861,8 +2918,8 @@ knock_local = 1; #else { - sendto_one(sptr, form_str(ERR_UNKNOWNCOMMAND), - me.name, sptr->name, "knock"); + sendto_one(sptr, form_str(ERR_KNOCKDISABLED), + me.name, sptr->name); return 0; } #endif @@ -2898,13 +2955,17 @@ )) { if(knock_local) - sendto_one(sptr,":%s NOTICE %s :*** Notice -- Channel is open!", - me.name, sptr->name); + sendto_one(sptr, form_str(ERR_CHANOPEN), me.name, sptr->name, + name); return 0; } - /* don't allow a knock if the user is banned, or the channel is secret */ - if (knock_local && ((chptr->mode.mode & MODE_SECRET) || + /* don't allow a knock if the user is banned, or the channel is private */ +#ifdef OLD_KNOCK + if (knock_local && ((chptr->mode.mode & MODE_SECRET) || +#else + if (knock_local && ((chptr->mode.mode & MODE_PRIVATE) || +#endif (is_banned(sptr, chptr) == CHFL_BAN)) ) { sendto_one(sptr, form_str(ERR_CANNOTSENDTOCHAN), me.name, parv[0], @@ -2916,9 +2977,8 @@ if (IsMember(sptr, chptr)) { if(knock_local) - sendto_one(sptr,":%s NOTICE %s :*** Notice -- You are on channel already!", - me.name, - sptr->name); + sendto_one(sptr, form_str(ERR_KNOCKONCHAN), me.name, sptr->name, + name); return 0; } @@ -2944,27 +3004,21 @@ if((sptr->last_knock + KNOCK_DELAY) > CurrentTime) { - sendto_one(sptr,":%s NOTICE %s :*** Notice -- Wait %d seconds before another knock", - me.name, - sptr->name, - KNOCK_DELAY - (CurrentTime - sptr->last_knock)); + sendto_one(sptr, form_str(ERR_TOOMANYKNOCK), me.name, sptr->name, + name, "user"); return 0; } if((chptr->last_knock + KNOCK_DELAY_CHANNEL) > CurrentTime) { - sendto_one(sptr, ":%s NOTICE %s :*** Notice -- Wait %d seconds before another knock to %s", - me.name, sptr->name, - KNOCK_DELAY_CHANNEL - (CurrentTime - chptr->last_knock), - name); + sendto_one(sptr, form_str(ERR_TOOMANYKNOCK), me.name, sptr->name, + name, "channel"); return 0; } sptr->last_knock = CurrentTime; - sendto_one(sptr,":%s NOTICE %s :*** Notice -- Your KNOCK has been delivered", - me.name, - sptr->name); + sendto_one(sptr, form_str(RPL_KNOCKDLVR), me.name, sptr->name, name); } chptr->last_knock = CurrentTime; @@ -2980,20 +3034,11 @@ * -Dianora */ + /* bit of paranoid, be a shame if it cored for this -Dianora */ + if(sptr->user) { - char message[NICKLEN*2+CHANNELLEN+USERLEN+HOSTLEN+30]; - - /* bit of paranoid, be a shame if it cored for this -Dianora */ - if(sptr->user) - { - ircsprintf(message,"KNOCK: %s (%s [%s@%s] has asked for an invite)", - chptr->chname, - sptr->name, - sptr->username, - sptr->host); - send_knock(sptr, cptr, chptr, MODE_CHANOP, message, - (parc > 3) ? parv[3] : ""); - } + send_knock(sptr, cptr, chptr, MODE_CHANOP, name, + (parc > 3) ? parv[3] : ""); } #endif @@ -3074,7 +3119,12 @@ * XXX - this truncates the topic_nick if * strlen(sptr->name) > NICKLEN */ +#ifdef TOPIC_UH + ircsprintf(chptr->topic_nick, "%s!%s@%s", sptr->name, + sptr->username, sptr->host); +#else strncpy_irc(chptr->topic_nick, sptr->name, NICKLEN); +#endif /* TOPIC_UH */ chptr->topic_time = CurrentTime; #endif sendto_match_servs(chptr, cptr,":%s TOPIC %s :%s", diff -uNrd ircd-hybrid-6.3.1.dist/src/client.c ircd-hybrid-6.3.1/src/client.c --- ircd-hybrid-6.3.1.dist/src/client.c Sun Feb 17 00:58:13 2002 +++ ircd-hybrid-6.3.1/src/client.c Sat Apr 19 21:06:45 2003 @@ -42,6 +42,7 @@ #include "s_log.h" #include "s_misc.h" #include "s_serv.h" +#include "s_stats.h" #include "send.h" #include "struct.h" #include "whowas.h" @@ -364,6 +365,39 @@ #endif continue; /* and go examine next fd/cptr */ } + else if((aconf = find_tdline(ntohl(cptr->ip.s_addr)))) + { + sendto_realops("D-line active for %s", get_client_name(cptr, FALSE)); + + dying_clients[die_index] = cptr; + + +#if defined(KLINE_WITH_CONNECTION_CLOSED) && defined(KLINE_WITH_REASON) + dying_clients_reason[die_index++] = "Connection closed"; + reason = aconf->passwd ? aconf->passwd :"D-lined"; +#else +#ifdef KLINE_WITH_CONNECTION_CLOSED + reason = "Connection closed"; + dying_clients_reason[die_index++] = reason; +#else +#ifdef KLINE_WITH_REASON + reason = aconf->passwd ? aconf->passwd : "D-lined"; + dying_clients_reason[die_index++] = reason; +#else + reason = "D-lined"; + dying_clients_reason[die_index++] = reason; +#endif +#endif +#endif + dying_clients[die_index] = (struct Client *)NULL; + if(IsPerson(cptr)) + sendto_one(cptr, form_str(ERR_YOUREBANNEDCREEP), + me.name, cptr->name, reason); + else + sendto_one(cptr, "NOTICE DLINE :*** You have been D-lined"); + + continue; + } } else { @@ -541,6 +575,10 @@ sendto_ops("No response from %s, closing link", get_client_name(cptr, MASK_IP)); } +#ifdef ANTI_IP_SPOOF + if (!IsRegistered(cptr) && (cptr->name[0]) && (cptr->user)) + ServerStats->is_ipspoof++; +#endif /* * this is used for KILL lines with time restrictions * on them - send a messgae to the user being killed @@ -1173,7 +1211,10 @@ ts_warn("server %s without servptr!", sptr->name); } else if (sptr->servptr && sptr->servptr->serv) + { del_client_from_llist(&(sptr->servptr->serv->users), sptr); + sptr->servptr->serv->usercnt--; + } /* there are clients w/o a servptr: unregistered ones */ /* @@ -1423,6 +1464,12 @@ #endif if (IsAnOper(sptr)) { + +#ifdef DEOPER_NOTICE + sendto_realops_flags(FLAGS_SPY, + "operator %s has exited", sptr->name); +#endif + fdlist_delete(sptr->fd, FDL_OPER | FDL_BUSY); /* LINKLIST */ /* oh for in-line functions... */ diff -uNrd ircd-hybrid-6.3.1.dist/src/dline_conf.c ircd-hybrid-6.3.1/src/dline_conf.c --- ircd-hybrid-6.3.1.dist/src/dline_conf.c Fri Dec 14 11:56:36 2001 +++ ircd-hybrid-6.3.1/src/dline_conf.c Sat Apr 19 21:06:45 2003 @@ -828,9 +828,9 @@ c = 'D'; if(scan->flags & CONF_FLAGS_E_LINED) - c = 'd'; - /* print Dline */ + c = 'E'; + /* print Dline */ get_printable_conf(scan, &name, &host, &pass, &user, &port); sendto_one(sptr, form_str(RPL_STATSDLINE), me.name, diff -uNrd ircd-hybrid-6.3.1.dist/src/irc_string.c ircd-hybrid-6.3.1/src/irc_string.c --- ircd-hybrid-6.3.1.dist/src/irc_string.c Sun Dec 9 21:56:28 2001 +++ ircd-hybrid-6.3.1/src/irc_string.c Fri May 2 11:35:06 2003 @@ -36,15 +36,16 @@ * * * Thu Nov 24 18:22:48 1986 + * + * Localisation of times, 12 fév 2002 -Hwy */ const char* myctime(time_t value) { static char buf[32]; - char* p; + struct tm *ltm = localtime(&value); + static char *gcc_sucks = "%c"; - strcpy(buf, ctime(&value)); - if ((p = strchr(buf, '\n')) != NULL) - *p = '\0'; + strftime(buf, 32, gcc_sucks, ltm); return buf; } diff -uNrd ircd-hybrid-6.3.1.dist/src/ircd.c ircd-hybrid-6.3.1/src/ircd.c --- ircd-hybrid-6.3.1.dist/src/ircd.c Tue Feb 5 23:56:12 2002 +++ ircd-hybrid-6.3.1/src/ircd.c Sat Apr 19 21:06:45 2003 @@ -74,6 +74,10 @@ #include #endif /* HAVE_GETOPT_H */ +#if defined(HAVE_LOCALE_H) +#include +#endif /* HAVE_LOCALE_H */ + /* * for getopt * ZZZ this is going to need confirmation on other OS's @@ -150,6 +154,7 @@ char** myargv; int dorehash = 0; +int doremotd = 0; int debuglevel = -1; /* Server debug level */ char* debugmode = ""; /* -"- -"- -"- */ @@ -530,6 +535,13 @@ rehash(&me, &me, 1); dorehash = 0; } + if (doremotd) + { + ReadMessageFile( &ConfigFileEntry.motd ); + sendto_realops("Got signal SIGUSR1, reloading ircd motd file"); + doremotd = 0; + } + /* ** Flush output buffers on all connections now if they ** have data in them (or at least try to flush) @@ -594,6 +606,17 @@ server_split_time = CurrentTime; #endif +#ifdef CHECK_CLONE + GlobalSetOptions.clone_num = CHECK_CLONE_LIMIT; + GlobalSetOptions.clone_period = CHECK_CLONE_PERIOD; +#endif + + MAXTKTIME = DEFAULT_MAXTKTIME; + +#ifdef XLINE_COMMAND + GlobalSetOptions.xlinetype = DEFAULT_XLINETYPE; +#endif + /* End of global set options */ } @@ -702,10 +725,33 @@ #endif /* RLIMIT_CORE */ } +#ifdef SAVE_MAXCLIENT +void write_stats(void) +{ + int fd; + char buff[20]; + if ((fd = open(MXPATH, O_CREAT|O_WRONLY, 0600))>=0) + { + ircsprintf(buff,"%d\n%d\n", Count.max_loc, Count.max_tot); + if (write(fd, buff, strlen(buff)) == -1) + log(L_ERROR,"Error writing to max clients file %s", MXPATH); + close(fd); + return; + } + else + log(L_ERROR, "Error opening max clients file %s", MXPATH); +} +#endif /* SAVE_MAXCLIENT */ + int main(int argc, char *argv[]) { time_t delay = 0; aConfItem* aconf; +#ifdef SAVE_MAXCLIENT + FBFILE* file; + char mline[20]; + int m1; +#endif if(geteuid() == 0) { @@ -723,6 +769,17 @@ } /* + * Setup the locale settings for times + * It will use the default language setting for the user that starts + * ircd. Set the LC_TIME or LANG variables in your environment prior + * to starting the daemon in order to change the server's language. + * -Hwy + */ +#ifdef USE_SETLOCALE + (void) setlocale(LC_TIME, ""); +#endif + + /* * Setup corefile size immediately after boot */ setup_corefile(); @@ -841,6 +898,22 @@ check_class(); write_pidfile(); + +#ifdef SAVE_MAXCLIENT + if ((file = fbopen(MXPATH, "r"))) + { + if (fbgets(mline, sizeof(mline), file)) + { + m1 = atoi(mline); + if (fbgets(mline, sizeof(mline), file)) + { + Count.max_loc = m1; + Count.max_tot = atoi(mline); + } + } + fbclose(file); + } +#endif log(L_NOTICE, "Server Ready"); diff -uNrd ircd-hybrid-6.3.1.dist/src/ircd_signal.c ircd-hybrid-6.3.1/src/ircd_signal.c --- ircd-hybrid-6.3.1.dist/src/ircd_signal.c Mon Apr 15 19:13:02 2002 +++ ircd-hybrid-6.3.1/src/ircd_signal.c Sat Apr 19 21:06:45 2003 @@ -43,6 +43,9 @@ static void sigterm_handler(int sig) { flush_connections(0); +#ifdef SAVE_MAXCLIENT + write_stats(); +#endif log(L_CRIT, "Server killed By SIGTERM"); exit(-1); } @@ -56,6 +59,14 @@ } /* + * sigusr1_handler - reread the motd file + */ +static void sigusr1_handler(int sig) +{ + doremotd = 1; +} + +/* * sigint_handler - restart the server */ static void sigint_handler(int sig) @@ -105,6 +116,10 @@ act.sa_handler = sigterm_handler; sigaddset(&act.sa_mask, SIGTERM); sigaction(SIGTERM, &act, 0); + + act.sa_handler = sigusr1_handler; + sigaddset(&act.sa_mask, SIGUSR1); + sigaction(SIGUSR1, &act, 0); } diff -uNrd ircd-hybrid-6.3.1.dist/src/m_away.c ircd-hybrid-6.3.1/src/m_away.c --- ircd-hybrid-6.3.1.dist/src/m_away.c Sat Dec 8 02:06:13 2001 +++ ircd-hybrid-6.3.1/src/m_away.c Sat Apr 19 21:06:45 2003 @@ -136,6 +136,10 @@ unnecessary traffic. *sigh* so... as comstud has done, I've commented out this sendto_serv_butone() call -Dianora */ /* sendto_serv_butone(cptr, ":%s AWAY", parv[0]); */ +#ifdef PROPAGATE_AWAY + /* Optionally enabled in +fr -Hwy */ + sendto_serv_butone(cptr, ":%s AWAY", parv[0]); +#endif if (MyConnect(sptr)) sendto_one(sptr, form_str(RPL_UNAWAY), me.name, parv[0]); @@ -150,6 +154,10 @@ unnecessary traffic. *sigh* so... as comstud has done, I've commented out this sendto_serv_butone() call -Dianora */ /* sendto_serv_butone(cptr, ":%s AWAY :%s", parv[0], awy2); */ +#ifdef PROPAGATE_AWAY + /* Optionally renabled for +fr -Hwy */ + sendto_serv_butone(cptr, ":%s AWAY :%s", parv[0], awy2); +#endif /* don't use realloc() -Dianora */ diff -uNrd ircd-hybrid-6.3.1.dist/src/m_close.c ircd-hybrid-6.3.1/src/m_close.c --- ircd-hybrid-6.3.1.dist/src/m_close.c Fri Jul 30 00:01:32 1999 +++ ircd-hybrid-6.3.1/src/m_close.c Sat Apr 19 21:06:45 2003 @@ -116,6 +116,8 @@ closed++; } sendto_one(sptr, form_str(RPL_CLOSEEND), me.name, parv[0], closed); + sendto_realops("%s issued CLOSE, %d connection%s closed", sptr->name, + closed, (closed == 1) ? "" : "s"); return 0; } diff -uNrd ircd-hybrid-6.3.1.dist/src/m_connect.c ircd-hybrid-6.3.1/src/m_connect.c --- ircd-hybrid-6.3.1.dist/src/m_connect.c Mon Dec 3 23:47:45 2001 +++ ircd-hybrid-6.3.1/src/m_connect.c Sat Apr 19 21:06:45 2003 @@ -175,19 +175,33 @@ tmpport = port = aconf->port; if (parc > 2 && !EmptyString(parv[2])) { +#ifdef NEG_PORT + if ((port = atoi(parv[2])) < 0) +#else if ((port = atoi(parv[2])) <= 0) +#endif { sendto_one(sptr, "NOTICE %s :Connect: Illegal port number", parv[0]); return 0; } } +#ifdef NEG_PORT + else if (port < 0 && (port = PORTNUM) <= 0) +#else else if (port <= 0 && (port = PORTNUM) <= 0) +#endif { sendto_one(sptr, ":%s NOTICE %s :Connect: missing port number", me.name, parv[0]); return 0; } +#ifdef NEG_PORT + if (port == 0) + port = tmpport; /* From conf */ + if (port == 0) + port = PORTNUM; /* Default if there wasn't one set in conf */ +#endif /* * Notify all operators about remote connect requests */ diff -uNrd ircd-hybrid-6.3.1.dist/src/m_die.c ircd-hybrid-6.3.1/src/m_die.c --- ircd-hybrid-6.3.1.dist/src/m_die.c Sat Dec 8 02:06:13 2001 +++ ircd-hybrid-6.3.1/src/m_die.c Sat Apr 19 21:06:45 2003 @@ -147,6 +147,9 @@ me.name, get_client_name(sptr, MASK_IP)); } flush_connections(0); +#ifdef SAVE_MAXCLIENT + write_stats(); +#endif log(L_NOTICE, "Server terminated by %s", get_client_name(sptr, HIDE_IP)); /* * this is a normal exit, tell the os it's ok diff -uNrd ircd-hybrid-6.3.1.dist/src/m_encap.c ircd-hybrid-6.3.1/src/m_encap.c --- ircd-hybrid-6.3.1.dist/src/m_encap.c Wed Dec 31 19:00:00 1969 +++ ircd-hybrid-6.3.1/src/m_encap.c Thu May 8 12:50:18 2003 @@ -0,0 +1,93 @@ +/* src/m_encap.c + * Copyright (C) 2003 ircd-ratbox development team + * Port to Hybrid 6 Copyright (C) 2003 W. Jami Campbell, patch maintainer + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1.Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2.Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3.The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $Id: m_encap.c,v 1.3 2003/03/12 00:16:11 leeh Exp $ + */ + +#include "ircd.h" +#include "config.h" +#include "client.h" +#include "send.h" +#include "s_conf.h" +#include "s_serv.h" +#include "m_commands.h" +#include +#include + +int m_encap(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) +{ + char buffer[BUFSIZE]; + char *ptr; + int cur_len = 0; + int len; + int i; + + if (!IsServer(cptr)) + return 0; + +#if 0 + if (match(parv[1], me.name)) + { + /* This matches us, process the subcommand and its arguments */ + + /* Be sure to propagate it on...so no return. */ + } +#endif + + ptr = buffer; + + for(i = 1; i < parc - 1; i++) + { + len = strlen(parv[i]) + 1; + + /* ugh, not even at the last parameter, just bail --fl */ + if((cur_len + len) >= sizeof(buffer)) + return 0; + + snprintf(ptr, sizeof(buffer) - cur_len, "%s ", parv[i]); + cur_len += len; + ptr += len; + } + + len = strlen(parv[i]); + + /* if its a command without parameters, dont prepend a ':' */ + if(parc == 3) + snprintf(ptr, sizeof(buffer) - cur_len, "%s", parv[2]); + else + snprintf(ptr, sizeof(buffer) - cur_len, ":%s", parv[parc-1]); + + /* add a trailing \0 if it was too long */ + if((cur_len + len) >= BUFSIZE) + buffer[BUFSIZE-1] = '\0'; + + sendto_match_cap_servs(NULL, cptr, CAP_ENCAP, + ":%s ENCAP %s", parv[0], buffer); + + return 0; +} diff -uNrd ircd-hybrid-6.3.1.dist/src/m_error.c ircd-hybrid-6.3.1/src/m_error.c --- ircd-hybrid-6.3.1.dist/src/m_error.c Thu Jul 26 12:14:26 2001 +++ ircd-hybrid-6.3.1/src/m_error.c Tue Apr 29 22:27:28 2003 @@ -29,6 +29,7 @@ #include "numeric.h" #include "send.h" #include "s_debug.h" +#include "s_log.h" /* * m_functions execute protocol messages on this server: @@ -97,7 +98,6 @@ */ int m_error(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) { -#ifndef HIDE_ERROR_MESSAGES char* para; para = (parc > 1 && *parv[1] != '\0') ? parv[1] : "<>"; @@ -113,23 +113,48 @@ if (IsPerson(cptr) || IsUnknown(cptr)) return 0; -#if (defined SERVERHIDE) || (defined HIDE_SERVERS_IPS) + /* this is less ugly than it was before, if you ask me. + * at least with this logic, everything's clustered, and + * there's not a crapload of code duplic. anyways, the + * logic is this: + * if the source is the server it came from, + * if HIDE_ERROR_MESSAGES is undefined, + * sendto_realops(hey i got an error me love you long time) + * [ and hide the remote servers ip if HIDE_SERVERS_IPS ] + * always: log(blah blah blah, with the real ip) + * otherwise, if this was sent along from another server: + * same logic as above, but messages contain "via x" + * + * booooooooing. + */ + if (cptr == sptr) + { +#ifndef HIDE_ERROR_MESSAGES sendto_realops("ERROR :from %s -- %s", +#if (defined SERVERHIDE) || (defined HIDE_SERVERS_IPS) get_client_name(cptr, MASK_IP), para); +#else /* SERVERHIDE || HIDE_SERVERS_IPS */ + get_client_name(cptr, FALSE), para); +#endif /* SERVERHIDE || HIDE_SERVERS_IPS */ +#endif /* !HIDE_ERROR_MESSAGES */ + log(L_NOTICE, "ERROR from %s -- %s", + get_client_name(cptr, SHOW_IP), para); + } else + { +#ifndef HIDE_ERROR_MESSAGES sendto_realops("ERROR :from %s via %s -- %s", sptr->name, +#if (defined SERVERHIDE) || (defined HIDE_SERVERS_IPS) get_client_name(cptr, MASK_IP), para); -#else - if (cptr == sptr) - sendto_realops("ERROR :from %s -- %s", +#else /* SERVERHIDE || HIDE_SERVERS_IPS */ get_client_name(cptr, FALSE), para); - else - sendto_realops("ERROR :from %s via %s -- %s", sptr->name, - get_client_name(cptr,FALSE), para); -#endif +#endif /* SERVERHIDE || HIDE_SERVERS_IPS */ +#endif /* !HIDE_ERROR_MESSAGES */ + log(L_NOTICE, "ERROR from %s via %s -- %s", sptr->name, + get_client_name(cptr, SHOW_IP), para); + } -#endif /* HIDE_ERRORS */ return 0; } diff -uNrd ircd-hybrid-6.3.1.dist/src/m_etrace.c ircd-hybrid-6.3.1/src/m_etrace.c --- ircd-hybrid-6.3.1.dist/src/m_etrace.c Wed Dec 31 19:00:00 1969 +++ ircd-hybrid-6.3.1/src/m_etrace.c Mon Apr 21 20:53:56 2003 @@ -0,0 +1,165 @@ +/* + * ircd-ratbox: an advanced Internet Relay Chat Daemon(ircd). + * m_etrace.c: Gives local opers a trace output with added info. + * + * Copyright (C) 2002 ircd-ratbox development team + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1.Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2.Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3.The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $Id: m_etrace.c,v 1.4 2003/03/05 14:20:16 leeh Exp $ + */ + +#include "m_commands.h" +#include "class.h" +#include "client.h" +#include "common.h" +#include "hash.h" +#include "irc_string.h" +#include "ircd.h" +#include "numeric.h" +#include "s_bsd.h" +#include "s_serv.h" +#include "send.h" + +#include +#include + +/* + * m_functions execute protocol messages on this server: + * + * cptr is always NON-NULL, pointing to a *LOCAL* client + * structure (with an open socket connected!). This + * identifies the physical socket where the message + * originated (or which caused the m_function to be + * executed--some m_functions may call others...). + * + * sptr is the source of the message, defined by the + * prefix part of the message if present. If not + * or prefix not found, then sptr==cptr. + * + * (!IsServer(cptr)) => (cptr == sptr), because + * prefixes are taken *only* from servers... + * + * (IsServer(cptr)) + * (sptr == cptr) => the message didn't + * have the prefix. + * + * (sptr != cptr && IsServer(sptr) means + * the prefix specified servername. (?) + * + * (sptr != cptr && !IsServer(sptr) means + * that message originated from a remote + * user (not local). + * + * combining + * + * (!IsServer(sptr)) means that, sptr can safely + * taken as defining the target structure of the + * message in this server. + * + * *Always* true (if 'parse' and others are working correct): + * + * 1) sptr->from == cptr (note: cptr->from == cptr) + * + * 2) MyConnect(sptr) <=> sptr == cptr (e.g. sptr + * *cannot* be a local connection, unless it's + * actually cptr!). [MyConnect(x) should probably + * be defined as (x == x->from) --msa ] + * + * parc number of variable parameter strings (if zero, + * parv is allowed to be NULL) + * + * parv a NULL terminated list of parameter pointers, + * + * parv[0], sender (prefix string), if not present + * this points to an empty string. + * parv[1]...parv[parc-1] + * pointers to additional parameters + * parv[parc] == NULL, *always* + * + * note: it is guaranteed that parv[0]..parv[parc-1] are all + * non-NULL pointers. + */ + +/* +** m_etrace - Extended TRACE - See doc/ETRACE.txt +** parv[0] = sender prefix +** parv[1] = servername +*/ +int m_etrace(struct Client *cptr, + struct Client *sptr, + int parc, + char *parv[]) +{ + int i; + struct Client *acptr = NULL; + + if (check_registered(sptr)) + return 0; + + if (!IsClient(sptr)) + return 0; + + if (!MyConnect(sptr)) + return 0; + + if (!IsAnOper(sptr)) + { + sendto_one(sptr, form_str(ERR_NOPRIVILEGES), me.name, parv[0]); + return 0; + } + + sendto_realops_flags(FLAGS_SPY, "ETRACE requested by %s (%s@%s)", + sptr->name, sptr->username, sptr->host); + + for (i = 0; i <= highest_fd; i++) + { + const char* ip; + + if (!(acptr = local[i])) /* Local Connection? */ + continue; +#ifdef HIDE_SPOOF_IPS + if (IsIPSpoof(acptr)) + ip = "255.255.255.255"; + else +#endif + ip = inetntoa((char*) &acptr->ip); + + switch(acptr->status) + { + case STAT_CLIENT: + sendto_one(sptr, form_str(RPL_ETRACE), me.name, parv[0], + IsAnOper(acptr) ? "Oper" : "User", + get_client_class(acptr), acptr->name, + acptr->username, acptr->host, ip, acptr->info); + break; + default: /* Items ETRACE doesn't care about -Hwy */ + break; + } + } + sendto_one(sptr, form_str(RPL_ENDOFTRACE),me.name,parv[0],me.name); + return 0; +} + diff -uNrd ircd-hybrid-6.3.1.dist/src/m_flags.c ircd-hybrid-6.3.1/src/m_flags.c --- ircd-hybrid-6.3.1.dist/src/m_flags.c Wed Dec 31 19:00:00 1969 +++ ircd-hybrid-6.3.1/src/m_flags.c Sat May 3 10:18:53 2003 @@ -0,0 +1,344 @@ +/* + * m_flags.c: Implements comstud-style mode flags. + * + * Copyright 2002 by W. Campbell and the ircd-hybrid development team + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1.Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2.Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3.The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $Id: m_flags.c,v 1.12 2002/11/21 20:16:30 leeh Exp $ + */ + +#include "m_commands.h" +#include "s_user.h" +#include "client.h" +#include "common.h" +#include "irc_string.h" +#include "ircd.h" +#include "numeric.h" +#include "s_serv.h" +#include "send.h" +#include "struct.h" +#include "m_flags.h" +#include + +#ifdef FLAGS_COMMAND + +/* Backported from my m_flags.c module in Hybrid 7's contrib/ -Hwy */ + +/* FLAGS requires it's own mini parser, since the last parameter in it can +** contain a number of FLAGS. CS handles FLAGS mode1 mode2 OR +** FLAGS :mode1 mode2, but not both mixed. +** +** The best way to match a flag to a mode is with a simple table +*/ + +struct FlagTable +{ + char *name; + int mode; + int oper; +}; + +static struct FlagTable flag_table[] = +{ + /* name mode it represents oper only? */ + { "OWALLOPS", FLAGS_OPERWALL, 1 }, + { "SWALLOPS", FLAGS_WALLOP, 0 }, + { "STATSNOTICES", FLAGS_SPY, 1 }, + /* We don't have a separate OKILL and SKILL modes */ + { "OKILLS", FLAGS_SKILL, 0 }, + { "SKILLS", FLAGS_SKILL, 0 }, + { "SNOTICES", FLAGS_SERVNOTICE, 0 }, + /* We don't have separate client connect and disconnect modes */ + { "CLICONNECTS", FLAGS_CCONN, 1 }, + { "CLIDISCONNECTS", FLAGS_CCONN, 1 }, + /* I'm taking a wild guess here... */ + { "THROTTLES", FLAGS_REJ, 1 }, + /* NICKCHANGES must be checked for separately */ + { "IPMISMATCHES", FLAGS_UNAUTH, 1 }, + { "LWALLOPS", FLAGS_LOCOPS, 1 }, + /* These aren't separate on Hybrid */ + { "CONNECTS", FLAGS_EXTERNAL, 1 }, + { "SQUITS", FLAGS_EXTERNAL, 1 }, + /* Now we have our Hybrid specific flags */ + { "FULL", FLAGS_FULL, 1 }, + /* Not in CS, but we might as well put it here */ + { "INVISIBLE", FLAGS_INVISIBLE, 0 }, + { "BOTS", FLAGS_BOTS, 1 }, + { "UNAUTH", FLAGS_UNAUTH, 1 }, + { "JUPE", FLAGS_JUPE, 1 }, + { "DEBUG", FLAGS_DEBUG, 1 }, + { NULL, 0, 0 } +}; + +/* We won't control INVISIBLE in here */ + +#define FL_ALL_USER_FLAGS (FLAGS_WALLOP | FLAGS_SKILL | FLAGS_SERVNOTICE ) + +/* and we don't control NCHANGES here either */ + +#define FL_ALL_OPER_FLAGS (FL_ALL_USER_FLAGS | FLAGS_CCONN | FLAGS_REJ |\ + FLAGS_FULL | FLAGS_SPY | FLAGS_DEBUG |\ + FLAGS_OPERWALL | FLAGS_BOTS | FLAGS_EXTERNAL |\ + FLAGS_UNAUTH | FLAGS_LOCOPS | FLAGS_JUPE ) + +char *set_flags_to_string(struct Client *client_p) +{ + /* XXX - list all flags that we have set on the client */ + static char setflags[BUFSIZE + 1]; + int i; + + /* Clear it to begin with, we'll be doing a lot of ircsprintf's */ + setflags[0] = '\0'; + + /* Unlike unset_flags_to_string(), we don't have to care about oper + ** flags and not showing them + */ + + for (i = 0; flag_table[i].name; i++) + { + if (client_p->umodes & flag_table[i].mode) + { + ircsprintf(setflags, "%s %s", setflags, flag_table[i].name); + } + } + + /* You can only be set +NICKCHANGES if you are an oper and + ** IsOperN(client_p) is true + */ + if (client_p->umodes & FLAGS_NCHANGE) + { + ircsprintf(setflags, "%s %s", setflags, "NICKCHANGES"); + } + + return setflags; +} + +char *unset_flags_to_string(struct Client *client_p) +{ + /* Inverse of above */ + /* XXX - list all flags that we do NOT have set on the client */ + static char setflags[BUFSIZE + 1]; + int i,isoper; + + /* Clear it to begin with, we'll be doing a lot of ircsprintf's */ + setflags[0] = '\0'; + + if (IsOper(client_p)) + isoper = 1; + else + isoper = 0; + + for (i = 0; flag_table[i].name; i++) + { + if ( !(client_p->umodes & flag_table[i].mode)) + { + if (!isoper && flag_table[i].oper) + continue; + ircsprintf(setflags, "%s %s", setflags, flag_table[i].name); + } + } + + if (IsOper(client_p) && IsSetOperN(client_p)) + { + if ( !(client_p->umodes & FLAGS_NCHANGE)) + { + ircsprintf(setflags, "%s %s", setflags, "NICKCHANGES"); + } + } + + return setflags; +} + +/* +** m_flags +** parv[0] = sender prefix +** parv[1] = parameter +*/ +int m_flags(struct Client *client_p, struct Client *source_p, + int parc, char *parv[]) +{ + int i,j; + int isadd; + int setflags; + int isgood; + char *p; + char *flag; + + if (!MyClient(source_p)) + return 0; + + if (parc < 2) + { + /* Generate a list of what flags you have and what you are missing, + ** and send it to the user + */ + sendto_one(source_p, ":%s NOTICE %s :Current flags:%s", + me.name, parv[0], set_flags_to_string(source_p)); + sendto_one(source_p, ":%s NOTICE %s :Current missing flags:%s", + me.name, parv[0], unset_flags_to_string(source_p)); + return 0; + } + + /* Preserve the current flags */ + setflags = source_p->umodes; + + for (i = 1; i < parc; i++) + { + for (flag = strtoken(&p, parv[i], " "); flag; + flag = strtoken(&p, NULL, " ")) + { + /* We default to being in ADD mode */ + isadd = 1; + + /* We default to being in BAD mode */ + isgood = 0; + + if (!isalpha(flag[0])) + { + if (flag[0] == '-') + isadd = 0; + else if (flag[0] == '+') + isadd = 1; + flag++; + } + + if (IsAnOper(source_p)) + { + /* support ALL here */ + if (!irccmp(flag, "ALL")) + { + if (isadd) + source_p->umodes |= FL_ALL_OPER_FLAGS; + else + source_p->umodes &= ~FL_ALL_OPER_FLAGS; +#ifndef FLAGS_ANNOUNCE + sendto_one(source_p, ":%s NOTICE %s :Current flags:%s", + me.name, parv[0], set_flags_to_string(source_p)); + sendto_one(source_p, ":%s NOTICE %s :Current missing flags:%s", + me.name, parv[0], unset_flags_to_string(source_p)); +#endif + send_umode_out(client_p, source_p, setflags); + return 0; + } + + if (!irccmp(flag, "NICKCHANGES")) + { + if (!IsSetOperN(source_p)) + { + sendto_one(source_p, + ":%s NOTICE %s :*** You need oper and N flag for +n", + me.name,parv[0]); + continue; + } + if (isadd) + source_p->umodes |= FLAGS_NCHANGE; + else + source_p->umodes &= ~FLAGS_NCHANGE; + isgood = 1; + continue; + } + + for (j = 0; flag_table[j].name; j++) + { + if (!irccmp(flag, flag_table[j].name)) + { + if (isadd) + source_p->umodes |= flag_table[j].mode; + else + source_p->umodes &= ~ (flag_table[j].mode); + isgood = 1; + continue; + } + } + /* This for ended without matching a valid FLAG, here is where + ** I want to operate differently than ircd-comstud, and just ignore + ** the invalid flag, send a warning and go on. + */ + if (!isgood) + sendto_one(source_p, ":%s NOTICE %s :Invalid FLAGS: %s (IGNORING)", + me.name, parv[0], flag); + } + else + { + /* support ALL here */ + if (!irccmp(flag, "ALL")) + { + if (isadd) + source_p->umodes |= FL_ALL_USER_FLAGS; + else + source_p->umodes &= ~FL_ALL_USER_FLAGS; +#ifndef FLAGS_ANNOUNCE + sendto_one(source_p, ":%s NOTICE %s :Current flags:%s", + me.name, parv[0], set_flags_to_string(source_p)); + sendto_one(source_p, ":%s NOTICE %s :Current missing flags:%s", + me.name, parv[0], unset_flags_to_string(source_p)); +#endif + send_umode_out(client_p, source_p, setflags); + return 0; + } + + for (j = 0; flag_table[j].name; j++) + { + if (!flag_table[j].oper && !irccmp(flag, flag_table[j].name)) + { + if (isadd) + source_p->umodes |= flag_table[j].mode; + else + source_p->umodes &= ~ (flag_table[j].mode); + isgood = 1; + continue; + } + } + /* This for ended without matching a valid FLAG, here is where + ** I want to operate differently than ircd-comstud, and just ignore + ** the invalid flag, send a warning and go on. + */ + if (!isgood) + sendto_one(source_p, ":%s NOTICE %s :Invalid FLAGS: %s (IGNORING)", + me.name, parv[0], flag); + } + } + } + + /* All done setting the flags, print the notices out to the user + ** telling what flags they have and what flags they are missing + */ +#ifndef FLAGS_ANNOUNCE + /* We only want to send it here when FLAGS_ANNOUNCE is not in use, + ** since send_umode_out() will send this same message to the user. + ** Without this ifndef, the user will receive the current set + ** and missing flags NOTICE's twice + */ + sendto_one(source_p, ":%s NOTICE %s :Current flags:%s", + me.name, parv[0], set_flags_to_string(source_p)); + sendto_one(source_p, ":%s NOTICE %s :Current missing flags:%s", + me.name, parv[0], unset_flags_to_string(source_p)); + +#endif + send_umode_out(client_p, source_p, setflags); + return 0; +} +#endif /* FLAGS_COMMAND */ diff -uNrd ircd-hybrid-6.3.1.dist/src/m_gline.c ircd-hybrid-6.3.1/src/m_gline.c --- ircd-hybrid-6.3.1.dist/src/m_gline.c Sat Dec 15 11:24:09 2001 +++ ircd-hybrid-6.3.1/src/m_gline.c Sat Apr 19 21:06:45 2003 @@ -403,7 +403,7 @@ } /* dont allow glines with : in, theyll break the conf */ - if(strchr(luser, ':') || strchr(lhost, ':') || strchr(lreason, ':')) + if(strchr(luser, ':') || strchr(lreason, ':')) { if(local_client) sendto_one(sptr, ":%s NOTICE %s :Invalid character ':' in gline", @@ -533,7 +533,10 @@ if (safe_write(sptr,filenamebuf,out,buffer)) return; - ircsprintf(buffer, "K:%s:%s:%s\n", host,user,reason); + if (strchr(host, ':')) + ircsprintf(buffer, "# IPv6 Host, invalid (%s@%s) [%s]", user,host,reason); + else + ircsprintf(buffer, "K:%s:%s:%s\n", host,user,reason); if (safe_write(sptr,filenamebuf,out,buffer)) return; @@ -852,6 +855,20 @@ MyFree(tmp_pending_ptr->reason2); MyFree(tmp_pending_ptr); } + else if( find_is_glined(gline_pending_ptr->host, gline_pending_ptr->user)) + { + /* Expire any pending GLINE's if they were triggered and set. */ + if(last_gline_pending_ptr) + last_gline_pending_ptr->next = gline_pending_ptr->next; + else + pending_glines = gline_pending_ptr->next; + + tmp_pending_ptr = gline_pending_ptr; + gline_pending_ptr = gline_pending_ptr->next; + MyFree(tmp_pending_ptr->reason1); + MyFree(tmp_pending_ptr->reason2); + MyFree(tmp_pending_ptr); + } else { last_gline_pending_ptr = gline_pending_ptr; @@ -944,7 +961,8 @@ (irccmp(gline_pending_ptr->oper_server1,oper_server) == 0) ) { /* This oper or server has already "voted" */ - sendto_realops("oper or server has already voted"); + sendto_realops("oper or server has already voted: [%s!%s@%s] on %s", + oper_nick, oper_user, oper_host, oper_server); return NO; } @@ -957,7 +975,8 @@ (irccmp(gline_pending_ptr->oper_server2,oper_server)==0)) { /* This oper or server has already "voted" */ - sendto_realops("oper or server has already voted"); + sendto_realops("oper or server has already voted: [%s!%s@%s] on %s", + oper_nick, oper_user, oper_host, oper_server); return NO; } diff -uNrd ircd-hybrid-6.3.1.dist/src/m_kline.c ircd-hybrid-6.3.1/src/m_kline.c --- ircd-hybrid-6.3.1.dist/src/m_kline.c Fri Dec 14 21:42:04 2001 +++ ircd-hybrid-6.3.1/src/m_kline.c Thu May 1 12:04:01 2003 @@ -36,6 +36,7 @@ #include "s_conf.h" #include "s_log.h" #include "s_misc.h" +#include "s_serv.h" #include "send.h" #include "struct.h" #include "hash.h" @@ -49,8 +50,13 @@ extern ConfigFileEntryType ConfigFileEntry; /* defined in ircd.c */ +/* XXX in m_unkline.c */ +extern int remove_tkline_match(char *host,char *user, unsigned long ip); + /* Local function prototypes */ +#if 0 static int isnumber(char *); /* return 0 if not, else return number */ +#endif static char *cluster(char *); /* @@ -59,10 +65,6 @@ */ aPendingLine *PendingLines = NULL; -#ifdef SLAVE_SERVERS -extern aConfItem *find_special_conf(char *,int); /* defined in s_conf.c */ -#endif - /* * LockFile routines */ @@ -70,12 +72,17 @@ static void DelPending(aPendingLine *); static int LockedFile(const char *); static void WritePendingLines(const char *); -static void WriteKline(const char *, struct Client *, struct Client *, +static void WriteKline(const char *, struct Client *, const char *, const char *, const char *, const char *, const char *); static void WriteDline(const char *, struct Client *, const char *, const char *, const char *, const char *); +#ifdef XLINE_COMMAND +static void WriteXline(const char *, aClient *, + const char *, const char *, + const char *); +#endif /* AddPending() @@ -201,14 +208,13 @@ { WriteKline(filename, PendingLines->sptr, - PendingLines->rcptr, PendingLines->user, PendingLines->host, PendingLines->reason, PendingLines->oper_reason, PendingLines->when); } - else + else if (PendingLines->type == DLINE_TYPE) { WriteDline(filename, PendingLines->sptr, @@ -217,6 +223,16 @@ PendingLines->oper_reason, PendingLines->when); } +#ifdef XLINE_COMMAND + else + { + WriteXline(filename, + PendingLines->sptr, + PendingLines->host, + PendingLines->reason, + PendingLines->when); + } +#endif /* * Delete the K/D line from the list after we write @@ -226,6 +242,14 @@ DelPending(PendingLines); PendingLines = ptmp; } /* while (PendingLines) */ + + /* There's a chance a rehash has been done prior to the pending lines + * being written out to the conf file. They may have been removed from + * memory. For this reason, we should rehash the confs to be sure we + * don't lose any klines. + */ + rehash(&me, &me, 0); + } /* WritePendingLines() */ /* @@ -234,7 +258,7 @@ */ static void -WriteKline(const char *filename, struct Client *sptr, struct Client *rcptr, +WriteKline(const char *filename, struct Client *sptr, const char *user, const char *host, const char *reason, const char *oper_reason, const char *when) @@ -256,26 +280,9 @@ fchmod(out, 0660); -#ifdef SLAVE_SERVERS - if (IsServer(sptr)) - { - if (rcptr != NULL) + if (oper_reason != NULL) + { ircsprintf(buffer, - "#%s!%s@%s from %s K'd: %s@%s:%s\n", - rcptr->name, - rcptr->username, - rcptr->host, - sptr->name, - user, - host, - reason); - } - else -#endif /* SLAVE_SERVERS */ - { - if (oper_reason != NULL) - { - ircsprintf(buffer, "#%s!%s@%s K'd: %s@%s:%s|%s\n", sptr->name, sptr->username, @@ -284,10 +291,10 @@ host, reason, oper_reason); - } - else - { - ircsprintf(buffer, + } + else + { + ircsprintf(buffer, "#%s!%s@%s K'd: %s@%s:%s\n", sptr->name, sptr->username, @@ -295,9 +302,7 @@ user, host, reason); - } - - } + } if (safe_write(sptr, filename, out, buffer) == (-1)) return; @@ -423,88 +428,48 @@ char tmpch; int nonwild; -#ifdef SLAVE_SERVERS - char *slave_oper; - struct Client *rcptr=NULL; - - if(IsServer(sptr)) - { - if(parc < 2) /* pick up actual oper who placed kline */ - return 0; - - slave_oper = parv[1]; /* make it look like normal local kline */ - - parc--; - parv++; - - if ( parc < 2 ) - return 0; - - if ((rcptr = hash_find_client(slave_oper,NULL))) - { - if(!IsPerson(rcptr)) - return 0; - } - else - return 0; - - if(!find_special_conf(sptr->name,CONF_ULINE)) - { - sendto_realops("Received unauthorized K-line from %s",sptr->name); - return 0; - } - else - { - sendto_realops("Received K-line from %s", sptr->name); - } - #ifdef HUB - sendto_slaves(sptr,"KLINE",slave_oper,parc,parv); -#endif - + if (IsServer(cptr)) + { + if(parc == 6) + sendto_match_cap_servs(NULL, sptr, CAP_KLN, + ":%s KLINE %s %s %s %s :%s", + parv[0], parv[1], parv[2], parv[3], parv[4], parv[5]); + return 0; } - else #endif - { - if (!MyClient(sptr) || !IsAnOper(sptr)) - { - sendto_one(sptr, form_str(ERR_NOPRIVILEGES), me.name, parv[0]); - return 0; - } - if(!IsSetOperK(sptr)) - { - sendto_one(sptr,":%s NOTICE %s :You have no K flag",me.name,parv[0]); - return 0; - } + if (!MyClient(sptr) || !IsAnOper(sptr)) + { + sendto_one(sptr, form_str(ERR_NOPRIVILEGES), me.name, parv[0]); + return 0; + } - if ( parc < 2 ) - { - sendto_one(sptr, form_str(ERR_NEEDMOREPARAMS), - me.name, parv[0], "KLINE"); - return 0; - } + if(!IsSetOperK(sptr)) + { + sendto_one(sptr,":%s NOTICE %s :You have no K flag",me.name,parv[0]); + return 0; + } -#ifdef SLAVE_SERVERS - sendto_slaves(NULL,"KLINE",sptr->name,parc,parv); -#endif + if ( parc < 2 ) + { + sendto_one(sptr, form_str(ERR_NEEDMOREPARAMS), + me.name, parv[0], "KLINE"); + return 0; } argv = parv[1]; - if( (temporary_kline_time = isnumber(argv)) ) + if( (temporary_kline_time = oper_time(argv)) ) { if(parc < 3) { -#ifdef SLAVE_SERVERS - if(!IsServer(sptr)) -#endif - sendto_one(sptr, form_str(ERR_NEEDMOREPARAMS), - me.name, parv[0], "KLINE"); + sendto_one(sptr, form_str(ERR_NEEDMOREPARAMS), + me.name, parv[0], "KLINE"); return 0; } - if(temporary_kline_time > (24*60)) - temporary_kline_time = (24*60); /* Max it at 24 hours */ + if(temporary_kline_time > MAXTKTIME) + temporary_kline_time = MAXTKTIME; /* Max it at 24 hours */ temporary_kline_time_seconds = (time_t)temporary_kline_time * (time_t)60; /* turn it into minutes */ argv = parv[2]; @@ -528,6 +493,8 @@ if (!*host) /* duh. no host found, assume its '*' host */ host = "*"; + if (!*user) /* The oper gave us a "@host" kline */ + user = "*"; strncpy_irc(tempuser, user, USERLEN + 1); /* allow for '*' in front */ tempuser[USERLEN + 1] = '\0'; strncpy_irc(temphost, host, HOSTLEN); @@ -547,10 +514,7 @@ if (IsServer(acptr)) { -#ifdef SLAVE_SERVERS - if(!IsServer(sptr)) -#endif - sendto_one(sptr, + sendto_one(sptr, ":%s NOTICE %s :Can't KLINE a server, use @'s where appropriate", me.name, parv[0]); return 0; @@ -558,10 +522,7 @@ if(IsElined(acptr)) { -#ifdef SLAVE_SERVERS - if(!IsServer(sptr)) -#endif - sendto_one(sptr, + sendto_one(sptr, ":%s NOTICE %s :%s is E-lined",me.name,parv[0], acptr->name); return 0; @@ -588,10 +549,7 @@ { if(strchr(argv, ':')) { -#ifdef SLAVE_SERVERS - if(!IsServer(sptr)) -#endif - sendto_one(sptr, + sendto_one(sptr, ":%s NOTICE %s :Invalid character ':' in comment", me.name, parv[0]); return 0; @@ -599,10 +557,7 @@ if(strchr(argv, '#')) { -#ifdef SLAVE_SERVERS - if(!IsServer(sptr)) -#endif - sendto_one(sptr, + sendto_one(sptr, ":%s NOTICE %s :Invalid character '#' in comment", me.name, parv[0]); return 0; @@ -618,19 +573,13 @@ if(strchr(host, '#')) { -#ifdef SLAVE_SERVERS - if(!IsServer(sptr)) -#endif - sendto_one(sptr, ":%s NOTICE %s :Invalid character '#' in hostname", + sendto_one(sptr, ":%s NOTICE %s :Invalid character '#' in hostname", me.name, parv[0]); return 0; } if(strchr(user, '#')) { -#ifdef SLAVE_SERVERS - if(!IsServer(sptr)) -#endif - sendto_one(sptr, ":%s NOTICE %s :Invalid character '#' in username", + sendto_one(sptr, ":%s NOTICE %s :Invalid character '#' in username", me.name, parv[0]); return 0; } @@ -683,9 +632,6 @@ * Not enough non-wild characters were found, assume * they are trying to kline *@*. */ -#ifdef SLAVE_SERVERS - if (!IsServer(sptr)) -#endif sendto_one(sptr, ":%s NOTICE %s :Please include at least %d non-wildcard characters with the user@host", me.name, @@ -729,22 +675,48 @@ ip = 0L; } - if( (aconf = is_klined(host,user,(unsigned long)ip)) ) + if( (aconf = is_tklined(host,user,(unsigned long)ip)) ) { - char *nrkreason; - - if( aconf->status & CONF_KILL ) - { - nrkreason = aconf->passwd ? aconf->passwd : ""; -#ifdef SLAVE_SERVERS - if(!IsServer(sptr)) -#endif + /* This needs optimized */ + if (temporary_kline_time == 0) + { + if(remove_tkline_match(host,user,(unsigned long)ip)) + { + sendto_one(sptr, + ":%s NOTICE %s :Temporary K-line [%s@%s] overridden", + me.name, parv[0], user, host); + } + /* Should NOT get here... */ + } + else + { + /* If it's temporary already, no need to override */ + if( aconf->status & CONF_KILL ) + { + char *nrkreason = aconf->passwd ? aconf->passwd : ""; sendto_one(sptr, ":%s NOTICE %s :[%s@%s] already K-lined by [%s@%s] - %s", me.name, parv[0], user,host, aconf->user,aconf->host,nrkreason); + return 0; + } + } + } + else if( (aconf = is_pklined(host,user,(unsigned long)ip)) ) + { + char *nrkreason; + + if( aconf->status & CONF_KILL ) + { + nrkreason = aconf->passwd ? aconf->passwd : ""; + sendto_one(sptr, + ":%s NOTICE %s :[%s@%s] already K-lined by [%s@%s] - %s", + me.name, + parv[0], + user,host, + aconf->user,aconf->host,nrkreason); return 0; } } @@ -788,7 +760,15 @@ rehashed = YES; dline_in_progress = NO; nextping = CurrentTime; - sendto_realops("%s added temporary %d min. K-Line for [%s@%s] [%s]", + if (oper_reason != NULL) + sendto_realops("%s added temporary %d min. K-Line for [%s@%s] [%s|%s]", + parv[0], + temporary_kline_time, + user, + host, + reason, oper_reason); + else + sendto_realops("%s added temporary %d min. K-Line for [%s@%s] [%s]", parv[0], temporary_kline_time, user, @@ -812,15 +792,26 @@ else add_mtrie_conf_entry(aconf,CONF_KILL); - sendto_realops("%s added K-Line for [%s@%s] [%s]", - sptr->name, - user, - host, - reason); - - - log(L_TRACE, "%s added K-Line for [%s@%s] [%s|%s]", - sptr->name, user, host, reason, oper_reason ? oper_reason : ""); + if (oper_reason != NULL) + { + sendto_realops("%s added K-Line for [%s@%s] [%s|%s]", + sptr->name, + user, + host, + reason, oper_reason); + log(L_TRACE, "%s added K-Line for [%s@%s] [%s|%s]", + sptr->name, user, host, reason, oper_reason); + } + else + { + sendto_realops("%s added K-Line for [%s@%s] [%s]", + sptr->name, + user, + host, + reason); + log(L_TRACE, "%s added K-Line for [%s@%s] [%s]", + sptr->name, user, host, reason); + } kconf = get_conf_name(KLINE_TYPE); @@ -845,12 +836,10 @@ DupString(pptr->host, host); DupString(pptr->reason, reason); DupString(pptr->when, current_date); - -#ifdef SLAVE_SERVERS - pptr->rcptr = rcptr; -#else - pptr->rcptr = NULL; -#endif + if (oper_reason != NULL) + DupString(pptr->oper_reason, oper_reason); + else + pptr->oper_reason = NULL; /* Yes this is needed */ sendto_one(sptr, ":%s NOTICE %s :Added K-Line [%s@%s] (config file write delayed)", @@ -875,25 +864,13 @@ /* * Write kline to configuration file */ -#ifdef SLAVE_SERVERS - WriteKline(kconf, - sptr, - rcptr, - user, - host, - reason, - oper_reason, - current_date); -#else WriteKline(kconf, sptr, - NULL, user, host, reason, oper_reason, current_date); -#endif rehashed = YES; dline_in_progress = NO; @@ -901,6 +878,7 @@ return 0; } /* m_kline() */ +#if 0 /* * isnumber() * @@ -933,6 +911,7 @@ result = 1; return(result); } +#endif /* * cluster() @@ -1076,6 +1055,9 @@ char buffer[1024]; const char* current_date; const char *dconf; + char *argv; + int temp_dline_time = 0; + time_t temporary_dline_time_seconds=0; if (!MyClient(sptr) || !IsAnOper(sptr)) { @@ -1096,7 +1078,27 @@ return 0; } - host = parv[1]; + argv = parv[1]; + + if((temp_dline_time = oper_time(argv))) + { + if(parc < 3) + { + sendto_one(sptr, form_str(ERR_NEEDMOREPARAMS), + me.name, parv[0], "DLINE"); + return 0; + } + + /* maxed at 7 days */ + if(temp_dline_time > (24*60*7)) + temp_dline_time = (24*60*7); + + temporary_dline_time_seconds = (time_t)temp_dline_time * (time_t)60; + argv = parv[2]; + parc--; + } + + host = argv; strncpy_irc(cidr_form_host, host, 32); cidr_form_host[32] = '\0'; @@ -1112,7 +1114,7 @@ if(!is_address(host,&ip_host,&ip_mask)) { - if (!(acptr = find_chasing(sptr, parv[1], NULL))) + if (!(acptr = find_chasing(sptr, argv, NULL))) return 0; if(!acptr->user) @@ -1181,9 +1183,14 @@ } + if(temp_dline_time) + argv = parv[3]; + else + argv = parv[2]; + if (parc > 2) /* host :reason */ { - if(strchr(parv[2], ':')) + if(strchr(argv, ':')) { sendto_one(sptr, ":%s NOTICE %s :Invalid character ':' in comment", @@ -1191,7 +1198,7 @@ return 0; } - if(strchr(parv[2], '#')) + if(strchr(argv, '#')) { sendto_one(sptr, ":%s NOTICE %s :Invalid character '#' in comment", @@ -1199,8 +1206,8 @@ return 0; } - if(*parv[2]) - reason = parv[2]; + if(*argv) + reason = argv; else reason = "No reason"; } @@ -1245,6 +1252,19 @@ } + /* allow permanent dlines to overwrite temp dlines.. */ + if((aconf = find_tdline(ip_host)) && temp_dline_time) + { + char *nrkreason; + + nrkreason = aconf->passwd ? aconf->passwd : ""; + + sendto_one(sptr, ":%s NOTICE %s :[%s] already D-lined by [%s] - %s", + me.name, parv[0], host, aconf->host, nrkreason); + + return 0; + } + current_date = smalldate((time_t) 0); ircsprintf(buffer, "%s (%s)",reason,current_date); @@ -1256,17 +1276,50 @@ aconf->ip = ip_host; aconf->ip_mask = ip_mask; + + if(temp_dline_time) + { + ircsprintf(buffer, "Temporary D-line %d min - %s (%s)", + temp_dline_time, reason, current_date); - add_Dline(aconf); + aconf->hold = CurrentTime + temporary_dline_time_seconds; - sendto_realops("%s added D-Line for [%s] [%s]", - sptr->name, - host, - reason); + add_temp_dline(aconf); + rehashed = YES; + dline_in_progress = YES; - log(L_TRACE, "%s added D-Line for [%s] [%s|%s]", - sptr->name, host, reason, - oper_reason ? oper_reason : "" ); + nextping = CurrentTime; + + if (oper_reason != NULL) + sendto_realops("%s added temporary %d min. D-Line for [%s] [%s|%s]", + parv[0], temp_dline_time, host, reason, oper_reason); + else + sendto_realops("%s added temporary %d min. D-Line for [%s] [%s]", + parv[0], temp_dline_time, host, reason); + + return 0; + } + + add_Dline(aconf); + + if (oper_reason != NULL) + { + sendto_realops("%s added D-Line for [%s] [%s|%s]", + sptr->name, + host, + reason, oper_reason); + log(L_TRACE, "%s added D-Line for [%s] [%s|%s]", + sptr->name, host, reason, oper_reason); + } + else + { + sendto_realops("%s added D-Line for [%s] [%s]", + sptr->name, + host, + reason); + log(L_TRACE, "%s added D-Line for [%s] [%s]", + sptr->name, host, reason); + } dconf = get_conf_name(DLINE_TYPE); @@ -1287,12 +1340,13 @@ */ pptr->type = DLINE_TYPE; pptr->sptr = sptr; - pptr->rcptr = NULL; pptr->user = NULL; pptr->host = strdup(host); pptr->reason = strdup(reason); if (oper_reason != NULL) pptr->oper_reason = strdup(oper_reason); + else + pptr->oper_reason = NULL; pptr->when = strdup(current_date); sendto_one(sptr, @@ -1335,3 +1389,193 @@ nextping = CurrentTime; return 0; } /* m_dline() */ + +#ifdef XLINE_COMMAND + +/* XLINE addition patch - Not guaranteed! + * -Hwy + */ + +int +m_xline(aClient *cptr, aClient *sptr, int parc, char *parv[]) + +{ + char *host, *reason; + aClient *acptr; + aConfItem *aconf; + char buffer[1024]; + const char* current_date; + const char *dconf; + + if (!MyClient(sptr) || !IsAnOper(sptr)) + { + sendto_one(sptr, form_str(ERR_NOPRIVILEGES), me.name, parv[0]); + return 0; + } + + if(!IsSetOperK(sptr)) + { + sendto_one(sptr,":%s NOTICE %s :You have no K flag",me.name,parv[0]); + return 0; + } + + if ( parc < 2 ) + { + sendto_one(sptr, form_str(ERR_NEEDMOREPARAMS), + me.name, parv[0], "XLINE"); + return 0; + } + + host = parv[1]; + + if (parc > 2) /* host :reason */ + { + if(strchr(parv[2], ':')) + { + sendto_one(sptr, + ":%s NOTICE %s :Invalid character ':' in comment", + me.name, parv[0]); + return 0; + } + + if(strchr(parv[2], '#')) + { + sendto_one(sptr, + ":%s NOTICE %s :Invalid character '#' in comment", + me.name, parv[0]); + return 0; + } + + if(*parv[2]) + reason = parv[2]; + else + reason = "No reason"; + } + else + reason = "No reason"; + + current_date = smalldate((time_t) 0); + + ircsprintf(buffer, "%s (%s)",reason,current_date); + + aconf = make_conf(); + aconf->status = CONF_XLINE; + aconf->user = NULL; + DupString(aconf->host,host); + DupString(aconf->name,host); + DupString(aconf->passwd,buffer); + aconf->port = GlobalSetOptions.xlinetype; + aconf->next = x_conf; + x_conf = aconf; + + sendto_realops("%s added X-Line for [%s] [%s] [%d]", + sptr->name, + host, + reason, aconf->port); + + log(L_TRACE, "%s added X-Line for [%s] [%s] [%d]", + sptr->name, host, reason, aconf->port); + + dconf = get_conf_name(XLINE_TYPE); + + /* + * Check if the conf file is locked - if so, add the dline + * to our pending dline list, to be written later, if not, + * allow this xline to be written, and write out all other + * pending lines as well + */ + if (LockedFile(dconf)) + { + aPendingLine *pptr; + + pptr = AddPending(); + + /* + * Now fill in the fields + */ + pptr->type = XLINE_TYPE; + pptr->sptr = sptr; + pptr->user = (char *) NULL; + pptr->host = strdup(host); + pptr->reason = strdup(reason); + pptr->when = strdup(current_date); + + sendto_one(sptr, + ":%s NOTICE %s :Added X-Line [%s] (config file write delayed)", + me.name, + sptr->name, + host); + + return 0; + } + else if (PendingLines) + WritePendingLines(dconf); + + sendto_one(sptr, + ":%s NOTICE %s :Added X-Line [%s] to %s", + me.name, + sptr->name, + host, + dconf ? dconf : "configuration file"); + /* + * Write xline to configuration file + */ + WriteXline(dconf, + sptr, + host, + reason, + current_date); + + return 0; +} /* m_xline() */ + +/* +WriteXline() + Write out an xline to the kline configuration file +*/ + +static void +WriteXline(const char *filename, aClient *sptr, + const char *host, const char *reason, const char *when) + +{ + char buffer[1024]; + int out; + + if (!filename) + return; + + if ((out = open(filename, O_RDWR|O_APPEND|O_CREAT, 0644)) == (-1)) + { + sendto_realops("Error opening %s: %s", + filename, + strerror(errno)); + return; + } + + fchmod(out, 0660); + + ircsprintf(buffer, + "#%s!%s@%s X'd: %s:%s (%s)\n", + sptr->name, + sptr->username, + sptr->host, + host, + reason, + when); + + if (safe_write(sptr, filename, out, buffer) == (-1)) + return; + + ircsprintf(buffer, "X:%s:%s (%s)::%d\n", + host, + reason, + when, GlobalSetOptions.xlinetype); + + if (safe_write(sptr, filename, out, buffer) == (-1)) + return; + + (void) close(out); +} /* WriteXline() */ + +#endif diff -uNrd ircd-hybrid-6.3.1.dist/src/m_locops.c ircd-hybrid-6.3.1/src/m_locops.c --- ircd-hybrid-6.3.1.dist/src/m_locops.c Mon Aug 9 22:46:24 1999 +++ ircd-hybrid-6.3.1/src/m_locops.c Mon Apr 21 11:51:22 2003 @@ -98,57 +98,10 @@ int m_locops(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) { char *message = NULL; -#ifdef SLAVE_SERVERS - char *slave_oper; - struct Client *acptr; -#endif -#ifdef SLAVE_SERVERS - if(IsServer(sptr)) - { - if(!find_special_conf(sptr->name,CONF_ULINE)) - { - sendto_realops("received Unauthorized locops from %s",sptr->name); - return 0; - } - - if(parc > 2) - { - slave_oper = parv[1]; - - parc--; - parv++; - - if ((acptr = hash_find_client(slave_oper,(struct Client *)NULL))) - { - if(!IsPerson(acptr)) - return 0; - } - else - return 0; - - if(parv[1]) - { - message = parv[1]; - send_operwall(acptr, "SLOCOPS", message); - } - else - return 0; -#ifdef HUB - sendto_slaves(sptr,"LOCOPS",slave_oper,parc,parv); -#endif - return 0; - } - } - else - { - message = parc > 1 ? parv[1] : NULL; - } -#else if(IsServer(sptr)) return 0; message = parc > 1 ? parv[1] : NULL; -#endif if (EmptyString(message)) { @@ -159,11 +112,7 @@ if(MyConnect(sptr) && IsAnOper(sptr)) { - -#ifdef SLAVE_SERVERS - sendto_slaves(NULL,"LOCOPS",sptr->name,parc,parv); -#endif - send_operwall(sptr, "LOCOPS", message); + send_operwall(sptr, "LOCOPS", message, 1); } else { diff -uNrd ircd-hybrid-6.3.1.dist/src/m_ltrace.c ircd-hybrid-6.3.1/src/m_ltrace.c --- ircd-hybrid-6.3.1.dist/src/m_ltrace.c Sat Dec 8 00:10:22 2001 +++ ircd-hybrid-6.3.1/src/m_ltrace.c Sat Apr 19 21:06:45 2003 @@ -153,8 +153,7 @@ } - if(MyClient(sptr)) - sendto_realops_flags(FLAGS_SPY, "ltrace requested by %s (%s@%s) [%s]", + sendto_realops_flags(FLAGS_SPY, "ltrace requested by %s (%s@%s) [%s]", sptr->name, sptr->username, sptr->host, sptr->user->server); @@ -189,7 +188,16 @@ sendto_one(sptr, form_str(RPL_TRACEOPERATOR), me.name, parv[0], c_class, name, - IsAnOper(sptr)?ip:(IsIPHidden(acptr)?"255.255.255.255":ip), +#if (defined SERVERHIDE) || (defined HIDE_SERVERS_IPS) + "255.255.255.255", +#else +#ifdef HIDE_SPOOF_IPS + IsIPSpoof(acptr) ? "255.255.255.255" : ip, +#else + IsAnOper(sptr) ? ip : + (IsIPSpoof(acptr) ? "255.255.255.255" : ip), +#endif +#endif now - acptr->lasttime, (acptr->user)?(now - acptr->user->last):0); } @@ -271,7 +279,16 @@ form_str(RPL_TRACEOPERATOR), me.name, parv[0], c_class, name, - IsAnOper(sptr)?ip:(IsIPHidden(acptr)?"255.255.255.255":ip), +#if (defined SERVERHIDE) || (defined HIDE_SERVERS_IPS) + "255.255.255.255", +#else +#ifdef HIDE_SPOOF_IPS + IsIPSpoof(acptr) ? "255.255.255.255" : ip, +#else + IsAnOper(sptr) ? ip : + (IsIPSpoof(acptr) ? "255.255.255.255" : ip), +#endif +#endif now - acptr->lasttime, (acptr->user)?(now - acptr->user->last):0); cnt++; diff -uNrd ircd-hybrid-6.3.1.dist/src/m_map.c ircd-hybrid-6.3.1/src/m_map.c --- ircd-hybrid-6.3.1.dist/src/m_map.c Wed Dec 31 19:00:00 1969 +++ ircd-hybrid-6.3.1/src/m_map.c Sat May 3 10:19:22 2003 @@ -0,0 +1,124 @@ +/************************************************************************ + * IRC - Internet Relay Chat, contrib/m_map.c + * Copyright (C) 1990 Jarkko Oikarinen and + * University of Oulu, Computing Center + * + * See file AUTHORS in IRC package for additional names of + * the programmers. + * + * 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 1, 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. + * + * $Id$ + */ + +#include +#include "ircd.h" +#include "config.h" +#include "client.h" +#include "numeric.h" +#include "send.h" +#include "s_conf.h" +#include "m_commands.h" +#include +#include + +#define USER_COL 50 /* display | Users: %d at col 50 */ + +static char buf[BUFSIZE]; + +static void dump_map(struct Client *cptr,struct Client *root_p, char *pbuf); + +/* m_map +** parv[0] = sender prefix +*/ + +int m_map(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) +{ +#ifdef SERVERHIDE + if (!IsAnOper(cptr)) + { + sendto_one(cptr, form_str(ERR_NOPRIVILEGES), me.name, parv[0]); + return; + } +#endif + dump_map(cptr,&me,buf); + sendto_one(cptr, form_str(RPL_MAPEND), me.name, cptr->name); + sendto_realops_flags(FLAGS_SPY, "MAP requested by %s (%s@%s)", + sptr->name, sptr->username, sptr->host); + return 0; +} + +/* +** dump_map +** dumps server map, called recursively. +*/ +static void dump_map(struct Client *cptr,struct Client *root_p, char *pbuf) +{ + int cnt = 0, i = 0, len; + struct Client *server_p; + + *pbuf= '\0'; + + strncat(pbuf,root_p->name,BUFSIZE - ((size_t) pbuf - (size_t) buf)); + len = strlen(buf); + buf[len] = ' '; + + if (len < USER_COL) + { + for (i = len+1; i < USER_COL; i++) + { + buf[i] = '-'; + } + } + + snprintf(buf + USER_COL, BUFSIZE - USER_COL, + " | Users: %5d (%4.1f%%)", root_p->serv->usercnt, + 100 * (float) root_p->serv->usercnt / (float) Count.total); + + sendto_one(cptr, form_str(RPL_MAP),me.name,cptr->name,buf); + + if ((server_p = root_p->serv->servers)) + { + for (; server_p; server_p = server_p->lnext) + { + cnt++; + } + + if (cnt) + { + if (pbuf > buf + 3) + { + pbuf[-2] = ' '; + if (pbuf[-3] == '`') + pbuf[-3] = ' '; + } + } + } + for (i = 1,server_p = root_p->serv->servers; server_p; server_p=server_p->lnext) + { + *pbuf = ' '; + if (i < cnt) + *(pbuf + 1) = '|'; + else + *(pbuf + 1) = '`'; + + *(pbuf + 2) = '-'; + *(pbuf + 3) = ' '; + dump_map(cptr,server_p,pbuf+4); + + i++; + } +} + diff -uNrd ircd-hybrid-6.3.1.dist/src/m_message.c ircd-hybrid-6.3.1/src/m_message.c --- ircd-hybrid-6.3.1.dist/src/m_message.c Sat Dec 22 19:06:14 2001 +++ ircd-hybrid-6.3.1/src/m_message.c Sat Apr 19 21:06:45 2003 @@ -554,3 +554,31 @@ { return m_message(cptr, sptr, parc, parv, 1); } + +#ifdef WALLCHOPS +/* +** m_wallchops +** parv[0] = sender prefix +** parv[1] = receiver list +** parv[2] = notice text +*/ + +int m_wallchops(struct Client *cptr, + struct Client *sptr, + int parc, + char *parv[]) +{ + char buf[CHANNELLEN + 2]; + + if (parc > 1) + { + ircsprintf(buf, "@%s", parv[1]); + parv[1] = buf; + } + /* If the parc is less than or equal to 1, let m_message take care of + * reporting it to the user + */ + return m_message(cptr, sptr, parc, parv, 1); +} +#endif + diff -uNrd ircd-hybrid-6.3.1.dist/src/m_oper.c ircd-hybrid-6.3.1/src/m_oper.c --- ircd-hybrid-6.3.1.dist/src/m_oper.c Sat Dec 8 02:06:13 2001 +++ ircd-hybrid-6.3.1/src/m_oper.c Mon Apr 21 16:02:11 2003 @@ -231,14 +231,13 @@ } } + if (IsSetOperAdmin(sptr)) + sptr->umodes |= FLAGS_ADMIN; + fdlist_add(sptr->fd, FDL_OPER | FDL_BUSY); -#ifdef CUSTOM_ERR - sendto_ops("%s (%s@%s) has just acquired the personality of a petty megalomaniacal tyrant [IRC(%c)p]", parv[0], -#else sendto_ops("%s (%s@%s) is now operator (%c)", parv[0], -#endif /* CUSTOM_ERR */ sptr->username, sptr->host, - IsOper(sptr) ? 'O' : 'o'); + oper_type_char(sptr)); send_umode_out(cptr, sptr, old); sendto_one(sptr, form_str(RPL_YOUREOPER), me.name, parv[0]); sendto_one(sptr, ":%s NOTICE %s :*** Oper privs are %s",me.name,parv[0], diff -uNrd ircd-hybrid-6.3.1.dist/src/m_operwall.c ircd-hybrid-6.3.1/src/m_operwall.c --- ircd-hybrid-6.3.1.dist/src/m_operwall.c Wed Oct 17 11:13:31 2001 +++ ircd-hybrid-6.3.1/src/m_operwall.c Sat Apr 19 21:06:45 2003 @@ -118,7 +118,7 @@ sendto_serv_butone(IsServer(cptr) ? cptr : NULL, ":%s OPERWALL :%s", parv[0], message); - send_operwall(sptr, "OPERWALL", message); + send_operwall(sptr, "OPERWALL", message, 0); return 0; } diff -uNrd ircd-hybrid-6.3.1.dist/src/m_pong.c ircd-hybrid-6.3.1/src/m_pong.c --- ircd-hybrid-6.3.1.dist/src/m_pong.c Thu Nov 29 01:44:29 2001 +++ ircd-hybrid-6.3.1/src/m_pong.c Sat Apr 19 21:06:45 2003 @@ -28,6 +28,7 @@ #include "numeric.h" #include "send.h" #include "channel.h" +#include "s_stats.h" #include "irc_string.h" #ifdef DEBUGMODE @@ -139,6 +140,35 @@ if (MyConnect(sptr)) { sptr->flags &= ~FLAGS_PINGSENT; +#ifdef ANTI_IP_SPOOF + /* ANTI_IP_SPOOF delays the registration of a local client until after we + have received a response from a PING containing a random integer. When + we receive the resulting PONG, then we register the client. + */ + + if(MyConnect(sptr) && !IsRegisteredUser(sptr) && sptr->random_ping) { + unsigned int received_random_ping; + received_random_ping = strtoul(origin, (char **)NULL, 10); + + if(received_random_ping) { + /* Ensure that aClient has a user and a nick (redundant) */ + if((sptr->user) && (sptr->name[0])) { + if(received_random_ping == sptr->random_ping) { + char buf[USERLEN + 1]; + strncpy_irc(buf, sptr->username, USERLEN); + buf[USERLEN] = '\0'; + + sptr->flags2 |= FLAGS2_GOT_ANTI_SPOOF_PING; + register_user(cptr, sptr, sptr->name, buf); + return 0; + } else { + ServerStats->is_ipspoof++; + return exit_client(cptr,sptr,&me,"Wrong random PONG response."); + } + } + } + } +#endif #ifdef NEED_SPLITCODE #ifdef SPLIT_PONG if (IsServer(sptr)) diff -uNrd ircd-hybrid-6.3.1.dist/src/m_quit.c ircd-hybrid-6.3.1/src/m_quit.c --- ircd-hybrid-6.3.1.dist/src/m_quit.c Sat Dec 8 02:06:14 2001 +++ ircd-hybrid-6.3.1/src/m_quit.c Fri May 2 11:38:08 2003 @@ -29,6 +29,7 @@ #include "s_serv.h" #include "send.h" #include +#include /* * m_functions execute protocol messages on this server: @@ -98,10 +99,20 @@ char *parv[]) { char *comment = (parc > 1 && parv[1]) ? parv[1] : cptr->name; +#ifdef CLIENT_EXIT + char reason[TOPICLEN]; +#endif sptr->flags |= FLAGS_NORMALEX; if (strlen(comment) > (size_t) TOPICLEN) comment[TOPICLEN] = '\0'; + +#ifdef CLIENT_EXIT + if (!IsServer(sptr) && MyConnect(sptr)) { + snprintf(reason, TOPICLEN, "Quit: %s", comment); + comment = reason; + } +#endif #ifdef ANTI_SPAM_EXIT_MESSAGE if( !IsServer(sptr) && MyConnect(sptr) && diff -uNrd ircd-hybrid-6.3.1.dist/src/m_rehash.c ircd-hybrid-6.3.1/src/m_rehash.c --- ircd-hybrid-6.3.1.dist/src/m_rehash.c Thu Dec 6 23:51:34 2001 +++ ircd-hybrid-6.3.1/src/m_rehash.c Mon Apr 21 16:03:15 2003 @@ -117,11 +117,7 @@ if (irccmp(parv[1],"DNS") == 0) { sendto_one(sptr, form_str(RPL_REHASHING), me.name, parv[0], "DNS"); -#ifdef CUSTOM_ERR - sendto_ops("%s is rehashing DNS while whistling innocently", -#else sendto_ops("%s is rehashing DNS", -#endif parv[0]); restart_resolver(); /* re-read /etc/resolv.conf AGAIN? and close/re-open res socket */ @@ -137,12 +133,7 @@ } sendto_one(sptr, form_str(RPL_REHASHING), me.name, parv[0], "temp klines"); flush_temp_klines(); -#ifdef CUSTOM_ERR - sendto_ops("%s is clearing temp klines while whistling innocently", -#else - sendto_ops("%s is clearing temp klines", -#endif - parv[0]); + sendto_ops("%s is clearing temp klines", parv[0]); found = YES; } #ifdef GLINES @@ -158,12 +149,7 @@ sendto_one(sptr, form_str(RPL_REHASHING), me.name, parv[0], "g-lines"); flush_glines(); -#ifdef CUSTOM_ERR - sendto_ops("%s is clearing G-lines while whistling innocently", -#else - sendto_ops("%s is clearing G-lines", -#endif - parv[0]); + sendto_ops("%s is clearing G-lines", parv[0]); found = YES; } #endif @@ -171,12 +157,7 @@ { sendto_one(sptr, form_str(RPL_REHASHING), me.name, parv[0], "garbage collecting"); block_garbage_collect(); -#ifdef CUSTOM_ERR - sendto_ops("%s is garbage collecting while whistling innocently", -#else - sendto_ops("%s is garbage collecting", -#endif - parv[0]); + sendto_ops("%s is garbage collecting", parv[0]); found = YES; } else if(irccmp(parv[1],"MOTD") == 0) @@ -208,12 +189,7 @@ sendto_one(sptr, form_str(RPL_REHASHING), me.name, parv[0], ConfigFileEntry.configfile); /* this does a full rehash right now, so report it as such */ -#ifdef CUSTOM_ERR - sendto_ops("%s is rehashing dlines from server config file while whistling innocently", -#else - sendto_ops("%s is rehashing dlines from server config file", -#endif - parv[0]); + sendto_ops("%s is rehashing dlines from server config file", parv[0]); log(L_NOTICE, "REHASH From %s\n", get_client_name(sptr, HIDE_IP)); dline_in_progress = 1; return rehash(cptr, sptr, 0); @@ -228,11 +204,12 @@ { #ifdef GLINES sendto_one(sptr, ":%s NOTICE %s :Rehash one of: DNS, TKLINES, GLINES, GC, HELP, MOTD, OMOTD, DUMP, DLINES", - me.name, sptr->name); + me.name, sptr->name); #else - sendto_one(sptr, ":%s NOTICE %s :Rehash one of: DNS, TKLINES, GC, HELP, MOTD, OMOTD, DUMP, DLINES", - me.name, sptr->name); + sendto_one(sptr, ":%s NOTICE %s :Rehash one of: DNS, TKLINES, GC, HELP, MOTD, OMOTD, DUMP, DLINES", + me.name, sptr->name); #endif + return(0); } } @@ -240,12 +217,7 @@ { sendto_one(sptr, form_str(RPL_REHASHING), me.name, parv[0], ConfigFileEntry.configfile); -#ifdef CUSTOM_ERR - sendto_ops("%s is rehashing server config file while whistling innocently", -#else - sendto_ops("%s is rehashing server config file", -#endif - parv[0]); + sendto_ops("%s is rehashing server config file", parv[0]); log(L_NOTICE, "REHASH From %s\n", get_client_name(sptr, SHOW_IP)); return rehash(cptr, sptr, 0); } diff -uNrd ircd-hybrid-6.3.1.dist/src/m_server.c ircd-hybrid-6.3.1/src/m_server.c --- ircd-hybrid-6.3.1.dist/src/m_server.c Sun Jun 17 19:51:21 2001 +++ ircd-hybrid-6.3.1/src/m_server.c Sat Apr 19 21:06:45 2003 @@ -437,8 +437,10 @@ } - sendto_realops_flags(FLAGS_EXTERNAL, "Server %s being introduced by %s", - acptr->name, sptr->name); + sendto_realops_flags(FLAGS_EXTERNAL, + "Server %s being introduced by %s (%d %s)", + acptr->name, sptr->name, acptr->hopcount, + acptr->info); return 0; } diff -uNrd ircd-hybrid-6.3.1.dist/src/m_set.c ircd-hybrid-6.3.1/src/m_set.c --- ircd-hybrid-6.3.1.dist/src/m_set.c Thu Dec 13 18:50:45 2001 +++ ircd-hybrid-6.3.1/src/m_set.c Sat Apr 19 21:06:45 2003 @@ -116,6 +116,10 @@ * to the set table, you must increase TOKEN_BAD so that it is directly * after the last valid entry. * -Hwy + * + * +fr extension... + * CLONENUM = 14, CLONEPERIOD = 15, MAXTKTIME = 16, + * XLINETYPE = 17, TOKEN_BAD = 18 */ #define TOKEN_MAX 0 @@ -132,7 +136,11 @@ #define TOKEN_SPAMNUM 11 #define TOKEN_SPAMTIME 12 #define TOKEN_LOG 13 -#define TOKEN_BAD 14 +#define TOKEN_CLONENUM 14 +#define TOKEN_CLONEPERIOD 15 +#define TOKEN_MAXTKTIME 16 +#define TOKEN_XLINETYPE 17 +#define TOKEN_BAD 18 static char *set_token_table[] = { "MAX", @@ -149,6 +157,10 @@ "SPAMNUM", "SPAMTIME", "LOG", + "CLONENUM", + "CLONEPERIOD", + "MAXTKTIME", + "XLINETYPE", NULL }; @@ -579,6 +591,123 @@ return 0; break; +#ifdef CHECK_CLONE + case TOKEN_CLONENUM: + if(parc > 2) + { + int newval = atoi(parv[2]); + + if(newval < 1) + { + sendto_one(sptr, ":%s NOTICE %s :CLONENUM must be >= 1", + me.name, parv[0]); + return 0; + } + sendto_realops("%s has changed CLONENUM to %i", + parv[0], newval); + GlobalSetOptions.clone_num = newval; + } + else + { + sendto_one(sptr, ":%s NOTICE %s :CLONENUM is currently %i", + me.name, + parv[0], + GlobalSetOptions.clone_num); + } + return 0; + break; + case TOKEN_CLONEPERIOD: + if(parc > 2) + { + int newval = atoi(parv[2]); + + if(newval < 1) + { + sendto_one(sptr, ":%s NOTICE %s :CLONEPERIOD must be >= 1", + me.name, parv[0]); + return 0; + } + sendto_realops("%s has changed CLONEPERIOD to %i", + parv[0], newval); + GlobalSetOptions.clone_period = newval; + } + else + { + sendto_one(sptr, ":%s NOTICE %s :CLONEPERIOD is currently %i", + me.name, + parv[0], + GlobalSetOptions.clone_period); + } + return 0; + break; +#else + case TOKEN_CLONENUM: + break; + case TOKEN_CLONEPERIOD: + break; +#endif /* CHECK_CLONE */ + + case TOKEN_MAXTKTIME: + if(parc > 2) + { + int newval = atoi(parv[2]); + + if(newval <= 0) + { + sendto_one(sptr, ":%s NOTICE %s :MAXTKTIME must be > 0", + me.name, parv[0]); + return 0; + } + MAXTKTIME = newval; + sendto_realops("%s has changed MAXTKTIME to %i", + parv[0], MAXTKTIME); + } + else + { + sendto_one(sptr, ":%s NOTICE %s :MAXTKTIME is currently %i", + me.name, parv[0], MAXTKTIME); + } + return 0; + break; + + case TOKEN_XLINETYPE: +#ifdef XLINE_COMMAND + if(parc > 2) + { + if(!irccmp(parv[2],"WARN")) + { + sendto_realops("%s has changed XLINETYPE to WARN", parv[0]); + GlobalSetOptions.xlinetype = 0; + } + else if (!irccmp(parv[2],"REJECT")) + { + sendto_realops("%s has changed XLINETYPE to REJECT", parv[0]); + GlobalSetOptions.xlinetype = 1; + } + else if (!irccmp(parv[2],"SILENT")) + { + sendto_realops("%s has changed XLINETYPE to SILENT", parv[0]); + GlobalSetOptions.xlinetype = 2; + } + else + { + sendto_one(sptr, ":%s NOTICE %s :XLINETYPE settings: WARN, " + "REJECT, SILENT", me.name, parv[0]); + } + } + else + { + sendto_one(sptr, ":%s NOTICE %s :XLINETYPE is currently %s", + me.name, parv[0], + (GlobalSetOptions.xlinetype == 0) ? "WARN" : + (GlobalSetOptions.xlinetype == 1) ? "REJECT" : + "SILENT"); + } + return 0; +#endif + break; + + default: case TOKEN_BAD: break; @@ -606,6 +735,16 @@ sendto_one(sptr, ":%s NOTICE %s :Options: IDLETIME", me.name, parv[0]); #endif +#ifdef CHECK_CLONE + sendto_one(sptr, ":%s NOTICE %s :Options: CLONENUM CLONEPERIOD", + me.name, parv[0]); +#endif +#ifdef XLINE_COMMAND + sendto_one(sptr, ":%s NOTICE %s :Options: XLINETYPE", + me.name, parv[0]); +#endif + sendto_one(sptr, ":%s NOTICE %s :Options: MAXTKTIME", + me.name, parv[0]); sendto_one(sptr, ":%s NOTICE %s :Options: LOG", me.name, parv[0]); return 0; diff -uNrd ircd-hybrid-6.3.1.dist/src/m_stats.c ircd-hybrid-6.3.1/src/m_stats.c --- ircd-hybrid-6.3.1.dist/src/m_stats.c Wed Dec 19 18:24:46 2001 +++ ircd-hybrid-6.3.1/src/m_stats.c Tue Apr 22 09:35:17 2003 @@ -273,14 +273,17 @@ valid_stats++; break; case 'C' : case 'c' : -#ifdef SERVERHIDE +#if defined(SERVERHIDE) || defined(C_LINES_OPER_ONLY) if (!IsAnOper(sptr)) { ignore_request++; valid_stats++; +#ifdef STATS_IGNORED_NOTICE + sendto_one(sptr, form_str(ERR_STATSIGNORED), me.name, parv[0], + statcmd); +#endif break; } - else #endif report_configured_links(sptr, CONF_CONNECT_SERVER|CONF_NOCONNECT_SERVER); valid_stats++; @@ -293,6 +296,7 @@ break; } report_dlines(sptr); + report_temp_dlines(sptr); valid_stats++; break; @@ -312,6 +316,10 @@ { ignore_request++; valid_stats++; +#ifdef STATS_IGNORED_NOTICE + sendto_one(sptr, form_str(ERR_STATSIGNORED), me.name, parv[0], + statcmd); +#endif break; } #ifdef GLINES @@ -329,9 +337,12 @@ { ignore_request++; valid_stats++; +#ifdef STATS_IGNORED_NOTICE + sendto_one(sptr, form_str(ERR_STATSIGNORED), me.name, parv[0], + statcmd); +#endif break; } - else #endif report_configured_links(sptr, CONF_HUB|CONF_LEAF); valid_stats++; @@ -343,6 +354,10 @@ { ignore_request++; valid_stats++; +#ifdef STATS_IGNORED_NOTICE + sendto_one(sptr, form_str(ERR_STATSIGNORED), me.name, parv[0], + statcmd); +#endif break; } #endif /* I_LINES_OPER_ONLY */ @@ -356,6 +371,10 @@ { ignore_request++; valid_stats++; +#ifdef STATS_IGNORED_NOTICE + sendto_one(sptr, form_str(ERR_STATSIGNORED), me.name, parv[0], + statcmd); +#endif break; } #endif /* K_LINES_OPER_ONLY */ @@ -369,6 +388,10 @@ { ignore_request++; valid_stats++; +#ifdef STATS_IGNORED_NOTICE + sendto_one(sptr, form_str(ERR_STATSIGNORED), me.name, parv[0], + statcmd); +#endif break; } #endif /* K_LINES_OPER_ONLY */ @@ -396,6 +419,10 @@ { ignore_request++; valid_stats++; +#ifdef STATS_IGNORED_NOTICE + sendto_one(sptr, form_str(ERR_STATSIGNORED), me.name, parv[0], + statcmd); +#endif break; } #endif /* O_LINES_OPER_ONLY */ @@ -409,6 +436,10 @@ { ignore_request++; valid_stats++; +#ifdef STATS_IGNORED_NOTICE + sendto_one(sptr, form_str(ERR_STATSIGNORED), me.name, parv[0], + statcmd); +#endif break; } #endif /* P_LINES_OPER_ONLY */ @@ -427,6 +458,10 @@ { ignore_request++; valid_stats++; +#ifdef STATS_IGNORED_NOTICE + sendto_one(sptr, form_str(ERR_STATSIGNORED), me.name, parv[0], + statcmd); +#endif break; } report_juped_channels(sptr); @@ -449,6 +484,10 @@ { ignore_request++; valid_stats++; +#ifdef STATS_IGNORED_NOTICE + sendto_one(sptr, form_str(ERR_STATSIGNORED), me.name, parv[0], + statcmd); +#endif break; } send_usage(sptr,parv[0]); @@ -473,19 +512,6 @@ valid_stats++; break; - case 'U' : -#ifdef U_LINES_OPER_ONLY - if (!IsAnOper(sptr)) - { - ignore_request++; - valid_stats++; - break; - } -#endif /* U_LINES_OPER_ONLY */ - report_specials(sptr,CONF_ULINE,RPL_STATSULINE); - valid_stats++; - break; - case 'u' : { time_t now; @@ -505,6 +531,10 @@ { ignore_request++; valid_stats++; +#ifdef STATS_IGNORED_NOTICE + sendto_one(sptr, form_str(ERR_STATSIGNORED), me.name, parv[0], + statcmd); +#endif break; } show_servers(sptr); @@ -517,7 +547,14 @@ report_specials(sptr,CONF_XLINE,RPL_STATSXLINE); valid_stats++; } - break;; +#ifdef STATS_IGNORED_NOTICE + else + { + sendto_one(sptr, form_str(ERR_STATSIGNORED), me.name, parv[0], + statcmd); + } +#endif + break; case 'Y' : case 'y' : if(IsAnOper(sptr)) @@ -525,6 +562,13 @@ report_classes(sptr); valid_stats++; } +#ifdef STATS_IGNORED_NOTICE + else + { + sendto_one(sptr, form_str(ERR_STATSIGNORED), me.name, parv[0], + statcmd); + } +#endif break; case 'Z' : case 'z' : @@ -538,6 +582,18 @@ break; case '?': +#ifdef STATS_QMARK_OPER_ONLY + if (!IsAnOper(sptr)) + { + ignore_request++; + valid_stats++; +#ifdef STATS_IGNORED_NOTICE + sendto_one(sptr, form_str(ERR_STATSIGNORED), me.name, parv[0], + statcmd); +#endif + break; + } +#endif /* STATS_QMARK_OPER_ONLY */ serv_info(sptr, parv[0]); valid_stats++; break; diff -uNrd ircd-hybrid-6.3.1.dist/src/m_unkline.c ircd-hybrid-6.3.1/src/m_unkline.c --- ircd-hybrid-6.3.1.dist/src/m_unkline.c Sun Feb 17 00:58:13 2002 +++ ircd-hybrid-6.3.1/src/m_unkline.c Fri May 2 11:38:44 2003 @@ -36,6 +36,7 @@ #include "s_conf.h" #include "s_log.h" #include "s_misc.h" +#include "s_serv.h" #include "send.h" #include "struct.h" #ifdef GLINES @@ -50,7 +51,8 @@ extern ConfigFileEntryType ConfigFileEntry; /* defined in ircd.c */ static int flush_write(aClient *, FBFILE* , char *, char *); -static int remove_tkline_match(char *,char *, unsigned long); +int remove_tkline_match(char *,char *, unsigned long); +static int remove_tdline(unsigned long); /* ** m_unkline @@ -86,6 +88,17 @@ ircsprintf(temppath, "%s%s.tmp", ConfigFileEntry.dpath, ConfigFileEntry.klinefile); +#ifdef HUB + if(IsServer(cptr)) + { + if(parc == 4) + sendto_match_cap_servs(NULL, cptr, CAP_UNKLN, + ":%s UNKLINE %s %s %s", + parv[0], parv[1], parv[2], parv[3]); + return 0; + } +#endif + if (check_registered(sptr)) { return -1; @@ -383,7 +396,7 @@ * un-kline a temporary k-line. * */ -static int remove_tkline_match(char *host,char *user, unsigned long ip) +int remove_tkline_match(char *host,char *user, unsigned long ip) { aConfItem *kill_list_ptr; aConfItem *last_kill_ptr=(aConfItem *)NULL; @@ -442,6 +455,39 @@ } } +/* remove_tdline() + * + * inputs - ip of dline to remove + * output - + * side effects - dline, if found, is removed + */ +static int remove_tdline(unsigned long ip) +{ + struct ConfItem *ptr; + struct ConfItem *last_ptr = NULL; + + if(!temporary_dlines) + return NO; + + for(ptr = temporary_dlines; ptr; ptr = ptr->next) + { + if((ip & ptr->ip_mask) == ptr->ip) + { + if(last_ptr) + last_ptr->next = ptr->next; + else + temporary_dlines = ptr->next; + + free_conf(ptr); + return YES; + } + + last_ptr = ptr; + } + + return NO; +} + /* ** m_undline ** added May 28th 2000 by Toby Verrall @@ -505,6 +551,18 @@ return 0; } + if((remove_tdline(ip_host))) + { + sendto_one(sptr, ":%s NOTICE %s :Temporary D-line for [%s] is removed", + me.name, parv[0], cidr); + + sendto_ops("%s has removed the temporary D-line for: [%s]", parv[0], cidr); + log(L_NOTICE, "%s has removed temporary D-line for [%s]", parv[0], cidr); + + return 0; + } + + filename = get_conf_name(DLINE_TYPE); if( (in = fbopen(filename, "r")) == 0) diff -uNrd ircd-hybrid-6.3.1.dist/src/m_userhost.c ircd-hybrid-6.3.1/src/m_userhost.c --- ircd-hybrid-6.3.1.dist/src/m_userhost.c Tue Jan 2 00:48:18 2001 +++ ircd-hybrid-6.3.1/src/m_userhost.c Sat Apr 19 21:06:45 2003 @@ -130,6 +130,14 @@ if ((acptr = find_person(cn, NULL))) { +#ifdef REVERT_USERHOST + rl = ircsprintf(response, "%s%s=%c%s@%s ", + acptr->name, + IsAnOper(acptr) ? "*" : "", + (acptr->user->away) ? '-' : '+', + acptr->username, + acptr->host); +#else if (acptr == sptr) /* show real IP for USERHOST on yourself */ rl = ircsprintf(response, "%s%s=%c%s@%s ", acptr->name, @@ -144,6 +152,7 @@ (acptr->user->away) ? '-' : '+', acptr->username, acptr->host); +#endif if((rl + cur_len) < (BUFSIZE-10)) { diff -uNrd ircd-hybrid-6.3.1.dist/src/m_wallops.c ircd-hybrid-6.3.1/src/m_wallops.c --- ircd-hybrid-6.3.1.dist/src/m_wallops.c Wed Oct 17 11:13:31 2001 +++ ircd-hybrid-6.3.1/src/m_wallops.c Sat Apr 19 21:06:45 2003 @@ -120,7 +120,7 @@ if(!IsServer(sptr)) /* If source of message is not a server, i.e. oper */ { - send_operwall(sptr, "WALLOPS", message); + send_operwall(sptr, "WALLOPS", message, 0); sendto_serv_butone( IsServer(cptr) ? cptr : NULL, ":%s WALLOPS :%s", parv[0], message); } diff -uNrd ircd-hybrid-6.3.1.dist/src/m_whois.c ircd-hybrid-6.3.1/src/m_whois.c --- ircd-hybrid-6.3.1.dist/src/m_whois.c Wed Jun 6 02:56:34 2001 +++ ircd-hybrid-6.3.1/src/m_whois.c Thu May 8 13:26:33 2003 @@ -143,6 +143,7 @@ parv[1] = parv[2]; } +#if (WHOIS_WAIT > 0) if(!IsAnOper(sptr) && !MyConnect(sptr)) /* pace non local requests */ { if((last_used + WHOIS_WAIT) > CurrentTime) @@ -151,6 +152,10 @@ * request =might= increase sendq to be usable in a split hack * Sorry gang ;-( - Dianora */ +#ifdef WHOIS_TRYAGAIN + sendto_one(sptr, form_str(RPL_LOAD2HI), me.name, parv[0], + "WHOIS"); +#endif return 0; } else @@ -158,6 +163,7 @@ last_used = CurrentTime; } } +#endif /* Multiple whois from remote hosts, can be used * to flood a server off. One could argue that multiple whois on @@ -283,13 +289,35 @@ if (IsAnOper(acptr)) sendto_one(sptr, form_str(RPL_WHOISOPERATOR), me.name, parv[0], name); + #ifdef WHOIS_NOTICE +#ifdef REMOTE_WHOIS_NOTICE + if ((MyOper(acptr)) && ((acptr)->umodes & FLAGS_SPY) && + (IsPerson(sptr)) && (acptr != sptr)) + { + if (MyConnect(sptr)) + { + sendto_one(acptr, + ":%s NOTICE %s :*** Notice -- %s (%s@%s) is doing a /whois on you.", + me.name, acptr->name, parv[0], sptr->username, + sptr->host); + } + else + { + sendto_one(acptr, + ":%s NOTICE %s :*** Notice -- %s (%s@%s) [%s] is doing a remote /whois on you.", + me.name, acptr->name, parv[0], sptr->username, + sptr->host, sptr->user->server); + } + } +#else if ((MyOper(acptr)) && ((acptr)->umodes & FLAGS_SPY) && (MyConnect(sptr)) && (IsPerson(sptr)) && (acptr != sptr)) sendto_one(acptr, ":%s NOTICE %s :*** Notice -- %s (%s@%s) is doing a /whois on you.", me.name, acptr->name, parv[0], sptr->username, sptr->host); +#endif /* REMOTE_WHOIS_NOTICE */ #endif /* #ifdef WHOIS_NOTICE */ @@ -298,10 +326,21 @@ && IsAnOper(sptr) #endif && MyConnect(acptr))) + { + /* This test SHOULD be sufficient */ +#ifdef HIDE_SPOOF_IPS + if (!IsIPSpoof(acptr) || (sptr==acptr)) +#else + if (!IsIPSpoof(acptr) || (IsAnOper(sptr)) || (sptr==acptr)) +#endif + sendto_one(sptr, form_str(RPL_WHOISACTUALLY), + me.name, parv[0], name, + acptr->sockhost); sendto_one(sptr, form_str(RPL_WHOISIDLE), me.name, parv[0], name, CurrentTime - user->last, acptr->firsttime); + } sendto_one(sptr, form_str(RPL_ENDOFWHOIS), me.name, parv[0], parv[1]); return 0; /* continue; */ @@ -426,13 +465,35 @@ if (IsAnOper(acptr)) sendto_one(sptr, form_str(RPL_WHOISOPERATOR), me.name, parv[0], name); + #ifdef WHOIS_NOTICE +#ifdef REMOTE_WHOIS_NOTICE + if ((MyOper(acptr)) && ((acptr)->umodes & FLAGS_SPY) && + (IsPerson(sptr)) && (acptr != sptr)) + { + if (MyConnect(sptr)) + { + sendto_one(acptr, + ":%s NOTICE %s :*** Notice -- %s (%s@%s) is doing a /whois on you.", + me.name, acptr->name, parv[0], sptr->username, + sptr->host); + } + else + { + sendto_one(acptr, + ":%s NOTICE %s :*** Notice -- %s (%s@%s) [%s] is doing a remote /whois on you.", + me.name, acptr->name, parv[0], sptr->username, + sptr->host, sptr->user->server); + } + } +#else if ((MyOper(acptr)) && ((acptr)->umodes & FLAGS_SPY) && (MyConnect(sptr)) && (IsPerson(sptr)) && (acptr != sptr)) sendto_one(acptr, ":%s NOTICE %s :*** Notice -- %s (%s@%s) is doing a /whois on you.", me.name, acptr->name, parv[0], sptr->username, sptr->host); +#endif /* REMOTE_WHOIS_NOTICE */ #endif /* #ifdef WHOIS_NOTICE */ if ((acptr->user diff -uNrd ircd-hybrid-6.3.1.dist/src/messages.tab ircd-hybrid-6.3.1/src/messages.tab --- ircd-hybrid-6.3.1.dist/src/messages.tab Sat Dec 29 22:25:48 2001 +++ ircd-hybrid-6.3.1/src/messages.tab Mon May 5 08:57:59 2003 @@ -24,10 +24,10 @@ static char * replies[] = { /* 000 */ NULL, -/* 001 RPL_WELCOME, */ ":%s 001 %s :Welcome to the Internet Relay Network %s", +/* 001 RPL_WELCOME, */ ":%s 001 %s :Welcome to the %s Internet Relay Chat Network %s!%s@%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 oOiwszcrkfydnxb biklmnopstve", +/* 004 RPL_MYINFO, */ ":%s 004 %s %s %s oOiwszcrkfydnxbluja biklmnopstve", /* 005 RPL_ISUPPORT, */ ":%s 005 %s %s :are supported by this server", /* 006 */ NULL, /* 007 */ NULL, @@ -38,9 +38,9 @@ /* 012 */ NULL, /* 013 */ NULL, /* 014 */ NULL, -/* 015 */ NULL, +/* 015 RPL_MAP, */ ":%s 015 %s :%s", /* 016 */ NULL, -/* 017 */ NULL, +/* 017 RPL_MAPEND, */ ":%s 017 %s :End of /MAP", /* 018 */ NULL, /* 019 */ NULL, /* 020 */ NULL, @@ -257,8 +257,8 @@ /* 231 */ NULL, /* 232 */ NULL, /* 233 */ NULL, -/* 234 RPL_SERVLIST, */ NULL, -/* 235 RPL_SERVLISTEND, */ NULL, +/* 234 */ NULL, +/* 235 */ NULL, /* 236 */ NULL, /* 237 */ NULL, /* 238 */ NULL, @@ -268,11 +268,11 @@ /* 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", +/* 245 */ NULL, /* 246 */ NULL, /* 247 RPL_STATSXLINE, */ ":%s 247 %s X %s %s * * 0 0", -/* 248 RPL_STATSULINE, */ ":%s 248 %s U %s %s", +/* 248 */ NULL, /* 249 */ NULL, /* 250 RPL_STATSCONN, */ ":%s 250 %s :Highest connection count: %d (%d clients) (%d since server was (re)started)", @@ -287,7 +287,7 @@ /* 258 RPL_ADMINLOC2, */ ":%s 258 %s :%s", /* 259 RPL_ADMINEMAIL, */ ":%s 259 %s :%s", /* 260 */ NULL, -/* 261 RPL_TRACELOG, */ ":%s 261 %s File %s %d", +/* 261 */ NULL, /* 262 RPL_ENDOFTRACE, */ ":%s 262 %s %s :End of TRACE", /* 263 RPL_LOAD2HI, */ ":%s 263 %s :Server load is temporarily too heavy. Please wait a while and try again.", @@ -369,7 +369,7 @@ /* 335 */ NULL, /* 336 */ NULL, /* 337 */ NULL, -/* 338 */ NULL, +/* 338 RPL_WHOISACTUALLY, */ ":%s 338 %s %s %s :actually using host", /* 339 */ NULL, /* 340 */ NULL, /* 341 RPL_INVITING, */ ":%s 341 %s %s %s", @@ -396,7 +396,7 @@ /* 358 */ NULL, /* 359 */ NULL, /* 360 */ NULL, -/* 361 RPL_KILLDONE, */ NULL, +/* 361 */ NULL, /* 362 RPL_CLOSING, */ ":%s 362 %s %s :Closed. Status = %d", /* 363 RPL_CLOSEEND, */ ":%s 363 %s %d: Connections Closed", /* 364 RPL_LINKS, */ ":%s 364 %s %s %s :%d %s", @@ -423,8 +423,8 @@ /* 381 RPL_YOUREOPER, */ ":%s 381 %s :You have entered... the Twilight Zone!.", /* 382 RPL_REHASHING, */ ":%s 382 %s %s :Rehashing", /* 383 */ NULL, -/* 384 RPL_MYPORTIS, */ ":%s 384 %s %d :Port to local server is\r\n", -/* 385 RPL_NOTOPERANYMORE, */ NULL, +/* 384 */ NULL, +/* 385 */ NULL, /* 386 */ NULL, /* 387 */ NULL, /* 388 */ NULL, @@ -459,13 +459,17 @@ /* 416 */ NULL, /* 417 */ NULL, /* 418 */ NULL, +#ifdef STATS_IGNORED_NOTICE +/* 419 ERR_STATSIGNORED, */ ":%s 419 %s :STATS %c request ignored", +#else /* 419 */ NULL, +#endif /* 420 */ NULL, /* 421 ERR_UNKNOWNCOMMAND, */ ":%s 421 %s %s :Unknown command", /* 422 ERR_NOMOTD, */ ":%s 422 %s :MOTD File is missing", /* 423 ERR_NOADMININFO, */ ":%s 423 %s %s :No administrative info available", -/* 424 ERR_FILEERROR, */ ":%s 424 %s :File error doing %s on %s", +/* 424 */ NULL, /* 425 */ NULL, /* 426 */ NULL, /* 427 */ NULL, @@ -486,8 +490,8 @@ /* 442 ERR_NOTONCHANNEL, */ ":%s 442 %s %s :You're not on that channel", /* 443 ERR_USERONCHANNEL, */ ":%s 443 %s %s %s :is already on channel", /* 444 ERR_NOLOGIN, */ ":%s 444 %s %s :User not logged in", -/* 445 ERR_SUMMONDISABLED, */ ":%s 445 %s :SUMMON has been removed", -/* 446 ERR_USERSDISABLED, */ ":%s 446 %s :USERS has been removed", +/* 445 */ NULL, +/* 446 */ NULL, /* 447 */ NULL, /* 448 */ NULL, /* 449 */ NULL, @@ -507,8 +511,8 @@ /* 463 ERR_NOPERMFORHOST, */ ":%s 463 %s :Your host isn't among the privileged", /* 464 ERR_PASSWDMISMATCH, */ ":%s 464 %s :Password Incorrect", /* 465 ERR_YOUREBANNEDCREEP, */ ":%s 465 %s :You are banned from this server- %s", -/* 466 ERR_YOUWILLBEBANNED, */ NULL, -/* 467 ERR_KEYSET, */ ":%s 467 %s %s :Channel key already set", +/* 466 */ NULL, +/* 467 */ NULL, /* 468 */ NULL, /* 469 */ NULL, /* 470 */ NULL, @@ -518,7 +522,7 @@ /* 474 ERR_BANNEDFROMCHAN, */ ":%s 474 %s %s :Cannot join channel (+b)", /* 475 ERR_BADCHANNELKEY, */ ":%s 475 %s %s :Cannot join channel (+k)", /* 476 ERR_BADCHANMASK, */ ":%s 476 %s %s :Bad Channel Mask", -/* 477 ERR_MODELESS, */ ":%s 477 %s %s :Channel does not support modes", +/* 477 */ NULL, /* 478 ERR_BANLISTFULL, */ ":%s 478 %s %s %s :Channel ban list is full", /* 479 ERR_BADCHANNAME */ ":%s 479 %s %s :Illegal channel name", /* 480 */ NULL, @@ -526,7 +530,7 @@ ":%s 481 %s :Permission Denied- You're not an IRC operator", /* 482 ERR_CHANOPRIVSNEEDED, */ ":%s 482 %s %s :You're not channel operator", /* 483 ERR_CANTKILLSERVER, */ ":%s 483 %s :You can't kill a server!", -/* 484 */ NULL, +/* 484 ERR_RESTRICTED, */ ":%s 484 %s :You are restricted", /* 485 */ NULL, /* 486 */ NULL, /* 487 */ NULL, @@ -546,7 +550,501 @@ /* 501 ERR_UMODEUNKNOWNFLAG, */ ":%s 501 %s :Unknown MODE flag", /* 502 ERR_USERSDONTMATCH, */ ":%s 502 %s :Can't change mode for other users", /* 503 ERR_GHOSTEDCLIENT, */ ":%s 503 %s :Message could not be delivered to %s", -/* 504 LAST ERR_LAST_ERR_MSG, */ ":%s 504 %s :Last Error Message" +/* 504 */ NULL, +/* 505 */ NULL, +/* 506 */ NULL, +/* 507 */ NULL, +/* 508 */ NULL, +/* 509 */ NULL, +/* 510 */ NULL, +/* 511 */ NULL, +/* 512 */ NULL, +/* 513 */ NULL, +/* 514 */ NULL, +/* 515 */ NULL, +/* 516 */ NULL, +/* 517 */ NULL, +/* 518 */ NULL, +/* 519 */ NULL, +/* 520 */ NULL, +/* 521 */ NULL, +/* 522 */ NULL, +/* 523 */ NULL, +/* 524 */ NULL, +/* 525 */ NULL, +/* 526 */ NULL, +/* 527 */ NULL, +/* 528 */ NULL, +/* 529 */ NULL, +/* 530 */ NULL, +/* 531 */ NULL, +/* 532 */ NULL, +/* 533 */ NULL, +/* 534 */ NULL, +/* 535 */ NULL, +/* 536 */ NULL, +/* 537 */ NULL, +/* 538 */ NULL, +/* 539 */ NULL, +/* 540 */ NULL, +/* 541 */ NULL, +/* 542 */ NULL, +/* 543 */ NULL, +/* 544 */ NULL, +/* 545 */ NULL, +/* 546 */ NULL, +/* 547 */ NULL, +/* 548 */ NULL, +/* 549 */ NULL, +/* 550 */ NULL, +/* 551 */ NULL, +/* 552 */ NULL, +/* 553 */ NULL, +/* 554 */ NULL, +/* 555 */ NULL, +/* 556 */ NULL, +/* 557 */ NULL, +/* 558 */ NULL, +/* 559 */ NULL, +/* 560 */ NULL, +/* 561 */ NULL, +/* 562 */ NULL, +/* 563 */ NULL, +/* 564 */ NULL, +/* 565 */ NULL, +/* 566 */ NULL, +/* 567 */ NULL, +/* 568 */ NULL, +/* 569 */ NULL, +/* 570 */ NULL, +/* 571 */ NULL, +/* 572 */ NULL, +/* 573 */ NULL, +/* 574 */ NULL, +/* 575 */ NULL, +/* 576 */ NULL, +/* 577 */ NULL, +/* 578 */ NULL, +/* 579 */ NULL, +/* 580 */ NULL, +/* 581 */ NULL, +/* 582 */ NULL, +/* 583 */ NULL, +/* 584 */ NULL, +/* 585 */ NULL, +/* 586 */ NULL, +/* 587 */ NULL, +/* 588 */ NULL, +/* 589 */ NULL, +/* 590 */ NULL, +/* 591 */ NULL, +/* 592 */ NULL, +/* 593 */ NULL, +/* 594 */ NULL, +/* 595 */ NULL, +/* 596 */ NULL, +/* 597 */ NULL, +/* 598 */ NULL, +/* 599 */ NULL, +/* 600 */ NULL, +/* 601 */ NULL, +/* 602 */ NULL, +/* 603 */ NULL, +/* 604 */ NULL, +/* 605 */ NULL, +/* 606 */ NULL, +/* 607 */ NULL, +/* 608 */ NULL, +/* 609 */ NULL, +/* 610 */ NULL, +/* 611 */ NULL, +/* 612 */ NULL, +/* 613 */ NULL, +/* 614 */ NULL, +/* 615 */ NULL, +/* 616 */ NULL, +/* 617 */ NULL, +/* 618 */ NULL, +/* 619 */ NULL, +/* 620 */ NULL, +/* 621 */ NULL, +/* 622 */ NULL, +/* 623 */ NULL, +/* 624 */ NULL, +/* 625 */ NULL, +/* 626 */ NULL, +/* 627 */ NULL, +/* 628 */ NULL, +/* 629 */ NULL, +/* 630 */ NULL, +/* 631 */ NULL, +/* 632 */ NULL, +/* 633 */ NULL, +/* 634 */ NULL, +/* 635 */ NULL, +/* 636 */ NULL, +/* 637 */ NULL, +/* 638 */ NULL, +/* 639 */ NULL, +/* 640 */ NULL, +/* 641 */ NULL, +/* 642 */ NULL, +/* 643 */ NULL, +/* 644 */ NULL, +/* 645 */ NULL, +/* 646 */ NULL, +/* 647 */ NULL, +/* 648 */ NULL, +/* 649 */ NULL, +/* 650 */ NULL, +/* 651 */ NULL, +/* 652 */ NULL, +/* 653 */ NULL, +/* 654 */ NULL, +/* 655 */ NULL, +/* 656 */ NULL, +/* 657 */ NULL, +/* 658 */ NULL, +/* 659 */ NULL, +/* 660 */ NULL, +/* 661 */ NULL, +/* 662 */ NULL, +/* 663 */ NULL, +/* 664 */ NULL, +/* 665 */ NULL, +/* 666 */ NULL, +/* 667 */ NULL, +/* 668 */ NULL, +/* 669 */ NULL, +/* 670 */ NULL, +/* 671 */ NULL, +/* 672 */ NULL, +/* 673 */ NULL, +/* 674 */ NULL, +/* 675 */ NULL, +/* 676 */ NULL, +/* 677 */ NULL, +/* 678 */ NULL, +/* 679 */ NULL, +/* 680 */ NULL, +/* 681 */ NULL, +/* 682 */ NULL, +/* 683 */ NULL, +/* 684 */ NULL, +/* 685 */ NULL, +/* 686 */ NULL, +/* 687 */ NULL, +/* 688 */ NULL, +/* 689 */ NULL, +/* 690 */ NULL, +/* 691 */ NULL, +/* 692 */ NULL, +/* 693 */ NULL, +/* 694 */ NULL, +/* 695 */ NULL, +/* 696 */ NULL, +/* 697 */ NULL, +/* 698 */ NULL, +/* 699 */ NULL, +/* 700 */ NULL, +/* 701 */ NULL, +/* 702 */ NULL, +/* 703 */ NULL, +/* 704 */ NULL, +/* 705 */ NULL, +/* 706 */ NULL, +/* 707 */ NULL, +/* 708 */ NULL, +/* 709 RPL_ETRACE, */ ":%s 709 %s %s %d %s %s %s %s :%s", +/* 710 RPL_KNOCK, */ ":%s 710 %s %s %s!%s@%s :has asked for an invite.", +/* 711 RPL_KNOCKDLVR */ ":%s 711 %s %s :Your KNOCK has been delivered.", +/* 712 ERR_TOOMANYKNOCK */ ":%s 712 %s %s :Too many KNOCKs (%s).", +/* 713 ERR_CHANOPEN */ ":%s 713 %s %s :Channel is open.", +/* 714 ERR_KNOCKONCHAN */ ":%s 714 %s %s :You are already on that channel.", +/* 715 ERR_KNOCKDISABLED */ ":%s 715 %s :KNOCKs are disabled.", +/* 716 */ NULL, +/* 717 */ NULL, +/* 718 */ NULL, +/* 719 */ NULL, +/* 720 */ NULL, +/* 721 */ NULL, +/* 722 */ NULL, +/* 723 */ NULL, +/* 724 */ NULL, +/* 725 */ NULL, +/* 726 */ NULL, +/* 727 */ NULL, +/* 728 */ NULL, +/* 729 */ NULL, +/* 730 */ NULL, +/* 731 */ NULL, +/* 732 */ NULL, +/* 733 */ NULL, +/* 734 */ NULL, +/* 735 */ NULL, +/* 736 */ NULL, +/* 737 */ NULL, +/* 738 */ NULL, +/* 739 */ NULL, +/* 740 */ NULL, +/* 741 */ NULL, +/* 742 */ NULL, +/* 743 */ NULL, +/* 744 */ NULL, +/* 745 */ NULL, +/* 746 */ NULL, +/* 747 */ NULL, +/* 748 */ NULL, +/* 749 */ NULL, +/* 750 */ NULL, +/* 751 */ NULL, +/* 752 */ NULL, +/* 753 */ NULL, +/* 754 */ NULL, +/* 755 */ NULL, +/* 756 */ NULL, +/* 757 */ NULL, +/* 758 */ NULL, +/* 759 */ NULL, +/* 760 */ NULL, +/* 761 */ NULL, +/* 762 */ NULL, +/* 763 */ NULL, +/* 764 */ NULL, +/* 765 */ NULL, +/* 766 */ NULL, +/* 767 */ NULL, +/* 768 */ NULL, +/* 769 */ NULL, +/* 770 */ NULL, +/* 771 */ NULL, +/* 772 */ NULL, +/* 773 */ NULL, +/* 774 */ NULL, +/* 775 */ NULL, +/* 776 */ NULL, +/* 777 */ NULL, +/* 778 */ NULL, +/* 779 */ NULL, +/* 780 */ NULL, +/* 781 */ NULL, +/* 782 */ NULL, +/* 783 */ NULL, +/* 784 */ NULL, +/* 785 */ NULL, +/* 786 */ NULL, +/* 787 */ NULL, +/* 788 */ NULL, +/* 789 */ NULL, +/* 790 */ NULL, +/* 791 */ NULL, +/* 792 */ NULL, +/* 793 */ NULL, +/* 794 */ NULL, +/* 795 */ NULL, +/* 796 */ NULL, +/* 797 */ NULL, +/* 798 */ NULL, +/* 799 */ NULL, +/* 800 */ NULL, +/* 801 */ NULL, +/* 802 */ NULL, +/* 803 */ NULL, +/* 804 */ NULL, +/* 805 */ NULL, +/* 806 */ NULL, +/* 807 */ NULL, +/* 808 */ NULL, +/* 809 */ NULL, +/* 810 */ NULL, +/* 811 */ NULL, +/* 812 */ NULL, +/* 813 */ NULL, +/* 814 */ NULL, +/* 815 */ NULL, +/* 816 */ NULL, +/* 817 */ NULL, +/* 818 */ NULL, +/* 819 */ NULL, +/* 820 */ NULL, +/* 821 */ NULL, +/* 822 */ NULL, +/* 823 */ NULL, +/* 824 */ NULL, +/* 825 */ NULL, +/* 826 */ NULL, +/* 827 */ NULL, +/* 828 */ NULL, +/* 829 */ NULL, +/* 830 */ NULL, +/* 831 */ NULL, +/* 832 */ NULL, +/* 833 */ NULL, +/* 834 */ NULL, +/* 835 */ NULL, +/* 836 */ NULL, +/* 837 */ NULL, +/* 838 */ NULL, +/* 839 */ NULL, +/* 840 */ NULL, +/* 841 */ NULL, +/* 842 */ NULL, +/* 843 */ NULL, +/* 844 */ NULL, +/* 845 */ NULL, +/* 846 */ NULL, +/* 847 */ NULL, +/* 848 */ NULL, +/* 849 */ NULL, +/* 850 */ NULL, +/* 851 */ NULL, +/* 852 */ NULL, +/* 853 */ NULL, +/* 854 */ NULL, +/* 855 */ NULL, +/* 856 */ NULL, +/* 857 */ NULL, +/* 858 */ NULL, +/* 859 */ NULL, +/* 860 */ NULL, +/* 861 */ NULL, +/* 862 */ NULL, +/* 863 */ NULL, +/* 864 */ NULL, +/* 865 */ NULL, +/* 866 */ NULL, +/* 867 */ NULL, +/* 868 */ NULL, +/* 869 */ NULL, +/* 870 */ NULL, +/* 871 */ NULL, +/* 872 */ NULL, +/* 873 */ NULL, +/* 874 */ NULL, +/* 875 */ NULL, +/* 876 */ NULL, +/* 877 */ NULL, +/* 878 */ NULL, +/* 879 */ NULL, +/* 880 */ NULL, +/* 881 */ NULL, +/* 882 */ NULL, +/* 883 */ NULL, +/* 884 */ NULL, +/* 885 */ NULL, +/* 886 */ NULL, +/* 887 */ NULL, +/* 888 */ NULL, +/* 889 */ NULL, +/* 890 */ NULL, +/* 891 */ NULL, +/* 892 */ NULL, +/* 893 */ NULL, +/* 894 */ NULL, +/* 895 */ NULL, +/* 896 */ NULL, +/* 897 */ NULL, +/* 898 */ NULL, +/* 899 */ NULL, +/* 900 */ NULL, +/* 901 */ NULL, +/* 902 */ NULL, +/* 903 */ NULL, +/* 904 */ NULL, +/* 905 */ NULL, +/* 906 */ NULL, +/* 907 */ NULL, +/* 908 */ NULL, +/* 909 */ NULL, +/* 910 */ NULL, +/* 911 */ NULL, +/* 912 */ NULL, +/* 913 */ NULL, +/* 914 */ NULL, +/* 915 */ NULL, +/* 916 */ NULL, +/* 917 */ NULL, +/* 918 */ NULL, +/* 919 */ NULL, +/* 920 */ NULL, +/* 921 */ NULL, +/* 922 */ NULL, +/* 923 */ NULL, +/* 924 */ NULL, +/* 925 */ NULL, +/* 926 */ NULL, +/* 927 */ NULL, +/* 928 */ NULL, +/* 929 */ NULL, +/* 930 */ NULL, +/* 931 */ NULL, +/* 932 */ NULL, +/* 933 */ NULL, +/* 934 */ NULL, +/* 935 */ NULL, +/* 936 */ NULL, +/* 937 */ NULL, +/* 938 */ NULL, +/* 939 */ NULL, +/* 940 */ NULL, +/* 941 */ NULL, +/* 942 */ NULL, +/* 943 */ NULL, +/* 944 */ NULL, +/* 945 */ NULL, +/* 946 */ NULL, +/* 947 */ NULL, +/* 948 */ NULL, +/* 949 */ NULL, +/* 950 */ NULL, +/* 951 */ NULL, +/* 952 */ NULL, +/* 953 */ NULL, +/* 954 */ NULL, +/* 955 */ NULL, +/* 956 */ NULL, +/* 957 */ NULL, +/* 958 */ NULL, +/* 959 */ NULL, +/* 960 */ NULL, +/* 961 */ NULL, +/* 962 */ NULL, +/* 963 */ NULL, +/* 964 */ NULL, +/* 965 */ NULL, +/* 966 */ NULL, +/* 967 */ NULL, +/* 968 */ NULL, +/* 969 */ NULL, +/* 970 */ NULL, +/* 971 */ NULL, +/* 972 */ NULL, +/* 973 */ NULL, +/* 974 */ NULL, +/* 975 */ NULL, +/* 976 */ NULL, +/* 977 */ NULL, +/* 978 */ NULL, +/* 979 */ NULL, +/* 980 */ NULL, +/* 981 */ NULL, +/* 982 */ NULL, +/* 983 */ NULL, +/* 984 */ NULL, +/* 985 */ NULL, +/* 986 */ NULL, +/* 987 */ NULL, +/* 988 */ NULL, +/* 989 */ NULL, +/* 990 */ NULL, +/* 991 */ NULL, +/* 992 */ NULL, +/* 993 */ NULL, +/* 994 */ NULL, +/* 995 */ NULL, +/* 996 */ NULL, +/* 997 */ NULL, +/* 998 */ NULL, +/* 999 LAST ERR_LAST_ERR_MSG,*/ ":%s 999 %s :Last Error Message" }; - diff -uNrd ircd-hybrid-6.3.1.dist/src/messages_cust.tab ircd-hybrid-6.3.1/src/messages_cust.tab --- ircd-hybrid-6.3.1.dist/src/messages_cust.tab Sat Dec 29 22:25:48 2001 +++ ircd-hybrid-6.3.1/src/messages_cust.tab Wed Dec 31 19:00:00 1969 @@ -1,553 +0,0 @@ -/************************************************************************ - * IRC - Internet Relay Chat, ircd/messages_cust.tab - * Copyright (C) 1992 Darren Reed - * - * 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 1, 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. - * - * $Id: messages_cust.tab,v 1.23 2001/12/30 03:25:48 lusky Exp $ - * - */ -/* - * jive replies originally from mr_bill - mrbill@mrbill.net (Bill Bradford) - */ - -static char * replies[] = { -/* 000 */ 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 oOiwszcrkfydnxb biklmnopstve", -/* 005 RPL_ISUPPORT, */ ":%s 005 %s %s :are supported by this server", -/* 006 */ NULL, -/* 007 */ NULL, -/* 008 */ NULL, -/* 009 */ NULL, -/* 010 */ NULL, -/* 011 */ NULL, -/* 012 */ NULL, -/* 013 */ NULL, -/* 014 */ NULL, -/* 015 */ NULL, -/* 016 */ NULL, -/* 017 */ NULL, -/* 018 */ NULL, -/* 019 */ NULL, -/* 020 */ NULL, -/* 021 */ NULL, -/* 022 */ NULL, -/* 023 */ NULL, -/* 024 */ NULL, -/* 025 */ NULL, -/* 026 */ NULL, -/* 027 */ NULL, -/* 028 */ NULL, -/* 029 */ NULL, -/* 030 */ NULL, -/* 031 */ NULL, -/* 032 */ NULL, -/* 033 */ NULL, -/* 034 */ NULL, -/* 035 */ NULL, -/* 036 */ NULL, -/* 037 */ NULL, -/* 038 */ NULL, -/* 039 */ NULL, -/* 040 */ NULL, -/* 041 */ NULL, -/* 042 */ NULL, -/* 043 */ NULL, -/* 044 */ NULL, -/* 045 */ NULL, -/* 046 */ NULL, -/* 047 */ NULL, -/* 048 */ NULL, -/* 049 */ NULL, -/* 050 */ NULL, -/* 051 */ NULL, -/* 052 */ NULL, -/* 053 */ NULL, -/* 054 */ NULL, -/* 055 */ NULL, -/* 056 */ NULL, -/* 057 */ NULL, -/* 058 */ NULL, -/* 059 */ NULL, -/* 060 */ NULL, -/* 061 */ NULL, -/* 062 */ NULL, -/* 063 */ NULL, -/* 064 */ NULL, -/* 065 */ NULL, -/* 066 */ NULL, -/* 067 */ NULL, -/* 068 */ NULL, -/* 069 */ NULL, -/* 070 */ NULL, -/* 071 */ NULL, -/* 072 */ NULL, -/* 073 */ NULL, -/* 074 */ NULL, -/* 075 */ NULL, -/* 076 */ NULL, -/* 077 */ NULL, -/* 078 */ NULL, -/* 079 */ NULL, -/* 080 */ NULL, -/* 081 */ NULL, -/* 082 */ NULL, -/* 083 */ NULL, -/* 084 */ NULL, -/* 085 */ NULL, -/* 086 */ NULL, -/* 087 */ NULL, -/* 088 */ NULL, -/* 089 */ NULL, -/* 090 */ NULL, -/* 091 */ NULL, -/* 092 */ NULL, -/* 093 */ NULL, -/* 094 */ NULL, -/* 095 */ NULL, -/* 096 */ NULL, -/* 097 */ NULL, -/* 098 */ NULL, -/* 099 */ NULL, -/* 100 */ NULL, -/* 101 */ NULL, -/* 102 */ NULL, -/* 103 */ NULL, -/* 104 */ NULL, -/* 105 */ NULL, -/* 106 */ NULL, -/* 107 */ NULL, -/* 108 */ NULL, -/* 109 */ NULL, -/* 110 */ NULL, -/* 111 */ NULL, -/* 112 */ NULL, -/* 113 */ NULL, -/* 114 */ NULL, -/* 115 */ NULL, -/* 116 */ NULL, -/* 117 */ NULL, -/* 118 */ NULL, -/* 119 */ NULL, -/* 120 */ NULL, -/* 121 */ NULL, -/* 122 */ NULL, -/* 123 */ NULL, -/* 124 */ NULL, -/* 125 */ NULL, -/* 126 */ NULL, -/* 127 */ NULL, -/* 128 */ NULL, -/* 129 */ NULL, -/* 130 */ NULL, -/* 131 */ NULL, -/* 132 */ NULL, -/* 133 */ NULL, -/* 134 */ NULL, -/* 135 */ NULL, -/* 136 */ NULL, -/* 137 */ NULL, -/* 138 */ NULL, -/* 139 */ NULL, -/* 140 */ NULL, -/* 141 */ NULL, -/* 142 */ NULL, -/* 143 */ NULL, -/* 144 */ NULL, -/* 145 */ NULL, -/* 146 */ NULL, -/* 147 */ NULL, -/* 148 */ NULL, -/* 149 */ NULL, -/* 150 */ NULL, -/* 151 */ NULL, -/* 152 */ NULL, -/* 153 */ NULL, -/* 154 */ NULL, -/* 155 */ NULL, -/* 156 */ NULL, -/* 157 */ NULL, -/* 158 */ NULL, -/* 159 */ NULL, -/* 160 */ NULL, -/* 161 */ NULL, -/* 162 */ NULL, -/* 163 */ NULL, -/* 164 */ NULL, -/* 165 */ NULL, -/* 166 */ NULL, -/* 167 */ NULL, -/* 168 */ NULL, -/* 169 */ NULL, -/* 170 */ NULL, -/* 171 */ NULL, -/* 172 */ NULL, -/* 173 */ NULL, -/* 174 */ NULL, -/* 175 */ NULL, -/* 176 */ NULL, -/* 177 */ NULL, -/* 178 */ NULL, -/* 179 */ NULL, -/* 180 */ NULL, -/* 181 */ NULL, -/* 182 */ NULL, -/* 183 */ NULL, -/* 184 */ NULL, -/* 185 */ NULL, -/* 186 */ NULL, -/* 187 */ NULL, -/* 188 */ NULL, -/* 189 */ NULL, -/* 190 */ NULL, -/* 191 */ NULL, -/* 192 */ NULL, -/* 193 */ NULL, -/* 194 */ NULL, -/* 195 */ NULL, -/* 196 */ NULL, -/* 197 */ NULL, -/* 198 */ NULL, -/* 199 */ NULL, -/* 200 RPL_TRACELINK, */ ":%s 200 %s Link %s%s %s %s", -/* 201 RPL_TRACECONNECTING, */ ":%s 201 %s Try. %d %s", -/* 202 RPL_TRACEHANDSHAKE, */ ":%s 202 %s H.S. %d %s", -/* 203 RPL_TRACEUNKNOWN, */ ":%s 203 %s ???? %d %s (%s) %d", -/* 204 RPL_TRACEOPERATOR, */ ":%s 204 %s Oper %d %s (%s) %lu %lu", -/* 205 RPL_TRACEUSER, */ ":%s 205 %s User %d %s (%s) %lu %lu", -/* 206 RPL_TRACESERVER, */ ":%s 206 %s Serv %d %dS %dC %s %s!%s@%s %lu", -/* 207 */ NULL, -/* 208 RPL_TRACENEWTYPE, */ ":%s 208 %s 0 %s", -/* 209 RPL_TRACECLASS, */ ":%s 209 %s Class %d %d", -/* 210 */ NULL, -/* 211 RPL_STATSLINKINFO, */ NULL, -/* 212 RPL_STATSCOMMANDS, */ ":%s 212 %s %s %u %u", -/* 213 RPL_STATSCLINE, */ ":%s 213 %s %c %s * %s %d %d", -/* 214 RPL_STATSNLINE, */ ":%s 214 %s %c %s * %s %d %d", -/* 215 RPL_STATSILINE, */ ":%s 215 %s %c %s * %s@%s %d %d", -/* 216 RPL_STATSKLINE, */ ":%s 216 %s %c %s * %s :%s", -/* 217 RPL_STATSQLINE, */ ":%s 217 %s %c %s %s@%s :%s", -/* 218 RPL_STATSYLINE, */ ":%s 218 %s %c %d %d %d %d %lu", -/* 219 RPL_ENDOFSTATS, */ ":%s 219 %s %c :End of /STATS report", -/* 220 RPL_STATSPLINE, */ ":%s 220 %s %c %d %s %d :%s", -/* 221 RPL_UMODEIS, */ ":%s 221 %s %s", -/* 222 */ NULL, -/* 223 */ NULL, -/* 224 */ NULL, -/* 225 RPL_STATSDLINE*/ ":%s 225 %s %c %s :%s", -/* 226 */ NULL, -/* 227 */ NULL, -/* 228 */ NULL, -/* 229 */ NULL, -/* 230 */ NULL, -/* 231 */ NULL, -/* 232 */ NULL, -/* 233 */ NULL, -/* 234 RPL_SERVLIST, */ NULL, -/* 235 RPL_SERVLISTEND, */ NULL, -/* 236 */ NULL, -/* 237 */ NULL, -/* 238 */ NULL, -/* 239 */ NULL, -/* 240 */ 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", -/* 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", -/* 246 */ NULL, -/* 247 RPL_STATSXLINE, */ ":%s 247 %s X %s %s * * 0 0", - -/* 248 RPL_STATSULINE, */ ":%s 248 %s U %s %s", -/* 249 */ NULL, -/* 250 RPL_STATSCONN, */ - ":%s 250 %s :Highest connection count: %d (%d clients) (%d since server was (re)started)", -/* 251 RPL_LUSERCLIENT, */ - ":%s 251 %s :There are %d users and %d invisible on %d servers", -/* 252 RPL_LUSEROP, */ ":%s 252 %s %d :Smurf Targets (IRC Operators) online", -/* 253 RPL_LUSERUNKNOWN, */ ":%s 253 %s %d :unknown connection(s)", -/* 254 RPL_LUSERCHANNELS, */ ":%s 254 %s %d :channels formed", -/* 255 RPL_LUSERME, */ ":%s 255 %s :I have %d clients and %d servers", -/* 256 RPL_ADMINME, */ ":%s 256 %s :Administrative info about %s", -/* 257 RPL_ADMINLOC1, */ ":%s 257 %s :%s", -/* 258 RPL_ADMINLOC2, */ ":%s 258 %s :%s", -/* 259 RPL_ADMINEMAIL, */ ":%s 259 %s :%s", -/* 260 */ NULL, -/* 261 RPL_TRACELOG, */ ":%s 261 %s File %s %d", -/* 262 RPL_ENDOFTRACE, */ ":%s 262 %s %s :End of TRACE", -/* 263 RPL_LOAD2HI, */ -":%s 263 %s :Hold your horses... the server load is temporarily too heavy. Try again later, ok?", -/* 264 */ NULL, -/* 265 RPL_LOCALUSERS, */ ":%s 265 %s :Current local users: %d Max: %d", -/* 266 RPL_GLOBALUSERS, */ ":%s 266 %s :Current global users: %d Max: %d", -/* 267 */ NULL, -/* 268 */ NULL, -/* 269 */ NULL, -/* 270 */ NULL, -/* 271 */ NULL, -/* 272 */ NULL, -/* 273 */ NULL, -/* 274 */ NULL, -/* 275 */ NULL, -/* 276 */ NULL, -/* 277 */ NULL, -/* 278 */ NULL, -/* 279 */ NULL, -/* 280 */ NULL, -/* 281 */ NULL, -/* 281 */ NULL, -/* 282 */ NULL, -/* 283 */ NULL, -/* 284 */ NULL, -/* 285 */ NULL, -/* 286 */ NULL, -/* 287 */ NULL, -/* 288 */ NULL, -/* 289 */ NULL, -/* 290 */ NULL, -/* 291 */ NULL, -/* 292 */ NULL, -/* 293 */ NULL, -/* 294 */ NULL, -/* 295 */ NULL, -/* 296 */ NULL, -/* 298 */ NULL, -/* 299 */ NULL, -/* 300 RPL_NONE, */ NULL, -/* 301 RPL_AWAY, */ ":%s 301 %s %s :%s", -/* 302 RPL_USERHOST, */ ":%s 302 %s :%s", -/* 303 RPL_ISON, */ ":%s 303 %s :", -/* 304 RPL_TEXT, */ NULL, -/* 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 */ NULL, -/* 308 */ NULL, -/* 309 */ NULL, -/* 310 */ NULL, -/* 311 RPL_WHOISUSER, */ ":%s 311 %s %s %s %s * :%s", -/* 312 RPL_WHOISSERVER, */ ":%s 312 %s %s %s :%s", -/* 313 RPL_WHOISOPERATOR, */ ":%s 313 %s %s :is a Smurf Target (IRC Operator)", -/* 314 RPL_WHOWASUSER, */ ":%s 314 %s %s %s %s * :%s", -/* 315 RPL_ENDOFWHO, */ ":%s 315 %s %s :End of /WHO list.", -/* 316 RPL_WHOISCHANOP, */ NULL, -/* 317 RPL_WHOISIDLE, */ ":%s 317 %s %s %d %d :seconds idle, signon time", -/* 318 RPL_ENDOFWHOIS, */ ":%s 318 %s %s :End of /WHOIS list.", -/* 319 RPL_WHOISCHANNELS, */ ":%s 319 %s %s :%s", -/* 320 */ NULL, -/* 321 RPL_LISTSTART, */ ":%s 321 %s Channel :Users Name", -/* 322 RPL_LIST, */ ":%s 322 %s %s %d :%s", -/* 323 RPL_LISTEND, */ ":%s 323 %s :End of /LIST", -/* 324 RPL_CHANNELMODEIS, */ ":%s 324 %s %s %s %s", -/* 325 */ NULL, -/* 326 */ NULL, -/* 327 */ NULL, -/* 328 */ NULL, -/* 329 RPL_CREATIONTIME, */ ":%s 329 %s %s %lu", -/* 330 */ NULL, -/* 331 RPL_NOTOPIC, */ ":%s 331 %s %s :No topic is set.", -/* 332 RPL_TOPIC, */ ":%s 332 %s %s :%s", -#ifdef TOPIC_INFO -/* 333 RPL_TOPICWHOTIME, */ ":%s 333 %s %s %s %lu", -#else -/* 333 */ NULL, -#endif -/* 334 */ NULL, -/* 335 */ NULL, -/* 336 */ NULL, -/* 337 */ NULL, -/* 338 */ NULL, -/* 339 */ NULL, -/* 340 */ NULL, -/* 341 RPL_INVITING, */ ":%s 341 %s %s %s", -/* 342 RPL_SUMMONING, */ NULL, -/* 343 */ NULL, -/* 344 */ NULL, -/* 345 */ NULL, -/* 346 */ NULL, -/* 347 */ NULL, -#ifdef BAN_INFO -/* 348 RPL_EXCEPTLIST */ ":%s 348 %s %s %s %s %lu", -#else -/* 348 RPL_EXCEPTLIST */ ":%s 348 %s %s %s", -#endif -/* 349 RPL_ENDOFEXCEPTLIST */ ":%s 349 %s %s :End of Channel Exception List", -/* 350 */ NULL, -/* 351 RPL_VERSION, */ ":%s 351 %s %s(%s).%s %s :%s", -/* 352 RPL_WHOREPLY, */ ":%s 352 %s %s %s %s %s %s %s :%d %s", -/* 353 RPL_NAMREPLY, */ ":%s 353 %s %s", -/* 354 */ NULL, -/* 355 */ NULL, -/* 356 */ NULL, -/* 357 */ NULL, -/* 358 */ NULL, -/* 359 */ NULL, -/* 360 */ NULL, -/* 361 RPL_KILLDONE, */ NULL, -/* 362 RPL_CLOSING, */ ":%s 362 %s %s :Closed. Status = %d", -/* 363 RPL_CLOSEEND, */ ":%s 363 %s %d: Connections Closed", -/* 364 RPL_LINKS, */ ":%s 364 %s %s %s :%d %s", -/* 365 RPL_ENDOFLINKS, */ ":%s 365 %s %s :End of /LINKS list.", -/* 366 RPL_ENDOFNAMES, */ ":%s 366 %s %s :End of /NAMES list.", -#ifdef BAN_INFO -/* 367 RPL_BANLIST, */ ":%s 367 %s %s %s %s %lu", -#else -/* 367 RPL_BANLIST, */ ":%s 367 %s %s %s", -#endif -/* 368 RPL_ENDOFBANLIST, */ ":%s 368 %s %s :End of Channel Ban List", -/* 369 RPL_ENDOFWHOWAS, */ ":%s 369 %s %s :End of WHOWAS", -/* 370 */ NULL, -/* 371 RPL_INFO, */ ":%s 371 %s :%s", -/* 372 RPL_MOTD, */ ":%s 372 %s :- %s", -/* 373 RPL_INFOSTART, */ ":%s 373 %s :Server INFO", -/* 374 RPL_ENDOFINFO, */ ":%s 374 %s :End of /INFO list.", -/* 375 RPL_MOTDSTART, */ ":%s 375 %s :- %s Message of the Day - ", -/* 376 RPL_ENDOFMOTD, */ ":%s 376 %s :End of /MOTD command.", -/* 377 */ NULL, -/* 378 */ NULL, -/* 379 */ NULL, -/* 380 */ NULL, -/* 381 RPL_YOUREOPER, */ ":%s 381 %s :You are now one bad motherfucker - Go /kill someone.", -/* 382 RPL_REHASHING, */ ":%s 382 %s %s :it slices, dices, and even reloads config files! Rehashing config file, mang.", -/* 383 */ NULL, -/* 384 RPL_MYPORTIS, */ ":%s 384 %s %d :Port to local server is\r\n", -/* 385 RPL_NOTOPERANYMORE, */ NULL, -/* 386 */ NULL, -/* 387 */ NULL, -/* 388 */ NULL, -/* 389 */ NULL, -/* 390 */ NULL, -/* 391 RPL_TIME, */ ":%s 391 %s %s :%s", -/* 392 */ NULL, -/* 393 */ NULL, -/* 394 */ NULL, -/* 395 */ NULL, -/* 396 */ NULL, -/* 397 */ NULL, -/* 398 */ NULL, -/* 399 */ NULL, -/* 400 */ NULL, -/* 401 ERR_NOSUCHNICK, */ ":%s 401 %s %s :No such nick/channel", -/* 402 ERR_NOSUCHSERVER, */ ":%s 402 %s %s :No such server", -/* 403 ERR_NOSUCHCHANNEL, */ ":%s 403 %s %s :No such channel", -/* 404 ERR_CANNOTSENDTOCHAN, */ ":%s 404 %s %s :Cannot send to channel", -/* 405 ERR_TOOMANYCHANNELS, */ ":%s 405 %s %s :You have joined too many channels", -/* 406 ERR_WASNOSUCHNICK, */ ":%s 406 %s %s :There was no such nickname", -/* 407 ERR_TOOMANYTARGETS, */ - ":%s 407 %s %s :Duplicate recipients. No message delivered.", -/* 408 */ NULL, -/* 409 ERR_NOORIGIN, */ ":%s 409 %s :No origin specified", -/* 410 */ NULL, -/* 411 ERR_NORECIPIENT, */ ":%s 411 %s :No recipient given (%s)", -/* 412 ERR_NOTEXTTOSEND, */ ":%s 412 %s :No text to send", -/* 413 ERR_NOTOPLEVEL, */ ":%s 413 %s %s :No toplevel domain specified", -/* 414 ERR_WILDTOPLEVEL, */ ":%s 414 %s %s :Wildcard in toplevel Domain", -/* 415 */ NULL, -/* 416 */ NULL, -/* 417 */ NULL, -/* 418 */ NULL, -/* 419 */ NULL, -/* 420 */ NULL, -/* 421 ERR_UNKNOWNCOMMAND, */ ":%s 421 %s %s :Unknown command", -/* 422 ERR_NOMOTD, */ ":%s 422 %s :MOTD File is missing", -/* 423 ERR_NOADMININFO, */ - ":%s 423 %s %s :No administrative info available", -/* 424 ERR_FILEERROR, */ ":%s 424 %s :File error doing %s on %s", -/* 425 */ NULL, -/* 426 */ NULL, -/* 427 */ NULL, -/* 428 */ NULL, -/* 429 */ NULL, -/* 430 */ NULL, -/* 431 ERR_NONICKNAMEGIVEN, */ ":%s 431 %s :No nickname given", -/* 432 ERR_ERRONEUSNICKNAME, */ ":%s 432 %s %s :Erroneus Nickname", -/* 433 ERR_NICKNAMEINUSE, */ ":%s 433 %s %s :Nickname is already in use.", -/* 434 */ NULL, -/* 435 */ NULL, -/* 436 ERR_NICKCOLLISION, */ ":%s 436 %s %s :Nickname collision KILL", -/* 437 ERR_UNAVAILRESOURCE, */ ":%s 437 %s %s :Nick/channel is temporarily unavailable", -/* 438 ERR_NICKTOOFAST */ ":%s 438 %s %s %s :Nick change too fast. Please wait %d seconds.", -/* 439 */ NULL, -/* 440 */ NULL, -/* 441 ERR_USERNOTINCHANNEL, */ ":%s 441 %s %s %s :They aren't on that channel", -/* 442 ERR_NOTONCHANNEL, */ ":%s 442 %s %s :You're not on that channel", -/* 443 ERR_USERONCHANNEL, */ ":%s 443 %s %s %s :is already on channel", -/* 444 ERR_NOLOGIN, */ ":%s 444 %s %s :User not logged in", -/* 445 ERR_SUMMONDISABLED, */ ":%s 445 %s :SUMMON has been removed", -/* 446 ERR_USERSDISABLED, */ ":%s 446 %s :USERS has been removed", -/* 447 */ NULL, -/* 448 */ NULL, -/* 449 */ NULL, -/* 450 */ NULL, -/* 451 ERR_NOTREGISTERED, */ ":%s 451 %s :You have not registered", -/* 452 */ NULL, -/* 453 */ NULL, -/* 454 */ NULL, -/* 455 */ NULL, -/* 456 */ NULL, -/* 457 */ NULL, -/* 458 */ NULL, -/* 459 */ NULL, -/* 460 */ NULL, -/* 461 ERR_NEEDMOREPARAMS, */ ":%s 461 %s %s :Not enough parameters", -/* 462 ERR_ALREADYREGISTRED, */ ":%s 462 %s :You may not reregister", -/* 463 ERR_NOPERMFORHOST, */ ":%s 463 %s :Your host isn't among the privileged", -/* 464 ERR_PASSWDMISMATCH, */ ":%s 464 %s :BZZT!! Wrong password, homez. Are you sure you know what you're doing??", -/* 465 ERR_YOUREBANNEDCREEP, */ ":%s 465 %s :You are banned from this server- %s", -/* 466 ERR_YOUWILLBEBANNED, */ NULL, -/* 467 ERR_KEYSET, */ ":%s 467 %s %s :Channel key already set", -/* 468 */ NULL, -/* 469 */ NULL, -/* 470 */ NULL, -/* 471 ERR_CHANNELISFULL, */ ":%s 471 %s %s :Cannot join channel (+l)", -/* 472 ERR_UNKNOWNMODE , */ ":%s 472 %s %c :is unknown mode char to me", -/* 473 ERR_INVITEONLYCHAN, */ ":%s 473 %s %s :Cannot join channel (+i)", -/* 474 ERR_BANNEDFROMCHAN, */ ":%s 474 %s %s :Cannot join channel (+b)", -/* 475 ERR_BADCHANNELKEY, */ ":%s 475 %s %s :Cannot join channel (+k)", -/* 476 ERR_BADCHANMASK, */ ":%s 476 %s %s :Bad Channel Mask", -/* 477 ERR_MODELESS, */ ":%s 477 %s %s :Channel does not support modes", -/* 478 ERR_BANLISTFULL, */ ":%s 478 %s %s %s :Channel ban list is full", -/* 479 ERR_BADCHANNAME */ ":%s 479 %s %s :Illegal channel name", -/* 480 */ NULL, -/* 481 ERR_NOPRIVILEGES, */ - ":%s 481 %s :I don't THINK so, homez... you ain't got what it takes. (IRC operator)", -/* 482 ERR_CHANOPRIVSNEEDED, */ ":%s 482 %s %s :You can't do that thing, when you don't have that swing (You're not channel operator)", -/* 483 ERR_CANTKILLSERVER, */ ":%s 483 %s :Don't be an idiot - you can't kill a SERVER, fool.", -/* 484 */ NULL, -/* 485 */ NULL, -/* 486 */ NULL, -/* 487 */ NULL, -/* 488 */ NULL, -/* 489 */ NULL, -/* 490 */ NULL, -/* 491 ERR_NOOPERHOST, */ ":%s 491 %s :Sorry, you just don't have what it takes to be an IRC Operator here.", -/* 492 */ NULL, -/* 493 */ NULL, -/* 494 */ NULL, -/* 495 */ NULL, -/* 496 */ NULL, -/* 497 */ NULL, -/* 498 */ NULL, -/* 499 */ NULL, -/* 500 */ NULL, -/* 501 ERR_UMODEUNKNOWNFLAG, */ ":%s 501 %s :Unknown MODE flag", -/* 502 ERR_USERSDONTMATCH, */ ":%s 502 %s :Can't change mode for other users", -/* 503 ERR_GHOSTEDCLIENT, */ ":%s 503 %s :Message could not be delivered to %s", -/* 504 LAST ERR_LAST_ERR_MSG, */ ":%s 504 %s :Last Error Message" -}; - - diff -uNrd ircd-hybrid-6.3.1.dist/src/mtrie_conf.c ircd-hybrid-6.3.1/src/mtrie_conf.c --- ircd-hybrid-6.3.1.dist/src/mtrie_conf.c Thu Mar 21 19:04:57 2002 +++ ircd-hybrid-6.3.1/src/mtrie_conf.c Sat Apr 26 20:21:47 2003 @@ -80,7 +80,11 @@ static void find_or_add_user_piece(DOMAIN_PIECE *,struct ConfItem *,int,char *); static struct ConfItem *find_user_piece(DOMAIN_PIECE *,int,char *, const char* user); +static struct ConfItem* look_for_dup_in_unsortable_ilines(const char* host, +const char* user); static struct ConfItem* look_in_unsortable_ilines(const char* host, const char* user); +static struct ConfItem* look_for_dup_in_unsortable_klines(const char* host, +const char* user); static struct ConfItem* look_in_unsortable_klines(const char* host, const char* user); static struct ConfItem* find_wild_card_iline(const char* user); @@ -117,6 +121,7 @@ char tokenized_host[HOSTLEN+1]; unsigned long ip_host; unsigned long ip_mask; + struct ConfItem *aconf2; /* Sanity tests are always good */ if(!aconf->host || !aconf->user) @@ -146,6 +151,13 @@ if(aconf->status & CONF_CLIENT) { + aconf2 = look_for_dup_in_unsortable_ilines(aconf->host, aconf->user); + if (aconf2 != NULL) + { + report_dup('I', aconf2); + free(aconf); + return; + } if(unsortable_list_ilines) { aconf->next = unsortable_list_ilines; @@ -156,6 +168,16 @@ } else { + /* This is a CPU hit, but it prevents a mess of duplicate unsortable + * klines. -Hwy + */ + aconf2 = look_for_dup_in_unsortable_klines(aconf->host, aconf->user); + if (aconf2 != NULL) + { + report_dup('K', aconf2); + free(aconf); + return; + } if(unsortable_list_klines) { aconf->next = unsortable_list_klines; @@ -170,6 +192,13 @@ case -2: if(aconf->status & CONF_CLIENT) { + aconf2 = find_wild_card_iline(aconf->user); + if (aconf2 != NULL) + { + report_dup('I', aconf2); + free(aconf); + return; + } if(wild_card_ilines) { aconf->next = wild_card_ilines; @@ -180,6 +209,16 @@ } else { + /* This is a CPU hit, but it prevents a mess of duplicate unsortable + * klines. -Hwy + */ + aconf2 = look_for_dup_in_unsortable_klines(aconf->host, aconf->user); + if (aconf2 != NULL) + { + report_dup('K', aconf2); + free(aconf); + return; + } if(unsortable_list_klines) { aconf->next = unsortable_list_klines; @@ -1095,6 +1134,33 @@ } /* + * look_in_unsortable_ilines() + * + * inputs - host name + * - username + * output - struct ConfItem pointer or NULL + * side effects - + * + * scan the link list of unsortable patterns + */ + +static struct ConfItem * +look_for_dup_in_unsortable_ilines(const char* host, const char* user) +{ + struct ConfItem *found_conf; + + for(found_conf=unsortable_list_ilines;found_conf;found_conf=found_conf->next) + { + if((irccmp(found_conf->host,host) == 0) && + (irccmp(found_conf->user,user) == 0)) + { + return(found_conf); + } + } + return(NULL); +} + +/* * look_in_unsortable_klines() * * inputs - host name @@ -1120,6 +1186,31 @@ } /* + * look_for_dup_in_unsortable_klines() + * + * inputs - host name + * - username + * output - struct ConfItem pointer or NULL + * side effects - + * + * scan the link list of unsortable patterns + */ + +static struct ConfItem * +look_for_dup_in_unsortable_klines(const char* host, const char* user) +{ + struct ConfItem *found_conf; + + for(found_conf=unsortable_list_klines;found_conf;found_conf=found_conf->next) + { + if((irccmp(found_conf->host,host) == 0) && + (irccmp(found_conf->user,user) == 0)) + return(found_conf); + } + return(NULL); +} + +/* * find_wild_card_iline() * * inputs - username @@ -1361,7 +1452,8 @@ for(found_conf = unsortable_list_klines; found_conf;found_conf=found_conf->next) { - get_printable_conf(found_conf, &name, &host, &pass, &user, &port); + get_printable_conf(found_conf, &name, &host, &pass, + &user, &port); sendto_one(sptr, form_str(RPL_STATSKLINE), me.name, sptr->name, 'K', host, @@ -1400,6 +1492,12 @@ *prefix_ptr++ = '%'; if (IsConfDoSpoofIp(aconf)) *prefix_ptr++ = '='; + if (IsMustResolve(aconf)) + *prefix_ptr++ = '/'; +#ifdef CHECK_CLONE + if (IsConfCloneExempt(aconf)) + *prefix_ptr++ = '{'; +#endif #ifdef E_LINES_OPER_ONLY if(IsAnOper(sptr)) diff -uNrd ircd-hybrid-6.3.1.dist/src/numeric.c ircd-hybrid-6.3.1/src/numeric.c --- ircd-hybrid-6.3.1.dist/src/numeric.c Wed Nov 21 20:19:21 2001 +++ ircd-hybrid-6.3.1/src/numeric.c Mon Apr 21 16:01:50 2003 @@ -24,14 +24,8 @@ #include "numeric.h" #include "irc_string.h" #include "common.h" /* NULL cripes */ - #include - -#ifdef CUSTOM_ERR /* XXX ick */ -#include "messages_cust.tab" -#else #include "messages.tab" -#endif char numbuff[512]; diff -uNrd ircd-hybrid-6.3.1.dist/src/parse.c ircd-hybrid-6.3.1/src/parse.c --- ircd-hybrid-6.3.1.dist/src/parse.c Sat Dec 29 22:25:48 2001 +++ ircd-hybrid-6.3.1/src/parse.c Sat Apr 19 21:06:45 2003 @@ -721,6 +721,11 @@ ** with numerics which can happen with nick collisions. ** - Avalon */ + + /* comstud ircd hack, it bounces +a modes */ + if((atoi(numeric) == ERR_UMODEUNKNOWNFLAG) && MyClient(acptr)) + return 0; + if (!IsMe(acptr) && IsPerson(acptr)) sendto_prefix_one(acptr, sptr,":%s %s %s%s", parv[0], numeric, nick, buffer); diff -uNrd ircd-hybrid-6.3.1.dist/src/restart.c ircd-hybrid-6.3.1/src/restart.c --- ircd-hybrid-6.3.1.dist/src/restart.c Sat Dec 8 02:06:14 2001 +++ ircd-hybrid-6.3.1/src/restart.c Sat Apr 19 21:06:45 2003 @@ -39,6 +39,9 @@ log(L_NOTICE, "Restarting server..."); flush_connections(0); +#ifdef SAVE_MAXCLIENT + write_stats(); +#endif for (i = 0; i < MAXCONNECTIONS; ++i) close(i); diff -uNrd ircd-hybrid-6.3.1.dist/src/s_auth.c ircd-hybrid-6.3.1/src/s_auth.c --- ircd-hybrid-6.3.1.dist/src/s_auth.c Tue Dec 4 02:44:37 2001 +++ ircd-hybrid-6.3.1/src/s_auth.c Sat Apr 19 21:15:18 2003 @@ -398,8 +398,8 @@ sendheader(client, REPORT_DO_DNS); - adns_getaddr(&client->ip, client->dns_query); - SetDNSPending(auth); + if(!adns_getaddr(&client->ip, client->dns_query)) + SetDNSPending(auth); if (start_auth_query(auth)) link_auth_request(auth, &AuthPollList); diff -uNrd ircd-hybrid-6.3.1.dist/src/s_conf.c ircd-hybrid-6.3.1/src/s_conf.c --- ircd-hybrid-6.3.1.dist/src/s_conf.c Sun Feb 17 00:58:13 2002 +++ ircd-hybrid-6.3.1/src/s_conf.c Tue Apr 29 22:27:38 2003 @@ -19,7 +19,7 @@ * * (C) 1988 University of Oulu,Computing Center and Jarkko Oikarinen" * - * $Id: s_conf.c,v 1.236 2002/02/17 05:58:13 lusky Exp $ + * $Id: s_conf.c,v 1.237 2002/04/28 08:13:02 androsyn Exp $ */ #include "m_commands.h" #include "s_conf.h" @@ -85,9 +85,11 @@ static void clear_special_conf(struct ConfItem **); static struct ConfItem* find_tkline(const char*, const char*, unsigned long); static void expire_temp_klines(struct ConfItem **tklines); +static void expire_temp_dlines(struct ConfItem **tdlines); struct ConfItem *temporary_klines = NULL; struct ConfItem *temporary_ip_klines = NULL; +struct ConfItem *temporary_dlines = NULL; static char *set_conf_flags(struct ConfItem *,char *); static int oper_privs_from_string(int,char *); @@ -139,9 +141,6 @@ /* conf qline link list root */ aQlineItem *q_conf = ((aQlineItem *)NULL); -/* conf uline link list root */ -struct ConfItem *u_conf = ((struct ConfItem *)NULL); - /* keep track of .include files to hash in */ struct ConfItem *include_list = ((struct ConfItem *)NULL); @@ -155,7 +154,7 @@ { struct ConfItem* aconf = (struct ConfItem*) vptr; aconf->dns_pending = 0; - if (reply->status == adns_s_ok) + if (reply && (reply->status == adns_s_ok)) aconf->ipnum.s_addr = reply->rrs.addr->addr.inet.sin_addr.s_addr; MyFree(reply); } @@ -376,8 +375,6 @@ if (flags & CONF_XLINE) this_conf = x_conf; - else if (flags & CONF_ULINE) - this_conf = u_conf; else return; for (aconf = this_conf; aconf; aconf = aconf->next) @@ -486,6 +483,12 @@ } #endif /* GLINES */ + if(IsMustResolve(aconf) && IsDigit(cptr->host[strlen(cptr->host)-1])) + { + sendto_one(cptr, ":%s NOTICE %s :*** Your IP must resolve to use this server", me.name, cptr->name); + return ( -1 ); + } + if(IsConfDoIdentd(aconf)) SetNeedId(cptr); @@ -1393,8 +1396,6 @@ if(mask & CONF_XLINE) this_conf = x_conf; - else if(mask & CONF_ULINE) - this_conf = u_conf; else return((struct ConfItem *)NULL); @@ -1840,6 +1841,9 @@ case '^': /* is exempt from k/g lines */ aconf->flags |= CONF_FLAGS_E_LINED; break; + case '/': /* clients host must resolve */ + aconf->flags |= CONF_FLAGS_RESOLVE; + break; case '&': /* obsolete flag was "can run a bot" */ break; case '>': /* can exceed max connects */ @@ -1853,6 +1857,11 @@ aconf->flags |= CONF_FLAGS_IDLE_LINED; break; #endif + case '{': /* exempt from clone checks */ +#ifdef CHECK_CLONE + aconf->flags |= CONF_FLAGS_CLONE_EXEMPT; +#endif + break; default: return tmp; } @@ -2096,11 +2105,6 @@ aconf->status = CONF_QUARANTINED_NICK; break; - case 'U': /* Uphost, ie. host where client reading */ - case 'u': /* this should connect. */ - aconf->status = CONF_ULINE; - break; - case 'X': /* rejected gecos */ case 'x': aconf->status = CONF_XLINE; @@ -2172,6 +2176,19 @@ break; aconf->port = oper_privs_from_string(aconf->port,tmp); } +#ifdef NEG_PORT + else if(aconf->status & CONF_CONNECT_SERVER) + { + if ((tmp = getfield(NULL)) == NULL) + break; + aconf->port = atoi(tmp); + if (aconf->port && (aconf->port < 0)) + { + aconf->flags &= ~CONF_FLAGS_ALLOW_AUTO_CONN; + aconf->port = abs(aconf->port); + } + } +#endif else { if ((tmp = getfield(NULL)) == NULL) @@ -2201,7 +2218,7 @@ if(classToFind && (ClassPtr(aconf) == class0)) { sendto_realops( - "Warning *** Defaulting to class 0 for class %d", + "Warning: Defaulting to class 0 for class %d", classToFind); } } @@ -2503,16 +2520,6 @@ aconf->next = x_conf; x_conf = aconf; } - else if (aconf->status & CONF_ULINE) - { - dontadd = 1; - MyFree(aconf->user); - aconf->user = (char *)NULL; - aconf->name = aconf->host; - aconf->host = (char *)NULL; - aconf->next = u_conf; - u_conf = aconf; - } else if (aconf->status & CONF_QUARANTINED_NICK) { dontadd = 1; @@ -2695,7 +2702,11 @@ if (aconf && !IsConfElined(aconf)) return 0; - return 1; + + if((aconf = find_tdline(ntohl((unsigned long)addr.s_addr)))) + return 0; + else + return 1; } /* @@ -2742,10 +2753,12 @@ else *tklines = cur_p->next; +#ifdef TKLINE_EXPIRE_NOTICE /* Alert opers that a TKline expired - Hwy */ sendto_realops("Temporary K-line for [%s@%s] expired", (cur_p->user) ? cur_p->user : "*", (cur_p->host) ? cur_p->host : "*"); +#endif free_conf(cur_p); } else @@ -2753,6 +2766,39 @@ } } +/* expire_temp_dlines() + * + * inputs - pointer to dline list + * output - + * side effects - dlines that have "expired" are cleared + */ +static void expire_temp_dlines(struct ConfItem **tdlines) +{ + struct ConfItem *ptr; + struct ConfItem *next_ptr; + struct ConfItem *last_ptr = NULL; + + for(ptr = *tdlines; ptr; ptr = next_ptr) + { + next_ptr = ptr->next; + + if(ptr->hold <= CurrentTime) + { + if(last_ptr != NULL) + last_ptr->next = ptr->next; + else + *tdlines = ptr->next; + +#ifdef TDLINE_EXPIRE_NOTICE + sendto_realops("Temporary D-line for [%s] expired", ptr->host); +#endif + free_conf(ptr); + } + else + last_ptr = ptr; + } +} + /* * find_tkline * @@ -2792,6 +2838,27 @@ return (NULL); } +/* find_tdline() + * + * inputs - hostname + * outputs - + * side effects - returns matching ConfItem or NULL + */ +struct ConfItem *find_tdline(unsigned long ip) +{ + struct ConfItem *ptr; + + expire_temp_dlines(&temporary_dlines); + + for(ptr = temporary_dlines; ptr; ptr = ptr->next) + { + if(ptr->ip && ((ip & ptr->ip_mask) == ptr->ip)) + return ptr; + } + + return NULL; +} + /* * find_is_klined() * @@ -2820,6 +2887,8 @@ found_aconf = find_matching_mtrie_conf(host, name, ntohl(ip)); if(found_aconf && (found_aconf->status & (CONF_ELINE|CONF_DLINE|CONF_KILL))) return(found_aconf); + else if((found_aconf = find_tdline(ntohl(ip)))) + return found_aconf; else return NULL; } @@ -2848,6 +2917,31 @@ else return NULL; } + +struct ConfItem * +is_tklined(const char *host,const char *name, unsigned long ip) +{ + struct ConfItem *found_aconf; + + if( (found_aconf = find_tkline(host, name, ip)) ) + return(found_aconf); + + return NULL; +} + +struct ConfItem * +is_pklined(const char *host,const char *name, unsigned long ip) +{ + struct ConfItem *found_aconf; + + found_aconf = find_matching_mtrie_conf(host, name, ip); + + if(found_aconf && (found_aconf->status & CONF_KILL)) + return(found_aconf); + else + return NULL; +} + /* add_temp_kline * @@ -2873,6 +2967,18 @@ } } +/* add_temp_dline() + * + * inputs - pointer to ConfItem + * outputs - + * side effects - ConfItem is added to dline list + */ +void add_temp_dline(struct ConfItem *aconf) +{ + aconf->next = temporary_dlines; + temporary_dlines = aconf; +} + /* flush_temp_klines * * inputs - NONE @@ -2925,6 +3031,28 @@ } +/* report_temp_dlines + * + * input - client to report to + * output - + * side effects - client is shown temp dline list + */ +void report_temp_dlines(struct Client *sptr) +{ + struct ConfItem *ptr; + char *name, *host, *pass, *user; + int port; + + expire_temp_dlines(&temporary_dlines); + for(ptr = temporary_dlines; ptr; ptr = ptr->next) + { + get_printable_conf(ptr, &name, &host, &pass, &user, &port); + + sendto_one(sptr, form_str(RPL_STATSDLINE), me.name, + sptr->name, 'd', host, pass); + } +} + /* show_temp_klines * * inputs - aClient pointer, client to report to @@ -3010,6 +3138,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; /* is marked as an admin */ + else if(*privs == 'a') + int_privs &= ~CONF_OPER_ADMIN; /* not an admin */ privs++; } return(int_privs); @@ -3105,6 +3237,16 @@ 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); @@ -3152,6 +3294,14 @@ int_flags |= FLAGS_EXTERNAL; else if(*flags == 'z') int_flags |= FLAGS_OPERWALL; + else if(*flags == 'l') + int_flags |= FLAGS_LOCOPS; + else if(*flags == 'u') + int_flags |= FLAGS_UNAUTH; + else if(*flags == 'j') + int_flags |= FLAGS_JUPE; + else if(*flags == 'a') + int_flags |= FLAGS_ADMIN; flags++; } @@ -3169,7 +3319,7 @@ char *oper_flags_as_string(int flags) { - static char flags_out[16]; + static char flags_out[18]; char *flags_ptr; flags_ptr = flags_out; @@ -3201,6 +3351,14 @@ *flags_ptr++ = 'x'; if(flags & FLAGS_OPERWALL) *flags_ptr++ = 'z'; + if(flags & FLAGS_LOCOPS) + *flags_ptr++ = 'l'; + if(flags & FLAGS_UNAUTH) + *flags_ptr++ = 'u'; + if(flags & FLAGS_JUPE) + *flags_ptr++ = 'j'; + if(flags & FLAGS_ADMIN) + *flags_ptr++ = 'a'; *flags_ptr = '\0'; return(flags_out); @@ -3413,7 +3571,14 @@ host, pass); } - else + else if((aconf = find_tdline(ip))) + { + get_printable_conf(aconf, &name, &host, &pass, &user, &port); + sendto_one(sptr, + ":%s NOTICE %s :Temp D-line host [%s] pass [%s]", + me.name, parv[0], host, pass); + } + else sendto_one(sptr, ":%s NOTICE %s :No aconf found", me.name, parv[0]); } @@ -3648,7 +3813,6 @@ zap_Dlines(); clear_special_conf(&x_conf); - clear_special_conf(&u_conf); clear_q_lines(); mark_listeners_closing(); } @@ -3681,121 +3845,6 @@ free_conf(tmp2); } } -} - -/* - * write_kline_or_dline_to_conf_and_notice_opers - * - * inputs - kline or dline type flag - * - client pointer to report to - * - server pointer to relay onto - * - user name of target - * - host name of target - * - reason for target - * - current tiny date string - * output - -1 if error on write, 0 if ok - * side effects - This function takes care of - * finding right kline or dline conf file, writing - * the right lines to this file, - * notifying the oper that their kline/dline is in place - * notifying the opers on the server about the k/d line - * forwarding the kline onto the next U lined server - * - * Bugs - This function is still doing too much - */ - -void write_kline_or_dline_to_conf_and_notice_opers( - KlineType type, - aClient *sptr, - aClient *rcptr, - char *user, - char *host, - char *reason, - char *current_date) - { - char buffer[1024]; - int out; - const char *filename; /* filename to use for kline */ - - filename = get_conf_name(type); - -#ifdef SLAVE_SERVERS - if(!IsServer(sptr)) -#endif - { - if(type == DLINE_TYPE) - { - sendto_realops("%s added D-Line for [%s] [%s]", - sptr->name, host, reason); - sendto_one(sptr, ":%s NOTICE %s :Added D-Line [%s] to %s", - me.name, sptr->name, host, filename); - } - else - { - sendto_realops("%s added K-Line for [%s@%s] [%s]", - sptr->name, user, host, reason); - sendto_one(sptr, ":%s NOTICE %s :Added K-Line [%s@%s] to %s", - me.name, sptr->name, user, host, filename); - } - } - - if ((out = open(filename, O_RDWR|O_APPEND|O_CREAT,0644))==-1) - { - sendto_realops("Problem opening %s ", filename); - return; - } - - fchmod(out, 0660); - -#ifdef SLAVE_SERVERS - if(IsServer(sptr)) - { - if((type==KLINE_TYPE) && rcptr) - ircsprintf(buffer, "#%s!%s@%s from %s K'd: %s@%s:%s\n", - rcptr->name, rcptr->username, rcptr->host, - sptr->name, - user, host, reason); - } - else -#endif - { - if(type==KLINE_TYPE) - ircsprintf(buffer, "#%s!%s@%s K'd: %s@%s:%s\n", - sptr->name, sptr->username, sptr->host, - user, host, reason); - else - ircsprintf(buffer, "#%s!%s@%s D'd: %s:%s\n", - sptr->name, sptr->username, sptr->host, - host, reason); - } - - if (safe_write(sptr,filename,out,buffer)) - return; - - if(type==KLINE_TYPE) - ircsprintf(buffer, "K:%s:%s (%s):%s\n", - host, - reason, - current_date, - user); - else - ircsprintf(buffer, "D:%s:%s (%s)\n", - host, - reason, - current_date); - - - if (safe_write(sptr,filename,out,buffer)) - return; - - close(out); - - if(type==KLINE_TYPE) - log(L_TRACE, "%s added K-Line for [%s@%s] [%s]", - sptr->name, user, host, reason); - else - log(L_TRACE, "%s added D-Line for [%s] [%s]", - sptr->name, host, reason); } /* diff -uNrd ircd-hybrid-6.3.1.dist/src/s_debug.c ircd-hybrid-6.3.1/src/s_debug.c --- ircd-hybrid-6.3.1.dist/src/s_debug.c Sun Dec 16 00:49:19 2001 +++ ircd-hybrid-6.3.1/src/s_debug.c Sat Apr 19 21:06:45 2003 @@ -178,23 +178,23 @@ sendto_one(cptr, - ":%s %d %s :CPU Secs %d:%d User %d:%d System %d:%d", + ":%s %d %s :CPU Secs %ld:%d User %ld:%d System %ld:%d", me.name, RPL_STATSDEBUG, nick, secs/60, secs%60, rus.ru_utime.tv_sec/60, rus.ru_utime.tv_sec%60, rus.ru_stime.tv_sec/60, rus.ru_stime.tv_sec%60); - sendto_one(cptr, ":%s %d %s :RSS %ld ShMem %d Data %d Stack %d", + sendto_one(cptr, ":%s %d %s :RSS %ld ShMem %ld Data %ld Stack %ld", me.name, RPL_STATSDEBUG, nick, rus.ru_maxrss, rus.ru_ixrss / rup, rus.ru_idrss / rup, rus.ru_isrss / rup); - sendto_one(cptr, ":%s %d %s :Swaps %d Reclaims %d Faults %d", + sendto_one(cptr, ":%s %d %s :Swaps %ld Reclaims %ld Faults %ld", me.name, RPL_STATSDEBUG, nick, rus.ru_nswap, rus.ru_minflt, rus.ru_majflt); - sendto_one(cptr, ":%s %d %s :Block in %d out %d", + sendto_one(cptr, ":%s %d %s :Block in %ld out %ld", me.name, RPL_STATSDEBUG, nick, rus.ru_inblock, rus.ru_oublock); - sendto_one(cptr, ":%s %d %s :Msg Rcv %d Send %d", + sendto_one(cptr, ":%s %d %s :Msg Rcv %ld Send %ld", me.name, RPL_STATSDEBUG, nick, rus.ru_msgrcv, rus.ru_msgsnd); - sendto_one(cptr, ":%s %d %s :Signals %d Context Vol. %d Invol %d", + sendto_one(cptr, ":%s %d %s :Signals %ld Context Vol. %ld Invol %ld", me.name, RPL_STATSDEBUG, nick, rus.ru_nsignals, rus.ru_nvcsw, rus.ru_nivcsw); diff -uNrd ircd-hybrid-6.3.1.dist/src/s_misc.c ircd-hybrid-6.3.1/src/s_misc.c --- ircd-hybrid-6.3.1.dist/src/s_misc.c Sun Feb 17 13:16:03 2002 +++ ircd-hybrid-6.3.1/src/s_misc.c Fri May 2 11:39:23 2003 @@ -43,22 +43,12 @@ #include #include #include - - -static char* months[] = { - "January", "February", "March", "April", - "May", "June", "July", "August", - "September", "October", "November","December" -}; - -static char* weekdays[] = { - "Sunday", "Monday", "Tuesday", "Wednesday", - "Thursday", "Friday", "Saturday" -}; +#include char* date(time_t clockval) { static char buf[80], plus; + static char tbuf[80]; struct tm *lt, *gm; struct tm gmbuf; int minswest; @@ -82,10 +72,8 @@ if (minswest < 0) minswest = -minswest; - ircsprintf(buf, "%s %s %d %d -- %t:%t:%t %c%t:%t", - weekdays[lt->tm_wday], months[lt->tm_mon],lt->tm_mday, - lt->tm_year + 1900, lt->tm_hour, lt->tm_min, lt->tm_sec, - plus, minswest/60, minswest%60); + strftime(tbuf, 80, "%A %e %B %Y -- %T", lt); + ircsprintf(buf, "%s %c%t:%t", tbuf, plus, minswest/60, minswest%60); return buf; } @@ -206,11 +194,11 @@ /* Make ISUPPORT string */ char *make_isupport() { - static char tisupport[200]; + static char tisupport[300]; ircsprintf(tisupport, "WALLCHOPS PREFIX=(ov)@+ CHANTYPES=#& MAXCHANNELS=%d " "MAXBANS=%d NICKLEN=%d TOPICLEN=%d KICKLEN=%d " - "NETWORK=%s " + "NETWORK=%s MAP CHARSET=rfc1459 CASEMAPPING=rfc1459 " #ifdef CHANMODE_E "CHANMODES=be,k,l,imnpst EXCEPTS" #else @@ -225,4 +213,118 @@ return tisupport; } +/* Handles an operator's time parameter, numbers are defaulted to +** minutes, d, h, w are accepted and are used to specify lengthier time +** periods. This allows opers to do /quote kline 1d ... +** instead of /quote kline 1440 ..., something easier to remember and +** far clearer. +** +** Return value: a time in minutes or 0. 0 symbolizes failure as per +** the original kline implementation. If the user explicitely sets 0 +** as a time, it will be changed to 1 as per Hybrid 6's m_kline.c. +*/ +int oper_time(char *timestr) +{ + int minutes = 0; + char digitbuf[11]; /* XXX define */ + int i = 0; + char *timeptr; + int bufval; + + /* Should never happen but... */ + if (timestr == NULL) + return 0; + + /* If there is not a digit here, it's a failure */ + if (!IsDigit(*timestr)) + return 0; + + for (timeptr = timestr; *timeptr != '\0'; timeptr++) + { + if (i == 10) + { + /* Not the best thing to do, but to avoid overflows... */ + break; + } + if (IsDigit(*timeptr)) + { + digitbuf[i] = *timeptr; + i++; + } + else + { + switch (*timeptr) + { + /* I personally don't recommend week long klines in Hybrid 6... + ** but it's here if wanted + */ + case 'w': + case 'W': + { + digitbuf[i] = '\0'; + bufval = atoi(digitbuf); + i = 0; + digitbuf[0] = '\0'; + minutes += (bufval * 10080); + break; + } + case 'd': + case 'D': + { + digitbuf[i] = '\0'; + bufval = atoi(digitbuf); + i = 0; + digitbuf[0] = '\0'; + minutes += (bufval * 1440); + break; + } + case 'h': + case 'H': + { + digitbuf[i] = '\0'; + bufval = atoi(digitbuf); + i = 0; + digitbuf[0] = '\0'; + minutes += (bufval * 60); + break; + } + case 'm': + case 'M': + { + digitbuf[i] = '\0'; + minutes += atoi(digitbuf); + i = 0; + digitbuf[0] = '\0'; + break; + } + case '.': + case '@': + case ':': /* For H7 ports */ + { + /* If any of these characters are found, this is LIKELY a + ** an address or a user@ something. It is considered a failure + ** and MUST be rejected + */ + return 0; + /* NOT REACHED */ + break; + } + default: + break; + } + } + } + + /* Ok, anything left will default to minutes */ + digitbuf[i] = '\0'; + minutes += atoi(digitbuf); + + /* This check is from the old implementation, to prevent /quote kline 0 ... + ** from working. The 0 will be turned into 1 minute. + */ + if (minutes == 0) + minutes = 1; + + return minutes; +} diff -uNrd ircd-hybrid-6.3.1.dist/src/s_serv.c ircd-hybrid-6.3.1/src/s_serv.c --- ircd-hybrid-6.3.1.dist/src/s_serv.c Mon Apr 15 18:38:22 2002 +++ ircd-hybrid-6.3.1/src/s_serv.c Fri May 2 11:41:05 2003 @@ -74,6 +74,11 @@ { "EX", CAP_EX }, { "CHW", CAP_CHW }, { "KNOCK", CAP_KNOCK }, +#ifdef HUB + { "KLN", CAP_KLN }, + { "UNKLN", CAP_UNKLN }, +#endif + { "ENCAP", CAP_ENCAP }, { 0, 0 } }; @@ -276,6 +281,11 @@ next = aconf->hold; } +#ifndef NEG_PORT + /* The negative ports kludge allows you to specify ports for every + ** server, just not autoconnect to each one. This message can get QUITE + ** annoying when using this feature, so just hide it -Hwy + */ if (0 == GlobalSetOptions.autoconn) { /* @@ -292,6 +302,7 @@ Debug((DEBUG_NOTICE,"Next connection check : %s", myctime(next))); return next; } +#endif if (connecting) { @@ -310,6 +321,8 @@ } if (!(con_conf->flags & CONF_FLAGS_ALLOW_AUTO_CONN)) { +#ifndef NEG_PORT +/* Same as above...hide these when using NEG_PORT */ #ifdef HIDE_SERVERS_IPS sendto_realops("Connection to %s not activated, autoconn is off.", con_conf->name); @@ -321,6 +334,7 @@ sendto_realops("WARNING AUTOCONN on %s[%s] is disabled", con_conf->name, con_conf->host); #endif +#endif /* NEG_PORT */ } else { @@ -501,6 +515,12 @@ acptr->hopcount + 1, acptr->tsinfo, ubuf, acptr->username, acptr->host, acptr->user->server, acptr->info); +#ifdef PROPAGATE_AWAY +#ifdef BURST_AWAY + if (acptr->user->away) + sendto_one(cptr, ":%s AWAY :%s", acptr->name, acptr->user->away); +#endif +#endif } } @@ -521,7 +541,10 @@ int tl; t = msgbuf; - tl = ircsprintf(msgbuf, "TS "); + if (IsServer(acptr) && (acptr->serv != NULL) && (acptr->serv->tsversion > 0)) + tl = ircsprintf(msgbuf, "TS:%d ", acptr->serv->tsversion); + else + tl = ircsprintf(msgbuf, "TS "); t += tl; /* Short circuit if no caps -- send back TS and that's it. */ @@ -942,11 +965,24 @@ for(cptr2 = serv_cptr_list; cptr2; cptr2 = cptr2->next_server_client) { - ++j; - sendto_one(cptr, ":%s %d %s :%s (%s!%s@%s) Idle: %d", + time_t days, hours, minutes, seconds; + + seconds = CurrentTime; + seconds -= cptr2->firsttime; + + days = seconds / 86400; + seconds %= 86400; + hours = seconds / 3600; + seconds %= 3600; + minutes = seconds / 60; + seconds %= 60; + sendto_one(cptr, ":%s %d %s :%s (%s!%s@%s) Idle: %d Connected: %ld day%s %ld:%ld:%ld", me.name, RPL_STATSDEBUG, cptr->name, cptr2->name, (cptr2->serv->by[0] ? cptr2->serv->by : "Remote."), - "*", "*", CurrentTime - cptr2->lasttime); + "*", "*", CurrentTime - cptr2->lasttime, + days, (days == 1) ? "" : "s", hours, minutes, seconds); + + j++; /* * NOTE: moving the username and host to the client struct diff -uNrd ircd-hybrid-6.3.1.dist/src/s_user.c ircd-hybrid-6.3.1/src/s_user.c --- ircd-hybrid-6.3.1.dist/src/s_user.c Wed Jan 23 13:39:08 2002 +++ ircd-hybrid-6.3.1/src/s_user.c Sat Apr 26 19:35:03 2003 @@ -53,6 +53,8 @@ #include "dbuf.h" #endif +#include "m_flags.h" + #include #include #include @@ -75,6 +77,7 @@ static FLAG_ITEM user_modes[] = { + {FLAGS_ADMIN, 'a'}, {FLAGS_BOTS, 'b'}, {FLAGS_CCONN, 'c'}, {FLAGS_DEBUG, 'd'}, @@ -90,6 +93,9 @@ {FLAGS_EXTERNAL, 'x'}, {FLAGS_SPY, 'y'}, {FLAGS_OPERWALL, 'z'}, + {FLAGS_LOCOPS, 'l'}, + {FLAGS_UNAUTH, 'u'}, + {FLAGS_JUPE, 'j'}, {0, 0} }; @@ -130,7 +136,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 */ @@ -139,9 +145,9 @@ 0, /* g */ 0, /* h */ FLAGS_INVISIBLE, /* i */ - 0, /* j */ + FLAGS_JUPE, /* j */ FLAGS_SKILL, /* k */ - 0, /* l */ + FLAGS_LOCOPS, /* l */ 0, /* m */ FLAGS_NCHANGE, /* n */ FLAGS_OPER, /* o */ @@ -150,7 +156,7 @@ FLAGS_REJ, /* r */ FLAGS_SERVNOTICE, /* s */ 0, /* t */ - 0, /* u */ + FLAGS_UNAUTH, /* u */ 0, /* v */ FLAGS_WALLOP, /* w */ FLAGS_EXTERNAL, /* x */ @@ -171,7 +177,18 @@ unsigned long my_rand(void); /* provided by orabidoo */ - +char oper_type_char(struct Client *cptr) +{ + /* This should never happen -Hwy */ + if (!IsAnOper(cptr)) + return 'x'; + if (cptr->umodes & FLAGS_ADMIN) + return 'A'; + if (IsOper(cptr)) + return 'O'; + /* else */ + return 'o'; +} /* * show_opers - send the client a list of opers @@ -191,7 +208,7 @@ { sendto_one(cptr, ":%s %d %s :[%c][%s] %s (%s@%s) Idle: %d", me.name, RPL_STATSDEBUG, cptr->name, - IsOper(cptr2) ? 'O' : 'o', + oper_type_char(cptr2), oper_privs_as_string(cptr2, cptr2->confs->value.aconf->port), cptr2->name, @@ -202,7 +219,7 @@ { sendto_one(cptr, ":%s %d %s :[%c] %s (%s@%s) Idle: %d", me.name, RPL_STATSDEBUG, cptr->name, - IsOper(cptr2) ? 'O' : 'o', + oper_type_char(cptr2), cptr2->name, cptr2->username, cptr2->host, CurrentTime - cptr2->user->last); @@ -225,6 +242,9 @@ static int o_count = 0, m_client = 0, m_servers = 0; int forced; struct Client *acptr; +#ifdef SAVE_MAXCLIENT + static time_t last_stat_save = 0; +#endif /* forced = (parc >= 2); */ forced = (IsAnOper(sptr) && (parc > 3)); @@ -340,6 +360,14 @@ Count.unknown = u_count; } /* Complain & reset loop */ } /* Recount loop */ + +#ifdef SAVE_MAXCLIENT + if ((CurrentTime - last_stat_save) > SAVE_TIME) + { + write_stats(); + last_stat_save = CurrentTime; + } +#endif #ifndef SHOW_INVISIBLE_LUSERS if (IsAnOper(sptr) && i_count) @@ -479,6 +507,105 @@ return (ch - nick); } +/* + * check_clones + * This function counts the number of clients with the + * same host as cptr that connected less than CHECK_CLONE_PERIOD + * seconds ago. + * return value + * -1: reject connections + * 0: permit connections + * -SeKs -record + */ +#ifdef CHECK_CLONE +static int check_clones(aClient * cptr) +{ + struct abacklog + { + time_t last; + char host[HOSTLEN]; + int count; + struct abacklog *next; + }; + + static struct abacklog *backlog = NULL; + struct abacklog **blscn = &backlog, *blptr; + Link *tmp; + + /* First, check to see if any of the conf items associated with this + ** user define it as "Clone Exempt" + */ + for (tmp = cptr->confs; tmp; tmp = tmp->next) + { + if (!tmp->value.aconf) + continue; + if (IsConfCloneExempt(tmp->value.aconf)) + return 0; + } + + /* Find the host we're interested in. While we're at it, we'll + * clean out expired elements from the list. */ + + while ((*blscn != NULL) && (strcmp(cptr->host, (*blscn)->host))) + { + if ((*blscn)->last + GlobalSetOptions.clone_period < CurrentTime) + { /* expired; remove */ + if ((*blscn)->count == -1) + sendto_realops_flags(FLAGS_REJ,"Removing throttle for %s.", + (*blscn)->host); + blptr = *blscn; + *blscn = blptr->next; + MyFree((char *)blptr); + } + else + blscn = &(*blscn)->next; + } + + if (*blscn) /* There is a record for this host */ + { + if (!((*blscn)->last + GlobalSetOptions.clone_period < CurrentTime)) /* not expired */ + { + (*blscn)->last = CurrentTime; + if ((*blscn)->count == -1) + return (-1); + else + { + (*blscn)->count++; + if (((*blscn)->count == GlobalSetOptions.clone_num) && !IsFlined(cptr)) + { + sendto_realops_flags(FLAGS_REJ,"Throttling connections from %s.", + (*blscn)->host); + (*blscn)->count = -1; + return (-1); + } + else + return (0); + } + } + else + /* expired */ + { + if ((*blscn)->count == -1) + sendto_realops_flags(FLAGS_REJ,"Removing throttle for %s.", + (*blscn)->host); + (*blscn)->last = CurrentTime; + (*blscn)->count = 1; + return (0); + } + } + else + /* no record for host; make one */ + { + blptr = (struct abacklog *)MyMalloc(sizeof(struct abacklog)); + strncpy_irc(blptr->host, cptr->host, HOSTLEN); + blptr->next = backlog; + blptr->last = CurrentTime; + blptr->count = 1; + backlog = blptr; + return (0); + } +} +#endif /* ** register_user @@ -504,7 +631,7 @@ ** nick from local user or kill him/her... */ -static int register_user(aClient *cptr, aClient *sptr, +int register_user(aClient *cptr, aClient *sptr, char *nick, char *username) { aConfItem* aconf; @@ -571,7 +698,7 @@ ServerStats->is_ref++; /* jdc - lists server name & port connections are on */ /* a purely cosmetical change */ - sendto_realops_flags(FLAGS_CCONN, + sendto_realops_flags(FLAGS_UNAUTH, "%s from %s [%s] on [%s/%u].", "Unauthorized client connection", get_client_host(sptr), @@ -655,7 +782,12 @@ } /* password check */ +#ifdef CRYPT_AUTH_PASSWORD + if (!BadPtr(aconf->passwd) && 0 != strcmp(crypt(sptr->passwd, + aconf->passwd), aconf->passwd)) +#else if (!BadPtr(aconf->passwd) && 0 != strcmp(sptr->passwd, aconf->passwd)) +#endif { ServerStats->is_ref++; sendto_one(sptr, form_str(ERR_PASSWDMISMATCH), @@ -700,6 +832,25 @@ } /* end of valid user name check */ +#ifdef CHECK_CLONE + + /* + * Add this local client into the clone check database. If the + * site has been throttled, reject the user. -SeKs -record + */ + + if (check_clones(sptr) == -1 +#ifdef CHECK_CLONE_DELAY + && me.since + CHECK_CLONE_DELAY < CurrentTime +#endif + ) + { + ServerStats->is_ref++; + return exit_client(cptr, sptr, &me, + "Too many connections from your host -- throttled"); + } +#endif + if(!IsAnOper(sptr)) { char *xreason; @@ -738,13 +889,21 @@ #endif sendto_realops_flags(FLAGS_CCONN, +#ifdef GECOS_CLICONNECT + "Client connecting: %s (%s@%s) [%s] {%d} [%s]", +#else "Client connecting: %s (%s@%s) [%s] {%d}", +#endif nick, sptr->username, sptr->host, #ifdef HIDE_SPOOF_IPS IsIPSpoof(sptr) ? "255.255.255.255" : #endif /* HIDE_SPOOF_IPS */ inetntoa((char *)&sptr->ip), +#ifdef GECOS_CLICONNECT + get_client_class(sptr), sptr->info); +#else get_client_class(sptr)); +#endif if(IsInvisible(sptr)) Count.invisi++; @@ -773,6 +932,7 @@ return exit_client(NULL, sptr, &me, "Ghost"); } add_client_to_llist(&(sptr->servptr->serv->users), sptr); + sptr->servptr->serv->usercnt++; /* Increment our total user count here */ if (++Count.total > Count.max_tot) @@ -780,7 +940,8 @@ if (MyConnect(sptr)) { - sendto_one(sptr, form_str(RPL_WELCOME), me.name, nick, nick); + sendto_one(sptr, form_str(RPL_WELCOME), me.name, nick, NETWORK_NAME, + nick, sptr->username, inetntoa((char *)&sptr->ip)); /* This is a duplicate of the NOTICE but see below...*/ sendto_one(sptr, form_str(RPL_YOURHOST), me.name, nick, get_listener_name(sptr->listener), ircd_version); @@ -823,18 +984,24 @@ #else SendMessageFile(sptr, &ConfigFileEntry.motd); #endif - + #ifdef LITTLE_I_LINES if(sptr->confs && sptr->confs->value.aconf && (sptr->confs->value.aconf->flags & CONF_FLAGS_LITTLE_I_LINE)) { SetRestricted(sptr); - sendto_one(sptr,"NOTICE %s :*** Notice -- You are in a restricted access mode",nick); - sendto_one(sptr,"NOTICE %s :*** Notice -- You can not chanop others",nick); + sendto_one(sptr,form_str(ERR_RESTRICTED),me.name, sptr->name); } #endif +#if defined(FLAGS_COMMAND) && defined(FLAGS_ANNOUNCE) + sendto_one(sptr, ":%s NOTICE %s :Current flags:%s", + me.name, parv[0], set_flags_to_string(sptr)); + sendto_one(sptr, ":%s NOTICE %s :Current missing flags:%s", + me.name, parv[0], unset_flags_to_string(sptr)); +#endif + #ifdef NEED_SPLITCODE if (server_was_split) { @@ -1196,6 +1363,11 @@ sendto_common_channels(sptr, ":%s NICK :%s", parv[0], nick); if (sptr->user) +#ifdef ANTI_IP_SPOOF + /* Don't send out a nick-change if they haven't PONG'd us + * because they haven't registered yet if they haven't! -JailBird */ + if ((!MyConnect(sptr)) || (sptr->flags2 & FLAGS2_GOT_ANTI_SPOOF_PING)) +#endif { add_history(sptr,1); @@ -1245,6 +1417,19 @@ ** may reject the client and call exit_client for it ** --must test this and exit m_nick too!!! */ +/* anti ip sequence prediction spoof code + it needs a good going over by someone else, but it + works... -Dianora +*/ +#ifdef ANTI_IP_SPOOF + if(MyConnect(sptr)) + { + strcpy(sptr->name,nick); + sptr->random_ping = (unsigned int)my_rand(); + sendto_one(sptr, "PING :%u", sptr->random_ping); + sptr->flags |= FLAGS_PINGSENT; + } else +#endif if (register_user(cptr, sptr, nick, buf) == CLIENT_EXITED) return CLIENT_EXITED; } @@ -1921,6 +2106,22 @@ } strncpy_irc(sptr->info, realname, REALLEN); +#ifdef ANTI_IP_SPOOF + user->last = CurrentTime; + if(MyConnect(sptr)) + { + if (sptr->name[0]) /* NICK already received, now I have USER... */ + { + sptr->random_ping = (unsigned int)my_rand(); + sendto_one(sptr, "PING :%u", sptr->random_ping); + sptr->flags |= FLAGS_PINGSENT; + } + if (!IsGotId(sptr)) + strncpy_irc(sptr->username, username, USERLEN); + return 0; + } +#endif + if (sptr->name[0]) /* NICK already received, now I have USER... */ return register_user(cptr, sptr, sptr->name, username); else @@ -2048,6 +2249,11 @@ aClient *prev_cptr = (aClient *)NULL; aClient *cur_cptr = oper_cptr_list; +#ifdef DEOPER_NOTICE + sendto_realops_flags(FLAGS_SPY, + "operator %s has removed operator status", sptr->name); +#endif + fdlist_delete(sptr->fd, FDL_OPER | FDL_BUSY); detach_conf(sptr,sptr->confs->value.aconf); sptr->flags2 &= ~(FLAGS2_OPER_GLOBAL_KILL| @@ -2109,6 +2315,13 @@ sptr->umodes &= ~FLAGS_NCHANGE; /* only tcm's really need this */ } + if (MyOper(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)) ++Count.invisi; if ((setflags & FLAGS_INVISIBLE) && !IsInvisible(sptr)) @@ -2204,5 +2417,30 @@ } if (cptr && MyClient(cptr)) - send_umode(cptr, sptr, old, ALL_UMODES, buf); + { + send_umode(cptr, sptr, old, ALL_UMODES, buf); +#if defined(FLAGS_COMMAND) && defined(FLAGS_ANNOUNCE) + sendto_one(cptr, ":%s NOTICE %s :Current flags:%s", + me.name, cptr->name, set_flags_to_string(cptr)); + sendto_one(cptr, ":%s NOTICE %s :Current missing flags:%s", + me.name, cptr->name, unset_flags_to_string(cptr)); +#endif + } } + +#ifdef POST_REGISTER +int +m_webproxy(aClient *cptr, aClient *sptr, int parc, char *parv[]) +{ + if (IsUnknown(sptr) && MyConnect(sptr)) + { + sendto_realops_flags(FLAGS_REJ, + "HTTP Proxy disconnected: [%s@%s]", + cptr->username, cptr->host); + return m_quit(cptr, sptr, parc, parv); + } + else + return 0; +} +#endif + diff -uNrd ircd-hybrid-6.3.1.dist/src/s_zip.c ircd-hybrid-6.3.1/src/s_zip.c --- ircd-hybrid-6.3.1.dist/src/s_zip.c Mon Jun 4 01:07:19 2001 +++ ircd-hybrid-6.3.1/src/s_zip.c Sat Apr 19 21:06:45 2003 @@ -283,7 +283,7 @@ default: /* error ! */ /* should probably mark link as dead or something... */ - sendto_realops("inflate() error(%d): %s", r, + sendto_realops("inflate() error(%d): %s: %s", r, zError(r), (zin->msg) ? zin->msg : "?"); *length = -1; /* report error condition */ break; @@ -340,7 +340,8 @@ return zipbuf; default: /* error ! */ - sendto_realops("deflate() error(%d): %s", r, (zout->msg) ? zout->msg : "?"); + sendto_realops("deflate() error(%d): %s: %s", r, zError(r), + (zout->msg) ? zout->msg : "?"); *length = -1; break; } diff -uNrd ircd-hybrid-6.3.1.dist/src/send.c ircd-hybrid-6.3.1/src/send.c --- ircd-hybrid-6.3.1.dist/src/send.c Sat Feb 2 15:58:30 2002 +++ ircd-hybrid-6.3.1/src/send.c Fri May 2 18:24:22 2003 @@ -674,7 +674,7 @@ */ void send_knock(aClient *sptr, aClient *cptr, aChannel *chptr, int type, - char *message, char *key) + char *name, char *key) { Link *lp; aClient *acptr; @@ -694,8 +694,8 @@ if(MyClient(acptr)) { - sendto_prefix_one(acptr, sptr, ":%s NOTICE %s :%s", - sptr->name, acptr->name, message); + sendto_one(acptr, form_str(RPL_KNOCK), me.name, name, name, + sptr->name, sptr->username, sptr->host); continue; } @@ -710,9 +710,14 @@ sentalong[lindex] = current_serial; } +#if 0 + /* 7 and ratbox don't propagate this. With this rewrite, we probably + ** shouldn't either. + */ else sendto_one(acptr, ":%s NOTICE %s :%s", sptr->name, acptr->name, message); +#endif } } } @@ -1215,7 +1220,7 @@ */ void -send_operwall(aClient *from, char *type_message, char *message) +send_operwall(aClient *from, char *type_message, char *message, int locops) { char sender[NICKLEN + USERLEN + HOSTLEN + 5]; @@ -1245,10 +1250,21 @@ for (acptr = oper_cptr_list; acptr; acptr = acptr->next_oper_client) { - if (!SendOperwall(acptr)) - continue; /* has to be oper if in this linklist */ + /* kludge - operwall isnt used often enough for it to affect stuff */ + if(locops) + { + if(!SendLocops(acptr)) + continue; - sendto_one(acptr, ":%s WALLOPS :%s - %s", sender, type_message, message); + sendto_one(acptr, ":%s WALLOPS :%s - %s", sender, type_message, message); + } + else + { + if (!SendOperwall(acptr)) + continue; /* has to be oper if in this linklist */ + + sendto_one(acptr, ":%s WALLOPS :%s - %s", sender, type_message, message); + } } } /* send_operwall() */ @@ -1525,52 +1541,3 @@ (void)send_queued(cptr); } /* flush_server_connections() */ -#ifdef SLAVE_SERVERS - -extern aConfItem *u_conf; - -int -sendto_slaves(aClient *one, char *message, char *nick, int parc, char *parv[]) - -{ - aClient *acptr; - aConfItem *aconf; - - for(acptr = serv_cptr_list; acptr; acptr = acptr->next_server_client) - { - if (one == acptr) - continue; - - for (aconf = u_conf; aconf; aconf = aconf->next) - { - if (match(acptr->name,aconf->name)) - { - if(parc > 3) - sendto_one(acptr,":%s %s %s %s %s :%s", - me.name, - message, - nick, - parv[1], - parv[2], - parv[3]); - else if(parc > 2) - sendto_one(acptr,":%s %s %s %s :%s", - me.name, - message, - nick, - parv[1], - parv[2]); - else if(parc > 1) - sendto_one(acptr,":%s %s %s :%s", - me.name, - message, - nick, - parv[1]); - } /* if (match(acptr->name,aconf->name)) */ - } /* for (aconf = u_conf; aconf; aconf = aconf->next) */ - } /* for(acptr = serv_cptr_list; acptr; acptr = acptr->next_server_client) */ - - return 0; -} /* sendto_slaves() */ - -#endif /* SLAVE_SERVERS */ diff -uNrd ircd-hybrid-6.3.1.dist/src/sprintf_irc.c ircd-hybrid-6.3.1/src/sprintf_irc.c --- ircd-hybrid-6.3.1.dist/src/sprintf_irc.c Sat Dec 8 12:55:06 2001 +++ ircd-hybrid-6.3.1/src/sprintf_irc.c Sat Apr 19 21:06:45 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: sprintf_irc.c,v 1.11 2001/12/08 17:55:06 db Exp $ + * $Id: sprintf_irc.c,v 1.12 2002/06/12 19:31:22 androsyn Exp $ */ #include "sprintf_irc.h" @@ -305,6 +305,12 @@ ++format; v1 = va_arg(args, unsigned long); + if(v1 == 0) + { + *str++ = '0'; + ++bytes; + continue; + } if (v1 > 999999999L) { v2 = v1 / 1000000000; diff -uNrd ircd-hybrid-6.3.1.dist/tools/install_ircd ircd-hybrid-6.3.1/tools/install_ircd --- ircd-hybrid-6.3.1.dist/tools/install_ircd Tue Jul 3 17:52:19 2001 +++ ircd-hybrid-6.3.1/tools/install_ircd Sat Apr 19 21:24:03 2003 @@ -140,16 +140,16 @@ echo installing viconf as ${DPATH}viconf${EXESUFFIX} $INSTALL_SH -c tools/viconf${EXESUFFIX} ${DPATH}viconf${EXESUFFIX} rm -f ${DPATH}vimotd${EXESUFFIX} ${DPATH}viklines${EXESUFFIX} - ln ${DPATH}viconf${EXESUFFIX} ${DPATH}vimotd${EXESUFFIX} - ln ${DPATH}viconf${EXESUFFIX} ${DPATH}viklines${EXESUFFIX}; + ln -s ${DPATH}viconf${EXESUFFIX} ${DPATH}vimotd${EXESUFFIX} + ln -s ${DPATH}viconf${EXESUFFIX} ${DPATH}viklines${EXESUFFIX}; else echo installing viconf as ${DPATH}viconf${EXESUFFIX} echo previous viconf saved as viconf${EXESUFFIX}.old mv ${DPATH}viconf${EXESUFFIX} ${DPATH}viconf${EXESUFFIX}.old $INSTALL_SH -c tools/viconf${EXESUFFIX} ${DPATH}viconf${EXESUFFIX} rm -f ${DPATH}vimotd${EXESUFFIX} ${DPATH}viklines${EXESUFFIX} - ln ${DPATH}viconf${EXESUFFIX} ${DPATH}vimotd${EXESUFFIX} - ln ${DPATH}viconf${EXESUFFIX} ${DPATH}viklines${EXESUFFIX}; + ln -s ${DPATH}viconf${EXESUFFIX} ${DPATH}vimotd${EXESUFFIX} + ln -s ${DPATH}viconf${EXESUFFIX} ${DPATH}viklines${EXESUFFIX}; fi # install ircd.8 diff -uNrd ircd-hybrid-6.3.1.dist/tools/mkpasswd.c ircd-hybrid-6.3.1/tools/mkpasswd.c --- ircd-hybrid-6.3.1.dist/tools/mkpasswd.c Thu Oct 25 00:28:51 2001 +++ ircd-hybrid-6.3.1/tools/mkpasswd.c Thu May 8 12:44:01 2003 @@ -5,44 +5,66 @@ ** md5 patch by W. Campbell ** Modernization, getopt, etc for the Hybrid IRCD team ** by W. Campbell +** +** /dev/random for salt generation added by +** Aaron Sethman ** -** $Id: mkpasswd.c,v 1.11 2001/10/25 04:28:51 wcampbel Exp $ +** $Id: mkpasswd.c,v 1.32 2003/05/05 18:06:37 wcampbel Exp $ */ #include #include #include #include #include +#include #define FLAG_MD5 0x00000001 #define FLAG_DES 0x00000002 #define FLAG_SALT 0x00000004 #define FLAG_PASS 0x00000008 #define FLAG_LENGTH 0x00000010 +#define FLAG_BLOWFISH 0x00000020 +#define FLAG_ROUNDS 0x00000040 +#define FLAG_EXT 0x00000080 +#define FLAG_RAW 0x00000100 extern char *getpass(); extern char *crypt(); char *make_des_salt(); +char *make_ext_salt(int); +char *make_ext_salt_para(int, char *); char *make_md5_salt(int); char *make_md5_salt_para(char *); -void usage(); -static char saltChars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./"; +char *make_bf_salt(int, int); +char *make_bf_salt_para(int, char *); +char *int_to_base64(int); +char *generate_random_salt(char *, int); +char *generate_poor_salt(char *, int); + +void full_usage(); +void brief_usage(); + +static char saltChars[] = + "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + /* 0 .. 63, ascii - 64 */ int main(int argc, char *argv[]) { char *plaintext = NULL; extern char *optarg; - extern int optind; int c; char *saltpara = NULL; char *salt; int flag = 0; - int length = 8; - - srandom(time(NULL)); + int length = 0; /* Not Set */ + int rounds = 0; /* Not set, since extended DES needs 25 and blowfish needs + ** 4 by default, a side effect of this being the encryption + ** type parameter must be specified before the rounds + ** parameter. + */ - while( (c=getopt(argc, argv, "mdh?l:s:p:")) != -1) + while( (c=getopt(argc, argv, "mdber:h?l:s:p:R:")) != -1) { switch(c) { @@ -52,10 +74,22 @@ case 'd': flag |= FLAG_DES; break; + case 'b': + flag |= FLAG_BLOWFISH; + rounds = 4; + break; + case 'e': + flag |= FLAG_EXT; + rounds = 25; + break; case 'l': flag |= FLAG_LENGTH; length = atoi(optarg); break; + case 'r': + flag |= FLAG_ROUNDS; + rounds = atoi(optarg); + break; case 's': flag |= FLAG_SALT; saltpara = optarg; @@ -64,9 +98,17 @@ flag |= FLAG_PASS; plaintext = optarg; break; + case 'R': + flag |= FLAG_RAW; + saltpara = optarg; + break; case 'h': + full_usage(); + /* NOT REACHED */ + break; case '?': - usage(); + brief_usage(); + /* NOT REACHED */ break; default: printf("Invalid Option: -%c\n", c); @@ -76,12 +118,47 @@ if (flag & FLAG_MD5) { + if (length == 0) + length = 8; if (flag & FLAG_SALT) salt = make_md5_salt_para(saltpara); else salt = make_md5_salt(length); } - else + else if (flag & FLAG_BLOWFISH) + { + if (length == 0) + length = 22; + if (flag & FLAG_SALT) + salt = make_bf_salt_para(rounds, saltpara); + else + salt = make_bf_salt(rounds, length); + } + else if (flag & FLAG_EXT) + { + /* XXX - rounds needs to be done */ + if (flag & FLAG_SALT) + { + if ((strlen(saltpara) == 4)) + { + salt = make_ext_salt_para(rounds, saltpara); + } + else + { + printf("Invalid salt, please enter 4 alphanumeric characters\n"); + exit(1); + } + } + else + { + salt = make_ext_salt(rounds); + } + } + else if (flag & FLAG_RAW) + { + salt = saltpara; + } + else /* Default to DES */ { if (flag & FLAG_SALT) { @@ -118,12 +195,46 @@ char *make_des_salt() { static char salt[3]; - salt[0] = saltChars[random() % 64]; - salt[1] = saltChars[random() % 64]; + generate_random_salt(salt, 2); salt[2] = '\0'; return salt; } +char *int_to_base64(int value) +{ + static char buf[5]; + int i; + + for (i = 0; i < 4; i++) + { + buf[i] = saltChars[value & 63]; + value >>= 6; /* Right shifting 6 places is the same as dividing by 64 */ + } + + buf[i] = '\0'; /* not REALLY needed as it's static, and thus initialized + ** to \0. + */ + return buf; +} + +char *make_ext_salt(int rounds) +{ + static char salt[10]; + + sprintf(salt, "_%s", int_to_base64(rounds)); + generate_random_salt(&salt[5], 4); + salt[9] = '\0'; + return salt; +} + +char *make_ext_salt_para(int rounds, char *saltpara) +{ + static char salt[10]; + + sprintf(salt, "_%s%s", int_to_base64(rounds), saltpara); + return salt; +} + char *make_md5_salt_para(char *saltpara) { static char salt[21]; @@ -145,7 +256,6 @@ char *make_md5_salt(int length) { static char salt[21]; - int i; if (length > 16) { printf("MD5 salt length too long\n"); @@ -154,21 +264,112 @@ salt[0] = '$'; salt[1] = '1'; salt[2] = '$'; - for (i=3; i<(length+3); i++) - salt[i] = saltChars[random() % 64]; + generate_random_salt(&salt[3], length); salt[length+3] = '$'; salt[length+4] = '\0'; return salt; } -void usage() +char *make_bf_salt_para(int rounds, char *saltpara) { - printf("mkpasswd [-m|-d] [-l saltlength] [-s salt] [-p plaintext]\n"); + static char salt[31]; + char tbuf[3]; + if (saltpara && (strlen(saltpara) <= 22)) + { + /* sprintf used because of portability requirements, the length + ** is checked above, so it should not be too much of a concern + */ + sprintf(tbuf, "%02d", rounds); + sprintf(salt, "$2a$%s$%s$", tbuf, saltpara); + return salt; + } + printf("Invalid Salt, please use up to 22 random alphanumeric characters\n"); + exit(1); + + /* NOT REACHED */ + return NULL; +} + +char *make_bf_salt(int rounds, int length) +{ + static char salt[31]; + char tbuf[3]; + if (length > 22) + { + printf("BlowFish salt length too long\n"); + exit(0); + } + sprintf(tbuf, "%02d", rounds); + sprintf(salt, "$2a$%s$", tbuf); + generate_random_salt(&salt[7], length); + salt[length+7] = '$'; + salt[length+8] = '\0'; + return salt; +} + +char *generate_poor_salt(char *salt, int length) +{ + int i; + srandom(time(NULL)); + for(i = 0; i < length; i++) + { + salt[i] = saltChars[random() % 64]; + } + return(salt); +} + +char *generate_random_salt(char *salt, int length) +{ + char *buf; + int fd, i; + if((fd = open("/dev/random", O_RDONLY)) < 0) + { + return(generate_poor_salt(salt, length)); + } + buf = calloc(1, length); + if(read(fd, buf, length) != length) + { + free(buf); + return(generate_poor_salt(salt, length)); + } + + for(i = 0; i < length; i++) + { + salt[i] = saltChars[abs(buf[i]) % 64]; + } + free(buf); + return(salt); +} + +void full_usage() +{ + printf("mkpasswd [-m|-d|-b|-e] [-l saltlength] [-r rounds] [-s salt] [-p plaintext]\n"); + printf(" [-R rawsalt]\n"); printf("-m Generate an MD5 password\n"); printf("-d Generate a DES password\n"); - printf("-l Specify a length for a random MD5 salt\n"); - printf("-s Specify a salt, 2 alphanumeric characters for DES, up to 16 for MD5\n"); + printf("-b Generate a BlowFish password\n"); + printf("-e Generate an Extended DES password\n"); + printf("-l Specify a length for a random MD5 or BlowFish salt\n"); + printf("-r Specify a number of rounds for a BlowFish or Extended DES password\n"); + printf(" BlowFish: default 4, no more than 6 recommended\n"); + printf(" Extended DES: default 25\n"); + printf("-s Specify a salt, 2 alphanumeric characters for DES, up to 16 for MD5,\n"); + printf(" up to 22 for BlowFish, and 4 for Extended DES\n"); printf("-p Specify a plaintext password to use\n"); + printf("-R Specify a raw salt passed directly to crypt()\n"); printf("Example: mkpasswd -m -s 3dr -p test\n"); + exit(0); +} + +void brief_usage() +{ + printf("mkpasswd - password hash generator\n"); + printf("Standard DES: mkpasswd [-d] [-s salt] [-p plaintext]\n"); + printf("Extended DES: mkpasswd -e [-r rounds] [-s salt] [-p plaintext]\n"); + printf(" MD5: mkpasswd -m [-l saltlength] [-s salt] [-p plaintext]\n"); + printf(" BlowFish: mkpasswd -b [-r rounds] [-l saltlength] [-s salt]\n"); + printf(" [-p plaintext]\n"); + printf(" Raw: mkpasswd -R [-p plaintext]\n"); + printf("Use -h for full usage\n"); exit(0); } diff -uNrd ircd-hybrid-6.3.1.dist/tools/viconf.c ircd-hybrid-6.3.1/tools/viconf.c --- ircd-hybrid-6.3.1.dist/tools/viconf.c Tue Jul 3 17:52:19 2001 +++ ircd-hybrid-6.3.1/tools/viconf.c Fri Apr 25 22:47:22 2003 @@ -1,7 +1,7 @@ /* * viconf.c * - * $Id: viconf.c,v 1.13 2001/07/03 21:52:19 wcampbel Exp $ + * $Id: viconf.c,v 7.6 2002/11/29 17:28:30 leeh Exp $ */ #include #include @@ -26,13 +26,13 @@ #include #endif -static int LockedFile(char *filename); +static int LockedFile(const char *filename); static char lockpath[PATH_MAX + 1]; int main(int argc, char *argv[]) { - char *ed, *p, *filename = CPATH; + const char *ed, *p, *filename = CPATH; if( chdir(DPATH) < 0 ) { @@ -54,7 +54,7 @@ if(LockedFile(filename)) { - fprintf(stderr,"Cant' lock %s\n", filename); + fprintf(stderr,"Can't lock %s\n", filename); exit(errno); } @@ -64,9 +64,9 @@ case -1: fprintf(stderr, "error forking, %d\n", errno); exit(errno); - case 0: /* Child */ + case 0: /* Child */ if((ed = getenv("EDITOR")) == NULL) - ed = "vi"; + ed = "vi"; execlp(ed, ed, filename, NULL); fprintf(stderr, "error running editor, %d\n", errno); exit(errno); @@ -93,7 +93,7 @@ static int -LockedFile(char *filename) +LockedFile(const char *filename) { @@ -104,34 +104,34 @@ if (!filename) return (0); - + sprintf(lockpath, "%s.lock", filename); - - if ((fileptr = fopen(lockpath, "r")) != (FILE *) NULL) + + if ((fileptr = fopen(lockpath, "r")) != NULL) { if (fgets(buffer, sizeof(buffer) - 1, fileptr)) - { - /* - * If it is a valid lockfile, 'buffer' should now - * contain the pid number of the editing process. - * Send the pid a SIGCHLD to see if it is a valid - * pid - it could be a remnant left over from a - * crashed editor or system reboot etc. - */ - - killret = kill(atoi(buffer), SIGCHLD); - if (killret == 0) - { - fclose(fileptr); - return (1); - } + { + /* + * If it is a valid lockfile, 'buffer' should now + * contain the pid number of the editing process. + * Send the pid a SIGCHLD to see if it is a valid + * pid - it could be a remnant left over from a + * crashed editor or system reboot etc. + */ + + killret = kill(atoi(buffer), SIGCHLD); + if (killret == 0) + { + fclose(fileptr); + return (1); + } - /* - * killret must be -1, which indicates an error (most - * likely ESRCH - No such process), so it is ok to - * proceed writing klines. - */ - } + /* + * killret must be -1, which indicates an error (most + * likely ESRCH - No such process), so it is ok to + * proceed writing klines. + */ + } fclose(fileptr); } @@ -148,7 +148,7 @@ } fileptr = fdopen(fd,"w"); - fprintf(fileptr,"%d\n",(int) getpid()); + fprintf(fileptr,"%d\n",(int)getpid()); fclose(fileptr); return (0); } /* LockedFile() */