Author: Kev <klmitch@mit.edu>
authorKevin L. Mitchell <klmitch@mit.edu>
Fri, 29 Jun 2001 15:51:03 +0000 (15:51 +0000)
committerKevin L. Mitchell <klmitch@mit.edu>
Fri, 29 Jun 2001 15:51:03 +0000 (15:51 +0000)
Log message:

Write doc/readme.chroot; remove a bunch of code commented out with #if 0;
remove the last vestiges of sprintf_irc() and use ircd_snprintf() instead.

git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@523 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

90 files changed:
ChangeLog
doc/readme.chroot [new file with mode: 0644]
include/ircd_string.h
include/querycmds.h
include/sprintf_irc.h [deleted file]
include/support.h
ircd/Makefile.in
ircd/channel.c
ircd/gline.c
ircd/ircd_reply.c
ircd/listener.c
ircd/m_admin.c
ircd/m_away.c
ircd/m_burst.c
ircd/m_clearmode.c
ircd/m_close.c
ircd/m_connect.c
ircd/m_cprivmsg.c
ircd/m_create.c
ircd/m_defaults.c
ircd/m_destruct.c
ircd/m_desynch.c
ircd/m_die.c
ircd/m_endburst.c
ircd/m_error.c
ircd/m_get.c
ircd/m_gline.c
ircd/m_help.c
ircd/m_info.c
ircd/m_invite.c
ircd/m_ison.c
ircd/m_join.c
ircd/m_jupe.c
ircd/m_kick.c
ircd/m_kill.c
ircd/m_links.c
ircd/m_list.c
ircd/m_lusers.c
ircd/m_map.c
ircd/m_motd.c
ircd/m_names.c
ircd/m_nick.c
ircd/m_notice.c
ircd/m_oper.c
ircd/m_opmode.c
ircd/m_part.c
ircd/m_pass.c
ircd/m_ping.c
ircd/m_pong.c
ircd/m_privmsg.c
ircd/m_privs.c
ircd/m_proto.c
ircd/m_quit.c
ircd/m_rehash.c
ircd/m_reset.c
ircd/m_restart.c
ircd/m_rping.c
ircd/m_rpong.c
ircd/m_server.c
ircd/m_set.c
ircd/m_settime.c
ircd/m_silence.c
ircd/m_squit.c
ircd/m_time.c
ircd/m_tmpl.c
ircd/m_topic.c
ircd/m_trace.c
ircd/m_uping.c
ircd/m_userhost.c
ircd/m_userip.c
ircd/m_version.c
ircd/m_wallchops.c
ircd/m_wallops.c
ircd/m_wallusers.c
ircd/m_who.c
ircd/m_whois.c
ircd/m_whowas.c
ircd/res.c
ircd/s_auth.c
ircd/s_bsd.c
ircd/s_conf.c
ircd/s_debug.c
ircd/s_err.c
ircd/s_misc.c
ircd/s_serv.c
ircd/s_user.c
ircd/send.c
ircd/sprintf_irc.c [deleted file]
ircd/support.c
ircd/whocmds.c

index 75257b534ec276dcd8ea4421833d3ca7ebec65f7..41d6e871cab9ce1d0b21fbbeafcc7dc77b02e76d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,199 @@
+2001-06-29  Kevin L. Mitchell  <klmitch@mit.edu>
+
+       * ircd/whocmds.c (do_who): use ircd_snprintf() instead of
+       sprintf_irc(); it's a bit hackish, but it'll do for now
+
+       * ircd/support.c: remove unused #include
+
+       * ircd/send.c: remove unused #include
+
+       * ircd/s_user.c: use ircd_snprintf() instead of sprintf_irc()
+
+       * ircd/s_serv.c: remove unused #include
+
+       * ircd/s_misc.c: use ircd_snprintf() and friends instead of
+       sprintf_irc() and friends
+
+       * ircd/s_err.c: moved atoi_tab[] from ircd/sprintf_irc.c to
+       ircd/s_err.c, which is the only other file to refer to it
+
+       * ircd/s_conf.c (conf_add_deny): use ircd_snprintf() instead of
+       sprintf_irc()
+
+       * ircd/s_bsd.c (connect_server): use ircd_snprintf() instead of
+       sprintf_irc()
+
+       * ircd/s_auth.c: use ircd_snprintf() instead of sprintf_irc()
+
+       * ircd/res.c: use ircd_snprintf() instead of sprintf_irc()
+
+       * ircd/m_version.c: use ircd_snprintf() instead of sprintf_irc()
+
+       * ircd/m_kill.c: use ircd_snprintf() instead of sprintf_irc()
+
+       * ircd/listener.c: use ircd_snprintf() instead of sprintf_irc()
+
+       * ircd/gline.c: use ircd_snprintf() instead of sprintf_irc()
+
+       * ircd/channel.c: don't include sprintf_irc.h; use ircd_snprintf()
+       instead of sprintf_irc()
+
+       * ircd/Makefile.in: remove sprintf_irc.c from sources list; run
+       make depend
+
+       * include/ircd_string.h: remove declaration of sprintf_irc() (what
+       was it doing here anyway?)
+
+       * include/sprintf_irc.h: removed unneeded source file
+
+       * ircd/sprintf_irc.c: removed unneeded source file
+
+       * ircd/s_debug.c (count_memory): remove some dead code
+
+       * ircd/s_auth.c: remove some dead code
+
+       * ircd/res.c (update_list): remove some dead code
+
+       * ircd/m_whowas.c: remove some dead code
+
+       * ircd/m_whois.c: remove some dead code
+
+       * ircd/m_who.c: remove some dead code
+
+       * ircd/m_wallusers.c: remove some dead code
+
+       * ircd/m_wallops.c: remove some dead code
+
+       * ircd/m_wallchops.c: remove some dead code
+
+       * ircd/m_version.c: remove some dead code
+
+       * ircd/m_userip.c: remove some dead code
+
+       * ircd/m_userhost.c: remove some dead code
+
+       * ircd/m_uping.c: remove some dead code
+
+       * ircd/m_trace.c: remove some dead code
+
+       * ircd/m_topic.c: remove some dead code
+
+       * ircd/m_tmpl.c: remove some dead code
+
+       * ircd/m_time.c: remove some dead code
+
+       * ircd/m_squit.c: remove some dead code
+
+       * ircd/m_silence.c: remove some dead code
+
+       * ircd/m_settime.c: remove some dead code
+
+       * ircd/m_set.c: remove some dead code
+
+       * ircd/m_server.c: remove some dead code
+
+       * ircd/m_rpong.c: remove some dead code
+
+       * ircd/m_rping.c: remove some dead code
+
+       * ircd/m_restart.c: remove some dead code
+
+       * ircd/m_reset.c: remove some dead code
+
+       * ircd/m_rehash.c: remove some dead code
+
+       * ircd/m_quit.c: remove some dead code
+
+       * ircd/m_proto.c: remove some dead code
+
+       * ircd/m_privs.c: remove some dead code
+
+       * ircd/m_privmsg.c: remove some dead code
+
+       * ircd/m_pong.c: remove some dead code
+
+       * ircd/m_ping.c: remove some dead code
+
+       * ircd/m_pass.c: remove some dead code
+
+       * ircd/m_part.c: remove some dead code
+
+       * ircd/m_opmode.c: remove some dead code
+
+       * ircd/m_oper.c: remove some dead code
+
+       * ircd/m_notice.c: remove some dead code
+
+       * ircd/m_nick.c: remove some dead code
+
+       * ircd/m_map.c: remove some dead code
+
+       * ircd/m_lusers.c: remove some dead code
+
+       * ircd/m_list.c: remove some dead code
+
+       * ircd/m_links.c: remove some dead code
+
+       * ircd/m_kill.c: remove some dead code
+
+       * ircd/m_kick.c: remove some dead code
+
+       * ircd/m_jupe.c: remove some dead code
+
+       * ircd/m_join.c: remove some dead code
+
+       * ircd/m_ison.c: remove some dead code
+
+       * ircd/m_invite.c: remove some dead code
+
+       * ircd/m_info.c: remove some dead code
+
+       * ircd/m_help.c: remove some dead code
+
+       * ircd/m_gline.c: remove some dead code
+
+       * ircd/m_get.c: remove some dead code
+
+       * ircd/m_error.c: remove some dead code
+
+       * ircd/m_endburst.c: remove some dead code
+
+       * ircd/m_die.c: remove some dead code
+
+       * ircd/m_desynch.c: remove some dead code
+
+       * ircd/m_destruct.c: remove some dead code
+
+       * ircd/m_defaults.c: remove some dead code
+
+       * ircd/m_create.c: remove some dead code, along with an #if 1
+
+       * ircd/m_cprivmsg.c: remove some dead code
+
+       * ircd/m_connect.c: remove some dead code
+
+       * ircd/m_close.c: remove some dead code
+
+       * ircd/m_clearmode.c: remove some dead code
+
+       * ircd/m_burst.c: remove some dead code
+
+       * ircd/m_away.c: remove some dead code
+
+       * ircd/m_admin.c: remove some dead code
+
+       * ircd/listener.c (accept_connection): remove some dead code
+
+       * ircd/ircd_reply.c (need_more_params): remove some dead code
+
+       * ircd/channel.c (add_banid): remove some dead code
+
+       * include/support.h: remove some dead code
+
+       * include/querycmds.h: remove some dead code
+
+       * doc/readme.chroot: document how to do chroot operation
+
 2001-06-28  Kevin L. Mitchell  <klmitch@mit.edu>
 
        * ircd/Makefile.in: tune for VPATH builds/installs; add a rule to
diff --git a/doc/readme.chroot b/doc/readme.chroot
new file mode 100644 (file)
index 0000000..2c42cac
--- /dev/null
@@ -0,0 +1,91 @@
+Using Chroot With IRCD
+
+Introduction
+
+Many system administrators like to run certain daemons within a
+"jail," a secure area of the file system that the daemon supposedly
+cannot break out of.  That way, if the daemon is compromised somehow,
+the attacker cannot get out and affect the rest of the system in any
+way.  There are problems with this--the standard UNIX way of doing
+this is with the chroot() call, which has been deprecated by the
+UNIX98 standard.  Moreover, if an attacker has root within the jail,
+it is trivial to get *out* of the jail in most circumstances.
+Nevertheless, it is still often a good idea, and some systems can use
+more secure jails than other systems.
+
+Older versions of ircd supported chroot() operation within the server
+itself, but these were fraught with problems--chroot() can only be
+called by a process running as root, so ircd had to be started as
+root, typically by making it setuid, and would then have to drop those
+privileges after calling chroot().  Moreover, the design of the server
+would require that the server binary be in DPATH, or the /RESTART
+command would not work.  In fact, /RESTART still wouldn't work,
+because the server would then attempt to change directories to a DPATH
+relative to the current root directory--and of course, the root
+directory often would not contain the shared libraries necessary for
+the ircd to even start.
+
+Configuring the Server For Use With Chroot
+
+In the versions of ircd starting with u2.10.11, all the setuid and
+chroot() code has been removed from the server.  It is still possible
+to cause the daemon to run in a chroot() jail, however, through the
+use of a wrapper script.  This requires making all paths compiled in
+to the server be relative to the new root directory; fortunately, this
+can be done by giving the configure script the --with-chroot=<dir>
+option.  The <dir> argument specifies to configure where the root
+directory will be, and the server restart path, data path,
+configuration file, and debug log files will all be modified to be
+relative to this root directory.  If the data path or configuration
+files cannot be made relative to the specified root directory,
+configure will issue an error message and exit; if the server restart
+path is not relative to the specified root directory, configure will
+issue a warning.
+
+The various paths are made relative to the root directory through the
+use of simple edits to their string representation.  As an example,
+assume that we will be using the root directory "/home/ircd"; if the
+data path is "/home/ircd/lib," the data path that will be compiled
+into the server will be simply "/lib"; if, on the other hand, the
+specified data path were "/usr/local/lib/ircd," configure would issue
+an error, since there is no way to make the data path relative to the
+specified root directory.
+
+Preparing the Root Directory
+
+Most modern operating systems use shared libraries.  When using
+chroot(), these libraries are searched for relative to the new root
+directory, and they must be present in order for a program to
+execute.  The root directory must be prepared, therefore, by coping
+these libraries into the correct place.  A script for this purpose has
+been provided in tools/mkchroot.  This script relies on the command
+"ldd," which is used to report which shared libraries are used by a
+particular program; it also relies on ldd printing out the full path
+to those libraries.  If either of these conditions is not met, it will
+be necessary to track down the libraries by hand and place them into
+the appropriate locations.  The tools/mkchroot script takes as its
+first argument the path to the directory to be prepared as a root
+directory; following this argument should be a list of programs that
+will be running with that directory as the root directory.
+
+Using the Wrapper
+
+Also provided in the tools subdirectory are the sources for a simple
+wrapper program that can be used to start ircd.  The program can be
+compiled by executing "cc -o wrapper tools/wrapper.c"; it must be run
+as root, but do not install it as root, since that would be a major
+security risk.  This tool can be used to set the hard limit on file
+descriptors, as well as a root directory, and so may be useful to the
+administrator even if chroot() operation is not desired.  A summary of
+the command line options for the wrapper tool can be obtained with the
+"-h" option.  To set the file descriptor limit, use the "-l" option
+followed by the desired number of file descriptors; to select an
+alternative root directory, use "-c" followed by the desired root
+directory.  You must use the "-u" option to specify a user name (or
+user ID) that the command should be run as; otherwise, the command
+will be run as root, which is not what you want (and why you should
+never install this program setuid root).  Follow the command line
+arguments with "--" and the full path to the command that you wish to
+run, along with arguments to that command.  The "--" tells the wrapper
+program to stop interpreting options, and is very important if you
+must give the command any options.
index d7b97c6fa1df5ec768373f7b9534147e53451aaa..3f97249cdb03b11d976c7acdc6e704d4af1e6a61 100644 (file)
@@ -33,8 +33,6 @@ extern const char* ircd_ntoa_r(char* buf, const char* addr);
 extern char*       host_from_uh(char* buf, const char* userhost, size_t len);
 extern char*       ircd_strtok(char** save, char* str, char* fs);
 
-extern char*       sprintf_irc(char* str, const char* format, ...); 
-
 extern char*       canonize(char* buf);
 
 #define DupString(x, y)  (strcpy((x = (char*) MyMalloc(strlen(y) + 1)), y))
index 621d888512ecf7eb7678ca063cdef0da5c41bea8..3ebdaa568f570b36b230b7d2d731543cec4c69b9 100644 (file)
@@ -43,9 +43,6 @@ extern struct UserStatistics UserStats;
 /* Macros for remote connections: */
 #define Count_newremoteclient(UserStats, cptr)  (++UserStats.clients, ++(cli_serv(cptr)->clients))
 #define Count_newremoteserver(UserStats)  (++UserStats.servers)
-#if 0
-#define Count_remoteclientquits(UserStats)      (--UserStats.clients)
-#endif
 
 #define Count_remoteclientquits(UserStats,cptr)                \
   do { \
diff --git a/include/sprintf_irc.h b/include/sprintf_irc.h
deleted file mode 100644 (file)
index 0a8042d..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * sprintf_irc.h
- *
- * $Id$
- */
-#ifndef INCLUDED_sprintf_irc_h
-#define INCLUDED_sprintf_irc_h
-#ifndef INCLUDED_stdarg_h
-#include <stdarg.h>
-#define INCLUDED_stdarg_h
-#endif
-
-/*
- * Proto types
- */
-
-extern char *vsprintf_irc(char *str, const char *format, va_list);
-extern char *sprintf_irc(char *str, const char *format, ...); 
-extern const char atoi_tab[4000];
-
-#endif /* INCLUDED_sprintf_irc_h */
index a580989e21c7bc3f5f512cbff6bb92d07ed3cf50..1ac7e78e3f149ff1076bc94efa4287954c11a507 100644 (file)
@@ -5,12 +5,6 @@
  */
 #ifndef INCLUDED_support_h
 #define INCLUDED_support_h
-#if 0
-#ifndef INCLUDED_sys_types_h
-#include <sys/types.h>         /* broken BSD system headers */
-#define INCLUDED_sys_types_h
-#endif
-#endif /* 0 */
 
 /*
  * Given a number of bits, make a netmask out of it.
index d803749d93be03d1799b63d6111fd7b15cb4de06..ad6ddf1ad394bbeff85d2d6b603034795adeba84 100644 (file)
@@ -189,7 +189,6 @@ IRCD_SRC = \
        s_stats.c \
        s_user.c \
        send.c \
-       sprintf_irc.c \
        support.c \
        uping.c \
        userload.c \
@@ -355,8 +354,8 @@ channel.o: channel.c ../config.h ../include/channel.h \
  ../include/match.h ../include/msg.h ../include/numeric.h \
  ../include/numnicks.h ../include/querycmds.h ../include/s_bsd.h \
  ../include/s_conf.h ../include/s_debug.h ../include/s_misc.h \
- ../include/s_user.h ../include/send.h ../include/sprintf_irc.h \
- ../include/support.h ../include/sys.h ../include/whowas.h
+ ../include/s_user.h ../include/send.h ../include/support.h \
+ ../include/sys.h ../include/whowas.h
 class.o: class.c ../config.h ../include/class.h ../include/client.h \
  ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \
  ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \
@@ -491,10 +490,10 @@ listener.o: listener.c ../config.h ../include/listener.h \
  ../include/dbuf.h ../include/msgq.h ../include/ircd_handler.h \
  ../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \
  ../include/fda.h ../include/ircd_features.h ../include/ircd_osdep.h \
- ../include/ircd_reply.h ../include/ircd_string.h \
- ../include/ircd_chattr.h ../include/numeric.h ../include/s_bsd.h \
- ../include/s_conf.h ../include/s_misc.h ../include/send.h \
- ../include/sprintf_irc.h ../include/sys.h
+ ../include/ircd_reply.h ../include/ircd_snprintf.h \
+ ../include/ircd_string.h ../include/ircd_chattr.h \
+ ../include/numeric.h ../include/s_bsd.h ../include/s_conf.h \
+ ../include/s_misc.h ../include/send.h ../include/sys.h
 m_admin.o: m_admin.c ../config.h ../include/client.h \
  ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \
  ../include/ircd_events.h ../include/ircd_handler.h ../include/hash.h \
@@ -667,10 +666,10 @@ m_kill.o: m_kill.c ../config.h ../include/client.h \
  ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \
  ../include/ircd_events.h ../include/ircd_handler.h ../include/hash.h \
  ../include/ircd.h ../include/struct.h ../include/ircd_log.h \
- ../include/ircd_reply.h ../include/ircd_string.h \
- ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
- ../include/numnicks.h ../include/s_misc.h ../include/send.h \
- ../include/whowas.h
+ ../include/ircd_reply.h ../include/ircd_snprintf.h \
+ ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \
+ ../include/numeric.h ../include/numnicks.h ../include/s_misc.h \
+ ../include/send.h ../include/whowas.h
 m_links.o: m_links.c ../config.h ../include/client.h \
  ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \
  ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \
@@ -956,10 +955,11 @@ m_version.o: m_version.c ../config.h ../include/client.h \
  ../include/ircd_events.h ../include/ircd_handler.h ../include/hash.h \
  ../include/ircd.h ../include/struct.h ../include/ircd_features.h \
  ../include/ircd_policy.h ../include/ircd_reply.h \
- ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \
- ../include/numeric.h ../include/numnicks.h ../include/s_debug.h \
- ../include/s_user.h ../include/send.h ../include/supported.h \
- ../include/channel.h ../include/version.h
+ ../include/ircd_snprintf.h ../include/ircd_string.h \
+ ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
+ ../include/numnicks.h ../include/s_debug.h ../include/s_user.h \
+ ../include/send.h ../include/supported.h ../include/channel.h \
+ ../include/version.h
 m_wallchops.o: m_wallchops.c ../config.h ../include/channel.h \
  ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \
  ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \
@@ -1062,34 +1062,36 @@ res.o: res.c ../config.h ../include/res.h ../include/client.h \
  ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \
  ../include/struct.h ../include/ircd_alloc.h ../include/fda.h \
  ../include/ircd_log.h ../include/ircd_osdep.h ../include/ircd_reply.h \
- ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \
- ../include/numeric.h ../include/s_bsd.h ../include/s_debug.h \
- ../include/s_misc.h ../include/send.h ../include/sprintf_irc.h \
- ../include/support.h ../include/sys.h
+ ../include/ircd_snprintf.h ../include/ircd_string.h \
+ ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
+ ../include/s_bsd.h ../include/s_debug.h ../include/s_misc.h \
+ ../include/send.h ../include/support.h ../include/sys.h
 s_auth.o: s_auth.c ../config.h ../include/s_auth.h \
  ../include/ircd_events.h ../include/client.h ../include/ircd_defs.h \
  ../include/dbuf.h ../include/msgq.h ../include/ircd_handler.h \
  ../include/IPcheck.h ../include/ircd.h ../include/struct.h \
  ../include/ircd_alloc.h ../include/fda.h ../include/ircd_chattr.h \
  ../include/ircd_features.h ../include/ircd_log.h \
- ../include/ircd_osdep.h ../include/ircd_string.h ../include/list.h \
- ../include/numeric.h ../include/querycmds.h ../include/res.h \
- ../include/s_bsd.h ../include/s_debug.h ../include/s_misc.h \
- ../include/send.h ../include/sprintf_irc.h ../include/sys.h
+ ../include/ircd_osdep.h ../include/ircd_snprintf.h \
+ ../include/ircd_string.h ../include/list.h ../include/numeric.h \
+ ../include/querycmds.h ../include/res.h ../include/s_bsd.h \
+ ../include/s_debug.h ../include/s_misc.h ../include/send.h \
+ ../include/sys.h
 s_bsd.o: s_bsd.c ../config.h ../include/s_bsd.h ../include/client.h \
  ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \
  ../include/ircd_events.h ../include/ircd_handler.h \
  ../include/IPcheck.h ../include/channel.h ../include/class.h \
  ../include/hash.h ../include/ircd_log.h ../include/ircd_features.h \
  ../include/ircd_osdep.h ../include/ircd_reply.h \
- ../include/ircd_string.h ../include/ircd_chattr.h ../include/ircd.h \
- ../include/struct.h ../include/list.h ../include/listener.h \
- ../include/msg.h ../include/numeric.h ../include/numnicks.h \
- ../include/packet.h ../include/parse.h ../include/querycmds.h \
- ../include/res.h ../include/s_auth.h ../include/s_conf.h \
- ../include/s_debug.h ../include/s_misc.h ../include/s_user.h \
- ../include/send.h ../include/sprintf_irc.h ../include/support.h \
- ../include/sys.h ../include/uping.h ../include/version.h
+ ../include/ircd_snprintf.h ../include/ircd_string.h \
+ ../include/ircd_chattr.h ../include/ircd.h ../include/struct.h \
+ ../include/list.h ../include/listener.h ../include/msg.h \
+ ../include/numeric.h ../include/numnicks.h ../include/packet.h \
+ ../include/parse.h ../include/querycmds.h ../include/res.h \
+ ../include/s_auth.h ../include/s_conf.h ../include/s_debug.h \
+ ../include/s_misc.h ../include/s_user.h ../include/send.h \
+ ../include/support.h ../include/sys.h ../include/uping.h \
+ ../include/version.h
 s_conf.o: s_conf.c ../config.h ../include/s_conf.h \
  ../include/IPcheck.h ../include/class.h ../include/client.h \
  ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \
@@ -1103,7 +1105,7 @@ s_conf.o: s_conf.c ../config.h ../include/s_conf.h \
  ../include/numeric.h ../include/numnicks.h ../include/opercmds.h \
  ../include/parse.h ../include/res.h ../include/s_bsd.h \
  ../include/s_debug.h ../include/s_misc.h ../include/send.h \
- ../include/sprintf_irc.h ../include/support.h ../include/sys.h
+ ../include/support.h ../include/sys.h
 s_debug.o: s_debug.c ../config.h ../include/s_debug.h \
  ../include/ircd_defs.h ../include/channel.h ../include/class.h \
  ../include/client.h ../include/dbuf.h ../include/msgq.h \
@@ -1115,20 +1117,20 @@ s_debug.o: s_debug.c ../config.h ../include/s_debug.h \
  ../include/s_bsd.h ../include/s_conf.h ../include/send.h \
  ../include/sys.h ../include/whowas.h
 s_err.o: s_err.c ../config.h ../include/numeric.h ../include/s_debug.h \
- ../include/ircd_defs.h ../include/sprintf_irc.h
+ ../include/ircd_defs.h
 s_misc.o: s_misc.c ../config.h ../include/s_misc.h \
  ../include/IPcheck.h ../include/channel.h ../include/ircd_defs.h \
  ../include/client.h ../include/dbuf.h ../include/msgq.h \
  ../include/ircd_events.h ../include/ircd_handler.h ../include/hash.h \
  ../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \
  ../include/fda.h ../include/ircd_log.h ../include/ircd_policy.h \
- ../include/ircd_reply.h ../include/ircd_string.h \
- ../include/ircd_chattr.h ../include/list.h ../include/match.h \
- ../include/msg.h ../include/numeric.h ../include/numnicks.h \
- ../include/parse.h ../include/querycmds.h ../include/ircd_features.h \
- ../include/res.h ../include/s_bsd.h ../include/s_conf.h \
- ../include/s_debug.h ../include/s_user.h ../include/send.h \
- ../include/sprintf_irc.h ../include/support.h ../include/sys.h \
+ ../include/ircd_reply.h ../include/ircd_snprintf.h \
+ ../include/ircd_string.h ../include/ircd_chattr.h ../include/list.h \
+ ../include/match.h ../include/msg.h ../include/numeric.h \
+ ../include/numnicks.h ../include/parse.h ../include/querycmds.h \
+ ../include/ircd_features.h ../include/res.h ../include/s_bsd.h \
+ ../include/s_conf.h ../include/s_debug.h ../include/s_user.h \
+ ../include/send.h ../include/support.h ../include/sys.h \
  ../include/uping.h ../include/userload.h
 s_numeric.o: s_numeric.c ../config.h ../include/s_numeric.h \
  ../include/channel.h ../include/ircd_defs.h ../include/client.h \
@@ -1148,8 +1150,8 @@ s_serv.o: s_serv.c ../config.h ../include/s_serv.h \
  ../include/numeric.h ../include/numnicks.h ../include/parse.h \
  ../include/querycmds.h ../include/ircd_features.h ../include/s_bsd.h \
  ../include/s_conf.h ../include/s_debug.h ../include/s_misc.h \
- ../include/s_user.h ../include/send.h ../include/sprintf_irc.h \
- ../include/sys.h ../include/userload.h
+ ../include/s_user.h ../include/send.h ../include/sys.h \
+ ../include/userload.h
 s_stats.o: s_stats.c ../config.h ../include/s_stats.h \
  ../include/class.h ../include/client.h ../include/ircd_defs.h \
  ../include/dbuf.h ../include/msgq.h ../include/ircd_events.h \
@@ -1167,12 +1169,12 @@ s_user.o: s_user.c ../config.h ../include/s_user.h \
  ../include/ircd_alloc.h ../include/fda.h ../include/ircd_chattr.h \
  ../include/ircd_features.h ../include/ircd_log.h \
  ../include/ircd_policy.h ../include/ircd_reply.h \
- ../include/ircd_string.h ../include/list.h ../include/match.h \
- ../include/motd.h ../include/msg.h ../include/numeric.h \
- ../include/numnicks.h ../include/parse.h ../include/querycmds.h \
- ../include/random.h ../include/s_bsd.h ../include/s_conf.h \
- ../include/s_debug.h ../include/s_misc.h ../include/s_serv.h \
- ../include/send.h ../include/sprintf_irc.h ../include/support.h \
+ ../include/ircd_snprintf.h ../include/ircd_string.h ../include/list.h \
+ ../include/match.h ../include/motd.h ../include/msg.h \
+ ../include/numeric.h ../include/numnicks.h ../include/parse.h \
+ ../include/querycmds.h ../include/random.h ../include/s_bsd.h \
+ ../include/s_conf.h ../include/s_debug.h ../include/s_misc.h \
+ ../include/s_serv.h ../include/send.h ../include/support.h \
  ../include/supported.h ../include/sys.h ../include/userload.h \
  ../include/version.h ../include/whowas.h ../include/handlers.h
 send.o: send.c ../config.h ../include/send.h ../include/channel.h \
@@ -1183,14 +1185,12 @@ send.o: send.c ../config.h ../include/send.h ../include/channel.h \
  ../include/ircd_chattr.h ../include/list.h ../include/match.h \
  ../include/msg.h ../include/numnicks.h ../include/s_bsd.h \
  ../include/s_debug.h ../include/s_misc.h ../include/s_user.h \
- ../include/sprintf_irc.h ../include/sys.h
-sprintf_irc.o: sprintf_irc.c ../config.h ../include/sprintf_irc.h \
  ../include/sys.h
 support.o: support.c ../config.h ../include/support.h \
  ../include/fileio.h ../include/ircd.h ../include/struct.h \
  ../include/ircd_defs.h ../include/ircd_chattr.h \
  ../include/ircd_snprintf.h ../include/s_bsd.h ../include/s_debug.h \
- ../include/send.h ../include/sprintf_irc.h ../include/sys.h
+ ../include/send.h ../include/sys.h
 uping.o: uping.c ../config.h ../include/uping.h ../include/ircd_defs.h \
  ../include/ircd_events.h ../include/client.h ../include/dbuf.h \
  ../include/msgq.h ../include/ircd_handler.h ../include/ircd.h \
@@ -1218,9 +1218,9 @@ whocmds.o: whocmds.c ../config.h ../include/whocmds.h \
  ../include/numeric.h ../include/numnicks.h ../include/querycmds.h \
  ../include/ircd_features.h ../include/random.h ../include/s_bsd.h \
  ../include/s_conf.h ../include/s_misc.h ../include/s_user.h \
- ../include/send.h ../include/sprintf_irc.h ../include/support.h \
- ../include/sys.h ../include/userload.h ../include/version.h \
- ../include/whowas.h ../include/msg.h
+ ../include/send.h ../include/support.h ../include/sys.h \
+ ../include/userload.h ../include/version.h ../include/whowas.h \
+ ../include/msg.h
 whowas.o: whowas.c ../config.h ../include/whowas.h ../include/client.h \
  ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \
  ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \
index d10e5c0ebdaddb85eb0fbcc1266b769b0dfc88a6..ea46920a1910d3bb3e41f4c616e39970fb846537 100644 (file)
@@ -47,7 +47,6 @@
 #include "s_misc.h"
 #include "s_user.h"
 #include "send.h"
-#include "sprintf_irc.h"
 #include "struct.h"
 #include "support.h"
 #include "sys.h"
@@ -169,7 +168,7 @@ static char *make_nick_user_host(const char *nick, const char *name,
                                  const char *host)
 {
   static char namebuf[NICKLEN + USERLEN + HOSTLEN + 3];
-  sprintf_irc(namebuf, "%s!%s@%s", nick, name, host);
+  ircd_snprintf(0, namebuf, sizeof(namebuf), "%s!%s@%s", nick, name, host);
   return namebuf;
 }
 
@@ -180,7 +179,8 @@ static char *make_nick_user_host(const char *nick, const char *name,
 static char *make_nick_user_ip(char *nick, char *name, struct in_addr ip)
 {
   static char ipbuf[NICKLEN + USERLEN + 16 + 3];
-  sprintf_irc(ipbuf, "%s!%s@%s", nick, name, ircd_ntoa((const char*) &ip));
+  ircd_snprintf(0, ipbuf, sizeof(ipbuf), "%s!%s@%s", nick, name,
+               ircd_ntoa((const char*) &ip));
   return ipbuf;
 }
 
@@ -313,18 +313,10 @@ int add_banid(struct Client *cptr, struct Channel *chptr, char *banid,
           len -= strlen(tmp->value.ban.banstr);
         }
         *banp = tmp->next;
-#if 0
-        /* Silently remove overlapping bans */
-        MyFree(tmp->value.ban.banstr);
-        MyFree(tmp->value.ban.who);
-        free_link(tmp);
-        tmp = 0;
-#else
         /* These will be sent to the user later as -b */
         tmp->next = removed_bans_list;
         removed_bans_list = tmp;
         removed_bans = 1;
-#endif
       }
       else if (!(tmp->flags & CHFL_BURST_BAN_WIPEOUT))
       {
@@ -763,7 +755,7 @@ void channel_modes(struct Client *cptr, char *mbuf, char *pbuf,
     *mbuf++ = 'n';
   if (chptr->mode.limit) {
     *mbuf++ = 'l';
-    sprintf_irc(pbuf, "%d", chptr->mode.limit);
+    ircd_snprintf(0, pbuf, sizeof(pbuf), "%d", chptr->mode.limit);
   }
 
   if (*chptr->mode.key) {
@@ -1480,7 +1472,7 @@ modebuf_flush_int(struct ModeBuf *mbuf, int all)
       }
     } else if (MB_TYPE(mbuf, i) & MODE_LIMIT) {
       /* if it's a limit, we also format the number */
-      sprintf_irc(limitbuf, "%d", MB_UINT(mbuf, i));
+      ircd_snprintf(0, limitbuf, sizeof(limitbuf), "%d", MB_UINT(mbuf, i));
 
       tmp = strlen(limitbuf);
 
index 7ed3f1cfcab2b8de4eb5cadf91e401af81d14b3d..403a1d42fbdf8bad349b2306b1f549355bf7e3fb 100644 (file)
@@ -145,7 +145,8 @@ make_gline(char *user, char *host, char *reason, time_t expire, time_t lastmod,
       else {
         gline->bits=bits2;
       }
-      sprintf_irc(ipname,"%d.%d.%d.%d",ad[0],ad[1],ad[2],ad[3]);
+      ircd_snprintf(0, ipname, sizeof(ipname), "%d.%d.%d.%d", ad[0], ad[1],
+                   ad[2], ad[3]);
       gline->ipnum.s_addr = inet_addr(ipname);
       Debug((DEBUG_DEBUG,"IP gline: %08x/%i",gline->ipnum.s_addr,gline->bits));
       gline->gl_flags |= GLINE_IPMASK;
index 0a25fe54e6e1e2d7022cf95185f0af133e14c3c0..f4220ce74c087520289cc707c4e8f4baa3add3fe 100644 (file)
@@ -61,16 +61,6 @@ int protocol_violation(struct Client* cptr, const char* pattern, ...)
 
 int need_more_params(struct Client* cptr, const char* cmd)
 {
-#if 0
-  /*
-   * XXX - bug
-   * shouldn't try to do more than one thing at a time,
-   * call protocol_violation explicitly where it's needed and
-   * context is available.
-   */
-  if (!MyUser(cptr))
-    protocol_violation(cptr, "Not enough parameters for %s",cmd);
-#endif
   send_reply(cptr, ERR_NEEDMOREPARAMS, cmd);
   return 0;
 }
index f7802879162604ab47e1753fdea3105b191c6716..e0f92134e24de548c739195ee94a88a9023cb564 100644 (file)
 #include "ircd_features.h"
 #include "ircd_osdep.h"
 #include "ircd_reply.h"
+#include "ircd_snprintf.h"
 #include "ircd_string.h"
 #include "numeric.h"
 #include "s_bsd.h"
 #include "s_conf.h"
 #include "s_misc.h"
 #include "send.h"
-#include "sprintf_irc.h"
 #include "sys.h"         /* MAXCLIENTS */
 
 #include <assert.h>
@@ -90,7 +90,7 @@ const char* get_listener_name(const struct Listener* listener)
 {
   static char buf[HOSTLEN + PORTNAMELEN + 4];
   assert(0 != listener);
-  sprintf_irc(buf, "%s:%u", cli_name(&me), listener->port);
+  ircd_snprintf(0, buf, sizeof(buf), "%s:%u", cli_name(&me), listener->port);
   return buf;
 }
 
@@ -275,7 +275,8 @@ static void set_listener_mask(struct Listener* listener, const char* mask)
    * easy conversion of "*" 0.0.0.0 or 134.* to 134.0.0.0 :-)
    */
   sscanf(mask, "%d.%d.%d.%d", &ad[0], &ad[1], &ad[2], &ad[3]);
-  sprintf_irc(ipname, "%d.%d.%d.%d", ad[0], ad[1], ad[2], ad[3]);
+  ircd_snprintf(0, ipname, sizeof(ipname), "%d.%d.%d.%d", ad[0], ad[1], ad[2],
+               ad[3]);
   listener->mask.s_addr = inet_addr(ipname);
 }
 
@@ -480,17 +481,6 @@ static void accept_connection(struct Event* ev)
       close(fd);
       return;
     }
-#if 0
-    /*
-     * check conf for ip address access
-     */
-    if (!conf_connect_allowed(addr.sin_addr)) {
-      ++ServerStats->is_ref;
-      send(fd, "ERROR :Not authorized\r\n", 23, 0);
-      close(fd);
-      return;
-    }
-#endif
     ++ServerStats->is_ac;
 /*      nextping = CurrentTime; */
 
index f1c5fbb93510670649e039e6ed8e189b8fab4547..3fed22caaee28fb18fe83022f4f6baccbe493cfa 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
index ebd3cf76a64f47dfd52ec4c8db54a5d0644a5cb6..cf4efe0babb42dce7ed65746eab5daa90e425255 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "ircd.h"
 #include "ircd_alloc.h"
index 1d4c1ec140fe8e7a1bf71ce5378dc59dd245a235..498b64dedf6dec7155596eff92532a7aea5c3019 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "channel.h"
 #include "client.h"
 #include "hash.h"
index d71708e45a362d661c7082d3a02fdf45a23ae240..cbd961f88ce6629e0b81b649d0e71776c12e6055 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "channel.h"
 #include "hash.h"
index 9f8717797a7644e878e0bca311a0c85d8c75d37f..b121a8338339f9a67555eb4e51441cb189840456 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "ircd.h"
 #include "ircd_reply.h"
index 5e372d42ec9d1ebfabdb0f2df28ec4cd37fcb39f..0a067e56f2f7c56b6fad290d67991fca3554b857 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "crule.h"
 #include "hash.h"
index 9c81c4a08f4519fa4144f51aa434f950272bc827..f714d8f2dcebc95381f32e4891f3b9aa06ef18bf 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "ircd_reply.h"
 #include "ircd_string.h"
index 26a4b9c9dc3c6b3968e7683df8d1b5bb7e5dd1b7..fcedeb0e09196f4ab993344c125d0f275bb766d8 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "channel.h"
 #include "client.h"
 #include "hash.h"
@@ -140,18 +132,9 @@ int ms_create(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       MAGIC_REMOTE_JOIN_TS != chanTS)
     cli_serv(cli_user(sptr)->server)->lag = TStime() - chanTS;
 
-#if 1
   /* If this server is >5 minutes fast, squit it */
   if (TStime() - chanTS<-5*60*60)
        return exit_client(sptr, sptr, &me, "Timestamp Drift/Bogus TS");
-#endif
-#if 0          
-  /* If we recieve a CREATE for a channel from a server before that server
-   * was linked, then it's a HACK
-   */
-  if (MyConnect(sptr) && chanTS<cli_timestamp(sptr)+5*60*60)
-       return exit_client(sptr,sptr,"HACK: Bogus TS on CREATE before server link");
-#endif
 
   /* For each channel in the comma seperated list: */
   for (name = ircd_strtok(&p, parv[1], ","); name;
index bb52d2ac0b9fa0ea02fe35ac1e68f5d27694f334..9afe5c035f177b54fcbfb3eb52e66642484ba5ce 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "ircd.h"
 #include "ircd_reply.h"
@@ -124,9 +116,5 @@ int m_ignore(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
 int m_unsupported(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 {
-#if 0
-  send_reply(cptr, SND_EXPLICIT | ERR_UNSUPPORTED, "%s :Unsupported command",
-            parv[0]);
-#endif
   return 0;
 }
index 299abc39ba5aaf1e084fb5c515f415faaed0ce33..fc4e77d2b7f593a38355e9186f2915f34dd3c884 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
@@ -135,47 +127,3 @@ int ms_destruct(struct Client* cptr, struct Client* sptr, int parc, char* parv[]
 
   return 0;
 }
-
-#if 0 
-/*
- * m_destruct
- *
- * parv[0] = sender prefix
- * parv[1] = channel channelname
- * parv[2] = channel time stamp
- *
- * This function does nothing, it does passes DESTRUCT to the other servers.
- * In the future we will start to use this message.
- *
- */
-int m_destruct(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  time_t chanTS;                /* Creation time of the channel */
-
-  if (parc < 3 || *parv[2] == '\0')
-    return 0;
-
-#ifdef GODMODE
-  /* Allow DESTRUCT from user */
-  if (MyUser(sptr))
-    sptr = &me;
-  else
-#endif
-
-    /* sanity checks: Only accept DESTRUCT messages from servers */
-  if (!IsServer(sptr))
-    return 0;
-
-  /* Don't pass on DESTRUCT messages for channels that exist */
-  if (FindChannel(parv[1]))
-    return 0;
-
-  chanTS = atoi(parv[2]);
-
-  /* Pass on DESTRUCT message */
-  sendto_highprot_butone(cptr, 10, "%s DESTRUCT %s " TIME_T_FMT, /* XXX DEAD */
-      NumServ(sptr), parv[1], chanTS);
-
-  return 0;
-}
-#endif
index 2e41c523e52ebd8b6438339805e237a88f16a23c..c735a2a3da79dcd6098c8416283f7f9e243a304f 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
index f99aa7d3c15994bc51544e2ec86739ae7d7cbd06..9b3519d63fae26bdd9416586d7d79b27bdcff6d7 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "ircd.h"
 #include "ircd_reply.h"
index d2236b054a50f3fd1b0388cee007e4cb93cf586a..d13be04c5cc1c050524cb9e2a439f25f0a262960 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "channel.h"
 #include "client.h"
 #include "hash.h"
index c335485b0b2b8477cff4f3469a722cb833082093..ffe19ff6e682a8fac873fce294ffac47a8e97f32 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
@@ -132,44 +124,3 @@ int ms_error(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
   return 0;
 }
-
-#if 0
-/*
- * m_error
- *
- * parv[0] = sender prefix
- * parv[parc-1] = text
- */
-int m_error(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  char *para;
-
-  para = (parc > 1 && *parv[parc - 1] != '\0') ? parv[parc - 1] : "<>";
-
-  Debug((DEBUG_ERROR, "Received ERROR message from %s: %s", sptr->name, para));
-  /*
-   * Ignore error messages generated by normal user clients
-   * (because ill-behaving user clients would flood opers
-   * screen otherwise). Pass ERROR's from other sources to
-   * the local operator...
-   */
-  if (IsUser(cptr))
-    return 0;
-  if (IsUnknown(cptr))
-    return exit_client_msg(cptr, cptr, &me, "Register first");
-
-  if (cptr == sptr)
-    sendto_ops("ERROR :from %s -- %s", cptr->name, para); /* XXX DEAD */
-  else
-    sendto_ops("ERROR :from %s via %s -- %s", sptr->name, cptr->name, para); /* XXX DEAD */
-
-  if (sptr->serv)
-  {
-    MyFree(sptr->serv->last_error_msg);
-    DupString(sptr->serv->last_error_msg, para);
-  }
-
-  return 0;
-}
-#endif /* 0 */
-
index e136577213539b81cf8669e891c652dd21fce79e..29829955573b7afd7871e1442de904e2809bf9dd 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
index a0f8b22a559abd4424c276ba72d1a9feaa613a8e..e0d0f9aaf560ebbc15c36c6d415f7a3163a5d1de 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "gline.h"
 #include "hash.h"
index 3e63723fa8c6320cbf8735b112e8f0712b3b77e4..1c09943156baa4f223c2408521b98fe1253613e9 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
index e98639c47eb218e06c53c1246199068f130fc410..952e1c3c57f90c1d83ee7cf08cfe5f9071af9571 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "ircd.h"
 #include "ircd_reply.h"
index ae9be8271b7c6172fe87b0d2d245a503ca6f8b60..4134bce4e34a4d15d4b2d2585faf05e2096ae6d1 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "channel.h"
 #include "client.h"
 #include "hash.h"
index 9968a4440b78be4fb6218c555c71f0265950b7df..1dfa6f2c5b850fb8ea5c4f15c66103cdc952c47f 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
index 82f36551aeb520aac16535eba643df8cadc983b3..9381d2dc898e63d41968beb1d3c209c335dffc55 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "channel.h"
 #include "client.h"
 #include "gline.h"
index f49cb61391ce21606b3f1ae3a32a3789590b28aa..418efead0267af0d35c6c4d38e7164e2f3d4a050 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "jupe.h"
 #include "hash.h"
index 86e7af844898cca6e156a30a54a438bff2affd3d..1951dd775f77d2fa5f253e775d61b95f709fafe3 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "channel.h"
 #include "client.h"
 #include "hash.h"
index f7b8bf26165dc6bbbbc0a9138935f2e4e52e1212..10ace4aa10114633f7611add1767525991d7fb87 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
 #include "ircd_log.h"
 #include "ircd_reply.h"
+#include "ircd_snprintf.h"
 #include "ircd_string.h"
 #include "msg.h"
 #include "numeric.h"
@@ -216,7 +209,7 @@ int ms_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   }
   else
     killer = path;
-  sprintf_irc(buf, "Killed (%s)", killer);
+  ircd_snprintf(0, buf, sizeof(buf), "Killed (%s)", killer);
 
   return exit_client(cptr, victim, sptr, buf);
 }
@@ -299,8 +292,8 @@ int mo_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
   inpath = cli_user(sptr)->host;
 
-  sprintf_irc(buf,
-              "%s%s (%s)", cli_name(cptr), IsOper(sptr) ? "" : "(L)", comment);
+  ircd_snprintf(0, buf, sizeof(buf), "%s%s (%s)", cli_name(cptr),
+               IsOper(sptr) ? "" : "(L)", comment);
   path = buf;
 
   /*
@@ -333,7 +326,8 @@ int mo_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     */
     cli_flags(victim) |= FLAGS_KILLED;
 
-    sprintf_irc(buf, "Killed by %s (%s)", cli_name(sptr), comment);
+    ircd_snprintf(0, buf, sizeof(buf), "Killed by %s (%s)", cli_name(sptr),
+                 comment);
   }
   else {
   /*
@@ -343,7 +337,8 @@ int mo_kill(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
    * anyway (as this user don't exist there any more either)
    */
     sendcmdto_one(sptr, CMD_KILL, victim, "%C :%s!%s", victim, inpath, path);
-    sprintf_irc(buf, "Local kill by %s (%s)", cli_name(sptr), comment);
+    ircd_snprintf(0, buf, sizeof(buf), "Local kill by %s (%s)",
+                 cli_name(sptr), comment);
   }
 
   return exit_client(cptr, victim, sptr, buf);
index 61d150112185e72b734fa378c718880ecf799493..7814a512d3803a0292971d95a32587915b8e9392 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "ircd.h"
 #include "ircd_policy.h"
@@ -203,56 +195,3 @@ int ms_links(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   send_reply(sptr, RPL_ENDOFLINKS, BadPtr(mask) ? "*" : mask);
   return 0;
 }
-
-
-#if 0
-/*
- * m_links
- *
- * parv[0] = sender prefix
- * parv[1] = servername mask
- *
- * or
- *
- * parv[0] = sender prefix
- * parv[1] = server to query
- * parv[2] = servername mask
- */
-int m_links(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  char *mask;
-  struct Client *acptr;
-
-  if (parc > 2)
-  {
-    if (hunt_server(1, cptr, sptr, "%s%s LINKS %s :%s", 1, parc, parv) != /* XXX DEAD */
-        HUNTED_ISME)
-      return 0;
-    mask = parv[2];
-  }
-  else
-    mask = parc < 2 ? 0 : parv[1];
-
-  for (acptr = GlobalClientList, collapse(mask); acptr; acptr = acptr->next)
-  {
-    if (!IsServer(acptr) && !IsMe(acptr))
-      continue;
-    if (!BadPtr(mask) && match(mask, acptr->name))
-      continue;
-    sendto_one(sptr, rpl_str(RPL_LINKS), /* XXX DEAD */
-        me.name, parv[0], acptr->name, acptr->serv->up->name,
-#ifndef GODMODE
-        acptr->hopcount, acptr->serv->prot,
-#else /* GODMODE */
-        acptr->hopcount, acptr->serv->prot, acptr->serv->timestamp,
-        NumServ(acptr),
-#endif /* GODMODE */
-        (acptr->info[0] ? acptr->info : "(Unknown Location)"));
-  }
-
-  sendto_one(sptr, rpl_str(RPL_ENDOFLINKS), me.name, parv[0], /* XXX DEAD */
-      BadPtr(mask) ? "*" : mask);
-  return 0;
-}
-#endif /* 0 */
-
index e4c3a5d5ffed8c84f6e1f427f64c7b1d99c3626e..dc71963994cab1c49a7e72226cc65471740e179b 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "channel.h"
 #include "client.h"
 #include "hash.h"
index d06ffdb4eca4d82350c9fd7c308db5447274a7ff..02da8d7b6d1632441b11980c87273f6c6c32b3f8 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "ircd.h"
 #include "ircd_policy.h"
@@ -169,46 +161,3 @@ int ms_lusers(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
   return 0;
 }
-
-  
-#if 0
-/*
- * m_lusers
- *
- * parv[0] = sender
- * parv[1] = ignored
- * parv[2] = server to query
- */
-int m_lusers(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  int longoutput = MyUser(sptr) || IsOper(sptr);
-  if (parc > 2)
-    if (hunt_server(0, cptr, sptr, "%s%s " TOK_LUSERS " %s :%s", 2, parc, parv) != /* XXX DEAD */
-        HUNTED_ISME)
-      return 0;
-
-  sendto_one(sptr, rpl_str(RPL_LUSERCLIENT), me.name, parv[0], /* XXX DEAD */
-      UserStats.clients - UserStats.inv_clients, UserStats.inv_clients, UserStats.servers);
-  if (longoutput && UserStats.opers)
-    sendto_one(sptr, rpl_str(RPL_LUSEROP), me.name, parv[0], UserStats.opers); /* XXX DEAD */
-  if (UserStats.unknowns > 0)
-    sendto_one(sptr, rpl_str(RPL_LUSERUNKNOWN), me.name, parv[0], /* XXX DEAD */
-        UserStats.unknowns);
-  if (longoutput && UserStats.channels > 0)
-    sendto_one(sptr, rpl_str(RPL_LUSERCHANNELS), me.name, parv[0], /* XXX DEAD */
-        UserStats.channels);
-  sendto_one(sptr, rpl_str(RPL_LUSERME), me.name, parv[0], UserStats.local_clients, /* XXX DEAD */
-      UserStats.local_servers);
-
-  if (MyUser(sptr) || Protocol(cptr) < 10)
-    sendto_one(sptr, /* XXX DEAD */
-        ":%s NOTICE %s :Highest connection count: %d (%d clients)",
-        me.name, parv[0], max_connection_count, max_client_count);
-  else
-    sendto_one(sptr, /* XXX DEAD */
-        "%s NOTICE %s%s :Highest connection count: %d (%d clients)",
-        NumServ(&me), NumNick(sptr), max_connection_count, max_client_count);
-
-  return 0;
-}
-#endif /* 0 */
index 74ed166af5306053add9bffc2fbbd325b2b24419..bf0da2e02e4df448fd91166f45ab4d92a06edf7d 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "ircd.h"
 #include "ircd_policy.h"
@@ -188,23 +180,3 @@ int m_map_redirect(struct Client* cptr, struct Client* sptr, int parc,
   return 0;
 }
 #endif
-
-#if 0
-/*
- * m_map  -- by Run
- *
- * parv[0] = sender prefix
- * parv[1] = server mask
- */
-int m_map(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  if (parc < 2)
-    parv[1] = "*";
-
-  dump_map(sptr, &me, parv[1], 0);
-  sendto_one(sptr, rpl_str(RPL_MAPEND), me.name, parv[0]); /* XXX DEAD */
-
-  return 0;
-}
-#endif /* 0 */
-
index a3cb47daa14b91149a0d91be511e8f6aeb7da64f..b33cfd26c02139285fbc1b8308c331ceb92dede6 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "ircd.h"
 #include "ircd_policy.h"
index 1ccb30489a66e6b7565c19592840cb0c651d7b80..01df99181ae0892a2b33c05f5b0da1d5c71322df 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "channel.h"
 #include "client.h"
 #include "hash.h"
@@ -490,206 +482,3 @@ int ms_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   }
   return 1;
 }
-
-#if 0
-/*
- * m_names                              - Added by Jto 27 Apr 1989
- *
- * parv[0] = sender prefix
- * parv[1] = channel
- */
-int m_names(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  struct Channel *chptr;
-  struct Client *c2ptr;
-  struct Membership* member;
-  struct Channel *ch2ptr = 0;
-  int idx, flag, len, mlen;
-  char *s, *para = parc > 1 ? parv[1] : 0;
-  char buf[BUFSIZE];
-
-  if (parc > 2 && hunt_server(1, cptr, sptr, "%s%s " TOK_NAMES " %s %s", 2, parc, parv)) /* XXX DEAD */
-    return 0;
-
-  mlen = strlen(me.name) + 10 + strlen(sptr->name);
-
-  if (!EmptyString(para))
-  {
-    s = strchr(para, ',');
-    if (s)
-    {
-      parv[1] = ++s;
-      m_names(cptr, sptr, parc, parv);
-    }
-    clean_channelname(para);
-    ch2ptr = FindChannel(para);
-  }
-
-  /*
-   * First, do all visible channels (public and the one user self is)
-   */
-
-  for (chptr = GlobalChannelList; chptr; chptr = chptr->next)
-  {
-    if ((chptr != ch2ptr) && !EmptyString(para))
-      continue;                 /* -- wanted a specific channel */
-    if (!MyConnect(sptr) && EmptyString(para))
-      continue;
-#ifndef GODMODE
-    if (!ShowChannel(sptr, chptr))
-      continue;                 /* -- users on this are not listed */
-#endif
-
-    /* Find users on same channel (defined by chptr) */
-
-    strcpy(buf, "* ");
-    len = strlen(chptr->chname);
-    strcpy(buf + 2, chptr->chname);
-    strcpy(buf + 2 + len, " :");
-
-    if (PubChannel(chptr))
-      *buf = '=';
-    else if (SecretChannel(chptr))
-      *buf = '@';
-    idx = len + 4;
-    flag = 1;
-    for (member = chptr->members; member; member = member->next_member)
-    {
-      c2ptr = member->user;
-#ifndef GODMODE
-      if (sptr != c2ptr && IsInvisible(c2ptr) && !find_channel_member(sptr, chptr))
-        continue;
-#endif
-      if (IsZombie(member))
-      {
-        if (member->user != sptr)
-          continue;
-        else
-        {
-          strcat(buf, "!");
-          idx++;
-        }
-      }
-      else if (IsChanOp(member))
-      {
-        strcat(buf, "@");
-        idx++;
-      }
-      else if (HasVoice(member))
-      {
-        strcat(buf, "+");
-        idx++;
-      }
-      strcat(buf, c2ptr->name);
-      strcat(buf, " ");
-      idx += strlen(c2ptr->name) + 1;
-      flag = 1;
-#ifdef GODMODE
-      {
-        char yxx[6];
-        sprintf_irc(yxx, "%s%s", NumNick(c2ptr));
-        assert(c2ptr == findNUser(yxx));
-        sprintf_irc(buf + strlen(buf), "(%s) ", yxx);
-        idx += 6;
-      }
-      if (mlen + idx + NICKLEN + 11 > BUFSIZE)
-#else
-      if (mlen + idx + NICKLEN + 5 > BUFSIZE)
-#endif
-        /* space, modifier, nick, \r \n \0 */
-      {
-        sendto_one(sptr, rpl_str(RPL_NAMREPLY), me.name, parv[0], buf); /* XXX DEAD */
-        strcpy(buf, "* ");
-        ircd_strncpy(buf + 2, chptr->chname, len + 1);
-        buf[len + 2] = 0;
-        strcat(buf, " :");
-        if (PubChannel(chptr))
-          *buf = '=';
-        else if (SecretChannel(chptr))
-          *buf = '@';
-        idx = len + 4;
-        flag = 0;
-      }
-    }
-    if (flag)
-      sendto_one(sptr, rpl_str(RPL_NAMREPLY), me.name, parv[0], buf); /* XXX DEAD */
-  }
-  if (!EmptyString(para))
-  {
-    sendto_one(sptr, rpl_str(RPL_ENDOFNAMES), me.name, parv[0], /* XXX DEAD */
-        ch2ptr ? ch2ptr->chname : para);
-    return (1);
-  }
-
-  /* Second, do all non-public, non-secret channels in one big sweep */
-
-  strcpy(buf, "* * :");
-  idx = 5;
-  flag = 0;
-  for (c2ptr = GlobalClientList; c2ptr; c2ptr = c2ptr->next)
-  {
-    struct Channel *ch3ptr;
-    int showflag = 0, secret = 0;
-
-#ifndef GODMODE
-    if (!IsUser(c2ptr) || (sptr != c2ptr && IsInvisible(c2ptr)))
-#else
-    if (!IsUser(c2ptr))
-#endif
-      continue;
-    member = c2ptr->user->channel;
-    /*
-     * Don't show a client if they are on a secret channel or when
-     * they are on a channel sptr is on since they have already
-     * been show earlier. -avalon
-     */
-    while (member)
-    {
-      ch3ptr = member->channel;
-#ifndef GODMODE
-      if (PubChannel(ch3ptr) || find_channel_member(sptr, ch3ptr))
-#endif
-        showflag = 1;
-      if (SecretChannel(ch3ptr))
-        secret = 1;
-      member = member->next_channel;
-    }
-    if (showflag)               /* Have we already shown them ? */
-      continue;
-#ifndef GODMODE
-    if (secret)                 /* On any secret channels ? */
-      continue;
-#endif
-    strcat(buf, c2ptr->name);
-    strcat(buf, " ");
-    idx += strlen(c2ptr->name) + 1;
-    flag = 1;
-#ifdef GODMODE
-    {
-      char yxx[6];
-      sprintf_irc(yxx, "%s%s", NumNick(c2ptr));
-      assert(c2ptr == findNUser(yxx));
-      sprintf_irc(buf + strlen(buf), "(%s) ", yxx);
-      idx += 6;
-    }
-#endif
-#ifdef GODMODE
-    if (mlen + idx + NICKLEN + 9 > BUFSIZE)
-#else
-    if (mlen + idx + NICKLEN + 3 > BUFSIZE)     /* space, \r\n\0 */
-#endif
-    {
-      sendto_one(sptr, rpl_str(RPL_NAMREPLY), me.name, parv[0], buf); /* XXX DEAD */
-      strcpy(buf, "* * :");
-      idx = 5;
-      flag = 0;
-    }
-  }
-  if (flag)
-    sendto_one(sptr, rpl_str(RPL_NAMREPLY), me.name, parv[0], buf); /* XXX DEAD */
-  sendto_one(sptr, rpl_str(RPL_ENDOFNAMES), me.name, parv[0], "*"); /* XXX DEAD */
-  return 1;
-}
-#endif /* 0 */
-
index 83cefe351c8e3e93c50ea918fd452f517c7263b7..76b29ff89b9ad2eb475411e8473caaa22118dad6 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "IPcheck.h"
 #include "client.h"
 #include "hash.h"
@@ -491,299 +483,3 @@ int ms_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   assert(0 != sptr);
   return set_nick_name(cptr, sptr, nick, parc, parv);
 }
-
-#if 0
-/*
- * m_nick
- *
- * parv[0] = sender prefix
- * parv[1] = nickname
- *
- * If from server, source is client:
- *   parv[2] = timestamp
- *
- * Source is server:
- *   parv[2] = hopcount
- *   parv[3] = timestamp
- *   parv[4] = username
- *   parv[5] = hostname
- *   parv[6] = umode (optional)
- *   parv[parc-3] = IP#                 <- Only Protocol >= 10
- *   parv[parc-2] = YXX, numeric nick   <- Only Protocol >= 10
- *   parv[parc-1] = info
- *   parv[0] = server
- */
-int m_nick(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  struct Client* acptr;
-  char           nick[NICKLEN + 2];
-  char*          s;
-  time_t         lastnick = 0;
-  int            differ = 1;
-
-  if (parc < 2) {
-    sendto_one(sptr, err_str(ERR_NONICKNAMEGIVEN), me.name, parv[0]); /* XXX DEAD */
-    return 0;
-  }
-  else if ((IsServer(sptr) && parc < 8) || (IsServer(cptr) && parc < 3))
-  {
-    need_more_params(sptr, "NICK");
-    sendto_ops("bad NICK param count for %s from %s", parv[1], cptr->name); /* XXX DEAD */
-    return 0;
-  }
-  if (MyConnect(sptr) && (s = strchr(parv[1], '~')))
-    *s = '\0';
-  ircd_strncpy(nick, parv[1], NICKLEN);
-  nick[NICKLEN] = '\0';
-  if (IsServer(cptr)) {
-    if (IsServer(sptr)) {
-      lastnick = atoi(parv[3]);
-      if (lastnick > OLDEST_TS) 
-       sptr->serv->lag = TStime() - lastnick;
-    } else {
-      lastnick = atoi(parv[2]); 
-      if (lastnick > OLDEST_TS)
-       sptr->user->server->serv->lag = TStime() - lastnick;
-    }
-  }
-  /*
-   * If do_nick_name() returns a null name OR if the server sent a nick
-   * name and do_nick_name() changed it in some way (due to rules of nick
-   * creation) then reject it. If from a server and we reject it,
-   * and KILL it. -avalon 4/4/92
-   */
-  if (do_nick_name(nick) == 0 || (IsServer(cptr) && strcmp(nick, parv[1])))
-  {
-    sendto_one(sptr, err_str(ERR_ERRONEUSNICKNAME), me.name, parv[0], parv[1]); /* XXX DEAD */
-
-    if (IsServer(cptr))
-    {
-      ServerStats->is_kill++;
-      sendto_ops("Bad Nick: %s From: %s %s", /* XXX DEAD */
-          parv[1], parv[0], cptr->name);
-      sendto_one(cptr, "%s " TOK_KILL " %s :%s (%s <- %s[%s])", /* XXX DEAD */
-            NumServ(&me), IsServer(sptr) ? parv[parc - 2] : parv[0], me.name,
-            parv[1], nick, cptr->name);
-      if (!IsServer(sptr))        /* bad nick _change_ */
-      {
-        sendto_highprot_butone(&me, 10, "%s " TOK_KILL " %s :%s (%s <- %s!%s@%s)", /* XXX DEAD */
-            NumServ(&me), parv[0], me.name, cptr->name,
-            parv[0], sptr->user ? sptr->username : "",
-            sptr->user ? sptr->user->server->name : cptr->name);
-      }
-    }
-    return 0;
-  }
-
-  /* 
-   * Check if this is a LOCAL user trying to use a reserved (Juped)
-   * nick, if so tell him that it's a nick in use...
-   */
-  if ((!IsServer(cptr)) && isNickJuped(nick))
-  {
-    sendto_one(sptr, err_str(ERR_NICKNAMEINUSE), me.name, /* XXX DEAD */
-        /* parv[0] is empty when connecting */
-        EmptyString(parv[0]) ? "*" : parv[0], nick);
-    return 0;                        /* NICK message ignored */
-  }
-
-  /*
-   * Check against nick name collisions.
-   *
-   * Put this 'if' here so that the nesting goes nicely on the screen :)
-   * We check against server name list before determining if the nickname
-   * is present in the nicklist (due to the way the below for loop is
-   * constructed). -avalon
-   */
-   
-  acptr = FindServer(nick);
-  
-  if (acptr) { /* There is a nick collision with a server */
-    if (MyConnect(sptr))
-    {
-      /* Local user trying to use a nick thats a server
-       * Return an error message and ignore the command
-       */
-      sendto_one(sptr, err_str(ERR_NICKNAMEINUSE), me.name, /* XXX DEAD */
-          EmptyString(parv[0]) ? "*" : parv[0], nick);
-      return 0;                        /* NICK message ignored */
-    }
-    
-    /*
-     * We have a nickname trying to use the same name as
-     * a server. Send out a nick collision KILL to remove
-     * the nickname. As long as only a KILL is sent out,
-     * there is no danger of the server being disconnected.
-     * Ultimate way to jupiter a nick ? >;-). -avalon
-     */
-    sendto_ops("Nick collision on %s(%s <- %s)", /* XXX DEAD */
-               sptr->name, acptr->from->name, cptr->name);
-    ServerStats->is_kill++;
-    sendto_one(cptr, "%s " TOK_KILL " %s%s :%s (%s <- %s)", /* XXX DEAD */
-               NumServ(&me), NumNick(sptr), me.name, acptr->from->name,
-               cptr->name);
-    sptr->flags |= FLAGS_KILLED;
-    return exit_client(cptr, sptr, &me, "Nick/Server collision");
-  }
-  
-  acptr = FindClient(nick);
-
-  /* No collisions?  Set the nick name and we're done */
-  if (!acptr)
-    return set_nick_name(cptr, sptr, nick, parc, parv);
-  /*
-   * If acptr == sptr, then we have a client doing a nick
-   * change between *equivalent* nicknames as far as server
-   * is concerned (user is changing the case of his/her
-   * nickname or somesuch)
-   */
-  if (acptr == sptr)
-  {
-    if (strcmp(acptr->name, nick) != 0)
-      /*
-       * Allows change of case in his/her nick
-       */
-      return set_nick_name(cptr, sptr, nick, parc, parv);
-    else
-      /*
-       * This is just ':old NICK old' type thing.
-       * Just forget the whole thing here. There is
-       * no point forwarding it to anywhere,
-       * especially since servers prior to this
-       * version would treat it as nick collision.
-       */
-      return 0;                        /* NICK Message ignored */
-  }
-
-  /*
-   * Note: From this point forward it can be assumed that
-   * acptr != sptr (point to different client structures).
-   */
-  /*
-   * If the older one is "non-person", the new entry is just
-   * allowed to overwrite it. Just silently drop non-person,
-   * and proceed with the nick. This should take care of the
-   * "dormant nick" way of generating collisions...
-   */
-  if (IsUnknown(acptr) && MyConnect(acptr))
-  {
-    ++ServerStats->is_ref;
-    IPcheck_connect_fail(acptr->ip);
-    exit_client(cptr, acptr, &me, "Overridden by other sign on");
-    return set_nick_name(cptr, sptr, nick, parc, parv);
-  }
-  /*
-   * Decide, we really have a nick collision and deal with it
-   */
-  if (!IsServer(cptr))
-  {
-    /*
-     * NICK is coming from local client connection. Just
-     * send error reply and ignore the command.
-     */
-    sendto_one(sptr, err_str(ERR_NICKNAMEINUSE), me.name, /* XXX DEAD */
-        /* parv[0] is empty when connecting */
-        EmptyString(parv[0]) ? "*" : parv[0], nick);
-    return 0;                        /* NICK message ignored */
-  }
-  /*
-   * NICK was coming from a server connection.
-   * This means we have a race condition (two users signing on
-   * at the same time), or two net fragments reconnecting with the same nick.
-   * The latter can happen because two different users connected
-   * or because one and the same user switched server during a net break.
-   * If the TimeStamps are equal, we kill both (or only 'new'
-   * if it was a ":server NICK new ...").
-   * Otherwise we kill the youngest when user@host differ,
-   * or the oldest when they are the same.
-   * We treat user and ~user as different, because if it wasn't
-   * a faked ~user the AUTH wouldn't have added the '~'.
-   * --Run
-   *
-   */
-  if (IsServer(sptr))
-  {
-    /*
-     * A new NICK being introduced by a neighbouring
-     * server (e.g. message type ":server NICK new ..." received)
-     */
-    differ =  (acptr->ip.s_addr != htonl(base64toint(parv[parc - 3]))) ||
-            (0 != ircd_strcmp(acptr->user->username, parv[4]));
-    sendto_ops("Nick collision on %s (%s " TIME_T_FMT " <- %s " TIME_T_FMT /* XXX DEAD */
-               " (%s user@host))", acptr->name, acptr->from->name, acptr->lastnick,
-               cptr->name, lastnick, differ ? "Different" : "Same");
-  }
-  else
-  {
-    /*
-     * A NICK change has collided (e.g. message type ":old NICK new").
-     */
-    lastnick = atoi(parv[2]);
-    differ =  (acptr->ip.s_addr != sptr->ip.s_addr) ||
-            (0 != ircd_strcmp(acptr->user->username, sptr->user->username));              
-    sendto_ops("Nick change collision from %s to %s (%s " TIME_T_FMT " <- %s " /* XXX DEAD */
-               TIME_T_FMT ")", sptr->name, acptr->name, acptr->from->name,
-               acptr->lastnick, cptr->name, lastnick);
-  }
-  /*
-   * Now remove (kill) the nick on our side if it is the youngest.
-   * If no timestamp was received, we ignore the incoming nick
-   * (and expect a KILL for our legit nick soon ):
-   * When the timestamps are equal we kill both nicks. --Run
-   * acptr->from != cptr should *always* be true (?).
-   */
-  if (acptr->from != cptr)
-  {
-    if ((differ && lastnick >= acptr->lastnick) ||
-        (!differ && lastnick <= acptr->lastnick))
-    {
-      if (!IsServer(sptr))
-      {
-        ServerStats->is_kill++;
-        sendto_highprot_butone(cptr, 10,        /* Kill old from outgoing servers */ /* XXX DEAD */
-                               "%s " TOK_KILL " %s%s :%s (%s <- %s (Nick collision))",
-                               NumServ(&me), NumNick(sptr), me.name, acptr->from->name,
-                               cptr->name);
-        if (MyConnect(sptr) && IsServer(cptr) && Protocol(cptr) > 9)
-          sendto_one(cptr, "%s " TOK_KILL " %s%s :%s (Ghost2)", /* XXX DEAD */
-                     NumServ(&me), NumNick(sptr), me.name);
-        sptr->flags |= FLAGS_KILLED;
-        exit_client(cptr, sptr, &me, "Nick collision (you're a ghost)");
-      }
-      if (lastnick != acptr->lastnick)
-        return 0;                /* Ignore the NICK */
-    }
-    sendto_one(acptr, err_str(ERR_NICKCOLLISION), me.name, acptr->name, nick); /* XXX DEAD */
-  }
-  ServerStats->is_kill++;
-  acptr->flags |= FLAGS_KILLED;
-  if (differ)
-  {
-    sendto_highprot_butone(cptr, 10,        /* Kill our old from outgoing servers */ /* XXX DEAD */
-                           "%s " TOK_KILL " %s%s :%s (%s <- %s (older nick overruled))",
-                           NumServ(&me), NumNick(acptr), me.name, acptr->from->name,
-                           cptr->name);
-    if (MyConnect(acptr) && IsServer(cptr) && Protocol(cptr) > 9)
-      sendto_one(cptr, "%s%s " TOK_QUIT " :Local kill by %s (Ghost)", /* XXX DEAD */
-          NumNick(acptr), me.name);
-    exit_client(cptr, acptr, &me, "Nick collision (older nick overruled)");
-  }
-  else
-  {
-    sendto_highprot_butone(cptr, 10,        /* Kill our old from outgoing servers */ /* XXX DEAD */
-                           "%s " TOK_KILL " %s%s :%s (%s <- %s (nick collision from same user@host))",
-                           NumServ(&me), NumNick(acptr), me.name, acptr->from->name,
-                           cptr->name);
-    if (MyConnect(acptr) && IsServer(cptr) && Protocol(cptr) > 9)
-      sendto_one(cptr, /* XXX DEAD */
-          "%s%s " TOK_QUIT " :Local kill by %s (Ghost: switched servers too fast)",
-          NumNick(acptr), me.name);
-    exit_client(cptr, acptr, &me, "Nick collision (You collided yourself)");
-  }
-  if (lastnick == acptr->lastnick)
-    return 0;
-
-  return set_nick_name(cptr, sptr, nick, parc, parv);
-}
-
-#endif /* 0 */
index 8610da35516cbda82ba5783d02e1002f71032552..b195172d993decdd3cebac7e2027b589092b853d 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "ircd_chattr.h"
 #include "ircd_relay.h"
@@ -244,218 +236,3 @@ int mo_notice(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   }
   return 0;
 }
-
-
-#if 0
-/*
- * m_message (used in m_private() and m_notice())
- *
- * The general function to deliver MSG's between users/channels
- *
- * parv[0] = sender prefix
- * parv[1] = receiver list
- * parv[parc-1] = message text
- *
- * massive cleanup
- * rev argv 6/91
- */
-static int m_message(struct Client *cptr, struct Client *sptr,
-    int parc, char *parv[], int notice)
-{
-  struct Client*  acptr;
-  char*           s;
-  struct Channel* chptr;
-  char*           nick;
-  char*           server;
-  char*           cmd;
-  char*           host;
-  int             i;
-  int             count;
-  char*           vector[MAXTARGETS];
-
-  sptr->flags &= ~FLAGS_TS8;
-
-  cmd = notice ? MSG_NOTICE : MSG_PRIVATE;
-
-  if (parc < 2 || EmptyString(parv[1]))
-    return send_error_to_client(sptr, ERR_NORECIPIENT, cmd); /* XXX DEAD */
-
-  if (parc < 3 || EmptyString(parv[parc - 1]))
-    return send_error_to_client(sptr, ERR_NOTEXTTOSEND); /* XXX DEAD */
-
-
-#if 0
-  if (MyUser(sptr))
-    parv[1] = canonize(parv[1]);
-  for (p = 0, nick = ircd_strtok(&p, parv[1], ","); nick;
-      nick = ircd_strtok(&p, 0, ","))
-#endif
-
-  count = unique_name_vector(parv[1], ',', vector, MAXTARGETS);
-  for (i = 0; i < count; ++i) {
-    nick = vector[i];
-    /*
-     * channel msg?
-     */
-    if (IsChannelName(nick))
-    {
-      if ((chptr = FindChannel(nick)))
-      {
-        /* This first: Almost never a server/service */
-        if (client_can_send_to_channel(sptr, chptr) || IsChannelService(sptr))
-        {
-          if (MyUser(sptr) && (chptr->mode.mode & MODE_NOPRIVMSGS) &&
-              check_target_limit(sptr, chptr, chptr->chname, 0))
-            continue;
-          sendmsgto_channel_butone(cptr, sptr, chptr, /* XXX DEAD */
-              parv[0], (notice ? TOK_NOTICE : TOK_PRIVATE), 
-              chptr->chname, parv[parc - 1]);
-        }
-        else if (!notice)
-          sendto_one(sptr, err_str(ERR_CANNOTSENDTOCHAN), /* XXX DEAD */
-              me.name, parv[0], chptr->chname);
-        continue;
-      }
-    }
-    else if (*nick != '$' && !strchr(nick, '@'))
-    {
-      /*
-       * nickname addressed?
-       */
-      if (MyUser(sptr))
-        acptr = FindUser(nick);
-      else if ((acptr = findNUser(nick)) && !IsUser(acptr))
-        acptr = 0;
-      if (acptr)
-      {
-        if (MyUser(sptr) && !IsChannelService(acptr) && 
-           check_target_limit(sptr, acptr, acptr->name, 0))
-          continue;
-        if (!is_silenced(sptr, acptr))
-        {
-          if (!notice && MyConnect(sptr) && acptr->user && acptr->user->away)
-            sendto_one(sptr, rpl_str(RPL_AWAY), /* XXX DEAD */
-                me.name, parv[0], acptr->name, acptr->user->away);
-          if (MyUser(acptr))
-          {
-            add_target(acptr, sptr);
-            sendto_prefix_one(acptr, sptr, ":%s %s %s :%s", /* XXX DEAD */
-                parv[0], cmd, acptr->name, parv[parc - 1]);
-          }
-          else
-            sendto_prefix_one(acptr, sptr, ":%s %s %s%s :%s", /* XXX DEAD */
-                parv[0], (notice ? TOK_NOTICE : TOK_PRIVATE),
-                NumNick(acptr), parv[parc - 1]);
-        }
-      }
-      else if (MyUser(sptr))
-        sendto_one(sptr, err_str(ERR_NOSUCHNICK), me.name, parv[0], nick); /* XXX DEAD */
-      else
-        sendto_one(sptr, /* XXX DEAD */
-            ":%s %d %s * :Target left UnderNet. Failed to deliver: [%.50s]",
-            me.name, ERR_NOSUCHNICK, sptr->name, parv[parc - 1]);
-      continue;
-    }
-    /*
-     * The following two cases allow masks in NOTICEs
-     * (for OPERs only)
-     *
-     * Armin, 8Jun90 (gruner@informatik.tu-muenchen.de)
-     */
-    if ((*nick == '$' || *nick == '#') && IsAnOper(sptr))
-    {
-      if (MyConnect(sptr))
-      {
-        if (!(s = strrchr(nick, '.')))
-        {
-          sendto_one(sptr, err_str(ERR_NOTOPLEVEL), me.name, parv[0], nick); /* XXX DEAD */
-          continue;
-        }
-        while (*++s)
-          if (*s == '.' || *s == '*' || *s == '?')
-            break;
-        if (*s == '*' || *s == '?')
-        {
-          sendto_one(sptr, err_str(ERR_WILDTOPLEVEL), me.name, parv[0], nick); /* XXX DEAD */
-          continue;
-        }
-      }
-      sendto_match_butone(IsServer(cptr) ? cptr : 0, /* XXX DEAD */
-          sptr, nick + 1, (*nick == '#') ? MATCH_HOST : MATCH_SERVER,
-          ":%s %s %s :%s", parv[0], cmd, nick, parv[parc - 1]);
-      continue;
-    }
-    else if ((server = strchr(nick, '@')) && (acptr = FindServer(server + 1)))
-    {
-      /*
-       * NICK[%host]@server addressed? See if <server> is me first
-       */
-      if (!IsMe(acptr))
-      {
-        sendto_one(acptr, ":%s %s %s :%s", parv[0], cmd, nick, parv[parc - 1]); /* XXX DEAD */
-        continue;
-      }
-
-      /* Look for an user whose NICK is equal to <nick> and then
-       * check if it's hostname matches <host> and if it's a local
-       * user. */
-      *server = '\0';
-      if ((host = strchr(nick, '%')))
-        *host++ = '\0';
-
-      if ((!(acptr = FindUser(nick))) ||
-          (!(MyUser(acptr))) ||
-          ((!(EmptyString(host))) && match(host, acptr->user->host)))
-        acptr = 0;
-
-      *server = '@';
-      if (host)
-        *--host = '%';
-
-      if (acptr)
-      {
-        if (!(is_silenced(sptr, acptr)))
-          sendto_prefix_one(acptr, sptr, ":%s %s %s :%s", /* XXX DEAD */
-              parv[0], cmd, nick, parv[parc - 1]);
-        continue;
-      }
-    }
-    if (IsChannelName(nick))
-      sendto_one(sptr, err_str(ERR_NOSUCHCHANNEL), me.name, parv[0], nick); /* XXX DEAD */
-    else
-      sendto_one(sptr, err_str(ERR_NOSUCHNICK), me.name, parv[0], nick); /* XXX DEAD */
-  }
-  return 0;
-}
-
-/*
- * m_private
- *
- * parv[0] = sender prefix
- * parv[1] = receiver list
- * parv[parc-1] = message text
- */
-int m_private(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  return m_message(cptr, sptr, parc, parv, 0);
-}
-
-/*
- * m_notice
- *
- * parv[0] = sender prefix
- * parv[1] = receiver list
- * parv[parc-1] = notice text
- */
-int m_notice(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  if (MyUser(sptr) && parv[1] && parv[1][0] == '@' &&
-      IsChannelName(&parv[1][1]))
-  {
-    parv[1]++;                        /* Get rid of '@' */
-    return m_wallchops(cptr, sptr, parc, parv);
-  }
-  return m_message(cptr, sptr, parc, parv, 1);
-}
-
-#endif
index 47cb0b0f130ac4cd1d4086a53d04e2b543c92635..c6986eef6ef3b206d254aa564582282b3929f793 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
@@ -233,121 +225,3 @@ int mo_oper(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   send_reply(sptr, RPL_YOUREOPER);
   return 0;
 }
-#if 0
-/*
- *  m_oper
- *    parv[0] = sender prefix
- *    parv[1] = oper name
- *    parv[2] = oper password
- */
-int m_oper(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  struct ConfItem* aconf;
-  char*            name;
-  char*            password;
-  const char*      encr;
-#ifdef CRYPT_OPER_PASSWORD
-  char             salt[3];
-#endif /* CRYPT_OPER_PASSWORD */
-
-  name = parc > 1 ? parv[1] : 0;
-  password = parc > 2 ? parv[2] : 0;
-
-  if (!IsServer(cptr) && (EmptyString(name) || EmptyString(password)))
-    return need_more_params(sptr, "OPER");
-
-  /* if message arrived from server, trust it, and set to oper */
-
-  if (IsServer(cptr) && !IsOper(sptr)) {
-    ++UserStats.opers;
-    sptr->flags |= FLAGS_OPER;
-    sendto_serv_butone(cptr, "%s%s " TOK_MODE " %s :+o", NumNick(sptr), parv[0]); /* XXX DEAD */
-    return 0;
-  }
-  else if (IsAnOper(sptr)) {
-    if (MyConnect(sptr))
-      sendto_one(sptr, rpl_str(RPL_YOUREOPER), me.name, parv[0]); /* XXX DEAD */
-    return 0;
-  }
-  assert(cptr == sptr);
-  aconf = find_conf_exact(name, sptr->username, sptr->sockhost, CONF_OPS);
-  if (!aconf) 
-    aconf = find_conf_exact(name, sptr->username,
-                            ircd_ntoa((const char*) &cptr->ip), CONF_OPS);
-
-  if (!aconf || IsIllegal(aconf)) {
-    sendto_one(sptr, err_str(ERR_NOOPERHOST), me.name, parv[0]); /* XXX DEAD */
-    sendto_realops("Failed OPER attempt by %s (%s@%s)", /* XXX DEAD */
-                   parv[0], sptr->user->username, sptr->sockhost);
-    return 0;
-  }
-  assert(0 != (aconf->status & CONF_OPS));
-
-#ifdef CRYPT_OPER_PASSWORD
-  /* use first two chars of the password they send in as salt */
-
-  /* passwd may be NULL. Head it off at the pass... */
-  salt[0] = '\0';
-  if (password && aconf->passwd)
-  {
-    salt[0] = aconf->passwd[0];
-    salt[1] = aconf->passwd[1];
-    salt[2] = '\0';
-    encr = ircd_crypt(password, salt);
-  }
-  else
-    encr = "";
-#else
-  encr = password;
-#endif /* CRYPT_OPER_PASSWORD */
-
-  if (0 == strcmp(encr, aconf->passwd)) {
-    int old = (sptr->flags & ALL_UMODES);
-
-    if (ACR_OK != attach_conf(sptr, aconf)) {
-      sendto_one(sptr, err_str(ERR_NOOPERHOST), me.name, parv[0]); /* XXX DEAD */
-      sendto_realops("Failed OPER attempt by %s (%s@%s)", /* XXX DEAD */
-                     parv[0], sptr->user->username, sptr->sockhost);
-      return 0;
-    }
-#ifdef        OPER_REMOTE
-    if (aconf->status == CONF_LOCOP) {
-#else
-    if (!IsLocal(sptr)) || aconf->status == CONF_LOCOP) {
-#endif
-      ClearOper(sptr);
-      SetLocOp(sptr);
-    }
-    else {
-      /* prevent someone from being both oper and local oper */
-      ClearLocOp(sptr);
-      SetOper(sptr);
-      ++UserStats.opers;
-    }
-    cptr->handler = OPER_HANDLER;
-    sendto_ops("%s (%s@%s) is now operator (%c)", parv[0], /* XXX DEAD */
-        sptr->user->username, sptr->sockhost, IsOper(sptr) ? 'O' : 'o');
-
-    sptr->flags |= (FLAGS_WALLOP | FLAGS_SERVNOTICE | FLAGS_DEBUG);
-    set_snomask(sptr, SNO_OPERDEFAULT, SNO_ADD);
-    send_umode_out(cptr, sptr, old);
-    sendto_one(sptr, rpl_str(RPL_YOUREOPER), me.name, parv[0]); /* XXX DEAD */
-
-    ircd_log(L_INFO, "OPER (%s) by (%s!%s@%s)", /* XXX DEAD */
-             name, parv[0], sptr->user->username, sptr->sockhost);
-#ifdef FNAME_OPERLOG
-    if (IsUser(sptr))
-      write_log(FNAME_OPERLOG, /* XXX DEAD */
-          "%s OPER (%s) by (%s!%s@%s)\n", myctime(CurrentTime),
-          name, parv[0], sptr->user->username, sptr->sockhost);
-#endif
-  }
-  else {
-    sendto_one(sptr, err_str(ERR_PASSWDMISMATCH), me.name, parv[0]); /* XXX DEAD */
-    sendto_realops("Failed OPER attempt by %s (%s@%s)", /* XXX DEAD */
-                   parv[0], sptr->user->username, sptr->sockhost);
-  }
-  return 0;
-}
-#endif /* 0 */
index f0f1eec96c8ad1fc653a57caf640b54f676affde..01db05a54e496cd0017867a930e60a6d325ad433 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "channel.h"
 #include "hash.h"
index 86d772d04a99472e30af58d2b5c5bcd6a3616b73..34e6b642a01d804ab7442096c007dba6f225958a 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "channel.h"
 #include "client.h"
 #include "hash.h"
index 4629f691c6497ec0eee20d62b01f4884a52b0793..5848c0e7883a7ffb8f5282ea04a6d9494f9c88b2 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "ircd_reply.h"
 #include "ircd_string.h"
@@ -119,32 +111,3 @@ int mr_pass(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   ircd_strncpy(cli_passwd(cptr), password, PASSWDLEN);
   return 0;
 }
-
-#if 0
-/*
- * m_pass
- *
- * parv[0] = sender prefix
- * parv[1] = password
- */
-int m_pass(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  char *password = parc > 1 ? parv[1] : 0;
-
-  if (EmptyString(password))
-    return need_more_params(cptr, "PASS");
-
-  if (!MyConnect(sptr) || (!IsUnknown(cptr) && !IsHandshake(cptr)))
-  {
-    sendto_one(cptr, err_str(ERR_ALREADYREGISTRED), me.name, parv[0]); /* XXX DEAD */
-    return 0;
-  }
-  if (ircd_strcmp("PROTO",password)) {
-       proto_send_supported(sptr);
-       return 0;
-  }
-  ircd_strncpy(cptr->passwd, password, PASSWDLEN);
-  return 0;
-}
-#endif
-
index d882ce7f66c8924230e1ab97e874a541a728beb1..f0de8a8730fda153759854d8e22d33f328b717c1 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "hash.h"
 #include "ircd_reply.h"
@@ -253,47 +245,3 @@ int ms_ping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   }
   return 0;
 }
-
-
-#if 0
-/*
- * m_ping
- *
- * parv[0] = sender prefix
- * parv[1] = origin
- * parv[2] = destination
- */
-int m_ping(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  struct Client *acptr;
-  char *origin, *destination;
-
-  if (parc < 2 || *parv[1] == '\0')
-  {
-    sendto_one(sptr, err_str(ERR_NOORIGIN), me.name, parv[0]); /* XXX DEAD */
-    return 0;
-  }
-  origin = parv[1];
-  destination = parv[2];        /* Will get NULL or pointer (parc >= 2!!) */
-
-  acptr = FindClient(origin);
-  if (acptr && acptr != sptr)
-    origin = cptr->name;
-
-  if (!EmptyString(destination) && 0 != ircd_strcmp(destination, me.name) != 0)
-  {
-    if ((acptr = FindServer(destination)))
-      sendto_one(acptr, ":%s PING %s :%s", parv[0], origin, destination); /* XXX DEAD */
-    else
-    {
-      sendto_one(sptr, err_str(ERR_NOSUCHSERVER), /* XXX DEAD */
-          me.name, parv[0], destination);
-      return 0;
-    }
-  }
-  else
-    sendto_one(sptr, ":%s PONG %s :%s", me.name, me.name, origin); /* XXX DEAD */
-  return 0;
-}
-#endif
-
index 507212621fae5145c3eb77bfbcb38f10b028d153..74b4fcb0258125f6e541b91d90e08dfd5d069b59 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
@@ -187,71 +179,3 @@ int m_pong(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   cli_lasttime(cptr) = CurrentTime;
   return 0;
 }
-
-
-#if 0
-/*
- * m_pong
- *
- * parv[0] = sender prefix
- * parv[1] = origin
- * parv[2] = destination
- */
-int m_pong(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  struct Client *acptr;
-  char *origin, *destination;
-
-  if (MyUser(sptr))
-    return 0;
-
-  /* Check to see if this is a PONG :cookie reply from an
-   * unregistered user.  If so, process it. -record       */
-
-  if ((!IsRegistered(sptr)) && (sptr->cookie != 0) &&
-      (sptr->cookie != COOKIE_VERIFIED) && (parc > 1))
-  {
-    if (atol(parv[parc - 1]) == (long)sptr->cookie)
-    {
-      sptr->cookie = COOKIE_VERIFIED;
-      if (sptr->user && *sptr->user->host && sptr->name[0])        /* NICK and
-                                                                   USER OK */
-        return register_user(cptr, sptr, sptr->name, sptr->user->username); /* XXX DEAD */
-    }
-    else
-      sendto_one(sptr, ":%s %d %s :To connect, type /QUOTE PONG %u", /* XXX DEAD */
-          me.name, ERR_BADPING, sptr->name, sptr->cookie);
-
-    return 0;
-  }
-
-  if (parc < 2 || *parv[1] == '\0')
-  {
-    sendto_one(sptr, err_str(ERR_NOORIGIN), me.name, parv[0]); /* XXX DEAD */
-    return 0;
-  }
-
-  origin = parv[1];
-  destination = parv[2];
-  cptr->flags &= ~FLAGS_PINGSENT;
-  sptr->flags &= ~FLAGS_PINGSENT;
-
-  if (!EmptyString(destination) && 0 != ircd_strcmp(destination, me.name))
-  {
-    if ((acptr = FindClient(destination)))
-      sendto_one(acptr, ":%s PONG %s %s", parv[0], origin, destination); /* XXX DEAD */
-    else
-    {
-      sendto_one(sptr, err_str(ERR_NOSUCHSERVER), /* XXX DEAD */
-          me.name, parv[0], destination);
-      return 0;
-    }
-  }
-#ifdef        DEBUGMODE
-  else
-    Debug((DEBUG_NOTICE, "PONG: %s %s",
-        origin, destination ? destination : "*"));
-#endif
-  return 0;
-}
-#endif /* 0 */
index 09b5a4477401b21b64ee2236d6c4f532b0c8cb2b..aee3c857ca9e39c75bc05c2f2c41fdcd8016e584 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "ircd.h"
 #include "ircd_chattr.h"
@@ -241,221 +233,3 @@ int mo_privmsg(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   }
   return 0;
 }
-
-
-#if 0
-/*
- * m_message (used in m_private() and m_notice())
- *
- * The general function to deliver MSG's between users/channels
- *
- * parv[0] = sender prefix
- * parv[1] = receiver list
- * parv[parc-1] = message text
- *
- * massive cleanup
- * rev argv 6/91
- */
-static int m_message(struct Client *cptr, struct Client *sptr,
-    int parc, char *parv[], int notice)
-{
-  struct Client*  acptr;
-  char*           s;
-  struct Channel* chptr;
-  char*           nick;
-  char*           server;
-  char*           cmd;
-  char*           host;
-  int             i;
-  int             count;
-  char*           vector[MAXTARGETS];
-
-  sptr->flags &= ~FLAGS_TS8;
-
-  cmd = notice ? MSG_NOTICE : MSG_PRIVATE;
-
-  if (parc < 2 || EmptyString(parv[1]))
-    return send_error_to_client(sptr, ERR_NORECIPIENT, cmd); /* XXX DEAD */
-
-  if (parc < 3 || EmptyString(parv[parc - 1]))
-    return send_error_to_client(sptr, ERR_NOTEXTTOSEND); /* XXX DEAD */
-
-
-#if 0
-  if (MyUser(sptr))
-    parv[1] = canonize(parv[1]);
-  for (p = 0, nick = ircd_strtok(&p, parv[1], ","); nick;
-      nick = ircd_strtok(&p, 0, ","))
-#endif
-
-  count = unique_name_vector(parv[1], ',', vector, MAXTARGETS);
-  for (i = 0; i < count; ++i) {
-    nick = vector[i];
-    /*
-     * channel msg?
-     */
-    if (IsChannelName(nick))
-    {
-      if ((chptr = FindChannel(nick)))
-      {
-        /* This first: Almost never a server/service */
-        if (client_can_send_to_channel(sptr, chptr) || IsChannelService(sptr))
-        {
-          if (MyUser(sptr) && (chptr->mode.mode & MODE_NOPRIVMSGS) &&
-              check_target_limit(sptr, chptr, chptr->chname, 0))
-            continue;
-          sendmsgto_channel_butone(cptr, sptr, chptr, /* XXX DEAD */
-              parv[0], (notice ? TOK_NOTICE : TOK_PRIVATE), 
-              chptr->chname, parv[parc - 1]);
-        }
-        else if (!notice)
-          sendto_one(sptr, err_str(ERR_CANNOTSENDTOCHAN), /* XXX DEAD */
-              me.name, parv[0], chptr->chname);
-        continue;
-      }
-    }
-    else if (*nick != '$' && !strchr(nick, '@'))
-    {
-      /*
-       * nickname addressed?
-       */
-      if (MyUser(sptr))
-        acptr = FindUser(nick);
-      else if ((acptr = findNUser(nick)) && !IsUser(acptr))
-        acptr = 0;
-      if (acptr)
-      {
-        if (MyUser(sptr) && !IsChannelService(acptr) && 
-           check_target_limit(sptr, acptr, acptr->name, 0))
-          continue;
-        if (!is_silenced(sptr, acptr))
-        {
-          if (!notice && MyConnect(sptr) && acptr->user && acptr->user->away)
-            sendto_one(sptr, rpl_str(RPL_AWAY), /* XXX DEAD */
-                me.name, parv[0], acptr->name, acptr->user->away);
-          if (MyUser(acptr))
-          {
-            add_target(acptr, sptr);
-            sendto_prefix_one(acptr, sptr, ":%s %s %s :%s", /* XXX DEAD */
-                parv[0], cmd, acptr->name, parv[parc - 1]);
-          }
-          else
-            sendto_prefix_one(acptr, sptr, ":%s %s %s%s :%s", /* XXX DEAD */
-                parv[0], (notice ? TOK_NOTICE : TOK_PRIVATE),
-                NumNick(acptr), parv[parc - 1]);
-        }
-      }
-      else if (MyUser(sptr))
-        sendto_one(sptr, err_str(ERR_NOSUCHNICK), me.name, parv[0], nick); /* XXX DEAD */
-      else
-        sendto_one(sptr, /* XXX DEAD */
-            ":%s %d %s * :Target left UnderNet. Failed to deliver: [%.50s]",
-            me.name, ERR_NOSUCHNICK, sptr->name, parv[parc - 1]);
-      continue;
-    }
-    /*
-     * The following two cases allow masks in NOTICEs
-     * (for OPERs only)
-     *
-     * Armin, 8Jun90 (gruner@informatik.tu-muenchen.de)
-     */
-    if ((*nick == '$' || *nick == '#') && IsAnOper(sptr))
-    {
-      if (MyConnect(sptr))
-      {
-        if (!(s = strrchr(nick, '.')))
-        {
-          sendto_one(sptr, err_str(ERR_NOTOPLEVEL), me.name, parv[0], nick); /* XXX DEAD */
-          continue;
-        }
-        while (*++s)
-          if (*s == '.' || *s == '*' || *s == '?')
-            break;
-        if (*s == '*' || *s == '?')
-        {
-          sendto_one(sptr, err_str(ERR_WILDTOPLEVEL), me.name, parv[0], nick); /* XXX DEAD */
-          continue;
-        }
-      }
-      sendto_match_butone(IsServer(cptr) ? cptr : 0, /* XXX DEAD */
-          sptr, nick + 1, (*nick == '#') ? MATCH_HOST : MATCH_SERVER,
-          ":%s %s %s :%s", parv[0], cmd, nick, parv[parc - 1]);
-      continue;
-    }
-    else if ((server = strchr(nick, '@')) && (acptr = FindServer(server + 1)))
-    {
-      /*
-       * NICK[%host]@server addressed? See if <server> is me first
-       */
-      if (!IsMe(acptr))
-      {
-        sendto_one(acptr, ":%s %s %s :%s", parv[0], cmd, nick, parv[parc - 1]); /* XXX DEAD */
-        continue;
-      }
-
-      /* Look for an user whose NICK is equal to <nick> and then
-       * check if it's hostname matches <host> and if it's a local
-       * user. */
-      *server = '\0';
-      if ((host = strchr(nick, '%')))
-        *host++ = '\0';
-
-      if ((!(acptr = FindUser(nick))) ||
-          (!(MyUser(acptr))) ||
-          ((!(EmptyString(host))) && match(host, acptr->user->host)))
-        acptr = 0;
-
-      *server = '@';
-      if (host)
-        *--host = '%';
-
-      if (acptr)
-      {
-        if (!(is_silenced(sptr, acptr)))
-          sendto_prefix_one(acptr, sptr, ":%s %s %s :%s", /* XXX DEAD */
-              parv[0], cmd, nick, parv[parc - 1]);
-        continue;
-      }
-    }
-    if (IsChannelName(nick))
-      sendto_one(sptr, err_str(ERR_NOSUCHCHANNEL), me.name, parv[0], nick); /* XXX DEAD */
-    else
-      sendto_one(sptr, err_str(ERR_NOSUCHNICK), me.name, parv[0], nick); /* XXX DEAD */
-  }
-  return 0;
-}
-
-/*
- * m_private
- *
- * parv[0] = sender prefix
- * parv[1] = receiver list
- * parv[parc-1] = message text
- */
-int m_private(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  return m_message(cptr, sptr, parc, parv, 0);
-}
-
-#if !defined(XXX_BOGUS_TEMP_HACK)
-#include "handlers.h"
-#endif
-/*
- * m_notice
- *
- * parv[0] = sender prefix
- * parv[1] = receiver list
- * parv[parc-1] = notice text
- */
-int m_notice(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  if (MyUser(sptr) && parv[1] && parv[1][0] == '@' &&
-      IsChannelName(&parv[1][1]))
-  {
-    parv[1]++;                        /* Get rid of '@' */
-    return m_wallchops(cptr, sptr, parc, parv);
-  }
-  return m_message(cptr, sptr, parc, parv, 1);
-}
-
-#endif
index 3603c20e380ab0d4614b83fe9c530db8c9051fec..f72f38caab05f8d9c349bc7174788dc340579fe6 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
index e7731d2679a2cb7c8412692d72ba378c552d457e..3a9f3ca6d5cf45405aa1a52c2e7708fba13bcb3b 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "ircd.h"
 #include "ircd_alloc.h"
index d1a77517afe1fd58096112e7254deb0e0b64ad63..7d6015ac5839ad096e1af9166bce4119ec4f3355 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "channel.h"
 #include "client.h"
 #include "ircd_string.h"
@@ -152,33 +144,3 @@ int ms_quit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
    */
   return exit_client(cptr, sptr, sptr, parv[parc - 1]);
 }
-
-#if 0
-/*
- * m_quit
- *
- * parv[0] = sender prefix
- * parv[parc-1] = comment
- */
-int m_quit(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  char *comment = (parc > 1 && parv[parc - 1]) ? parv[parc - 1] : cptr->name;
-
-  if (MyUser(sptr))
-  {
-    if (!strncmp("Local Kill", comment, 10) || !strncmp(comment, "Killed", 6))
-      comment = parv[0];
-    if (sptr->user)
-    {
-      struct Membership* chan;
-      for (chan = sptr->user->channel; chan; chan = chan->next_channel)
-        if (!IsZombie(chan) && !member_can_send_to_channel(chan))
-          return exit_client(cptr, sptr, sptr, "Signed off");
-    }
-  }
-  if (strlen(comment) > TOPICLEN)
-    comment[TOPICLEN] = '\0';
-  return IsServer(sptr) ? 0 : exit_client(cptr, sptr, sptr, comment);
-}
-
-#endif /* 0 */
index e43793ce7dd651760ac6c4723d08f266f8fcaa6e..e14df3806c783815de72f72a2c27f142ef8e45b6 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "ircd.h"
 #include "ircd_log.h"
index 3bdd7aacfc411817a0646aee8adaf371408ab6a9..3c48e17ca5504ee3ea6539884b3b7b52c09297d4 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
index 6c52b93de68ac37927535c73d29599eb17641ae6..b031161d24f91408c9a7fc9a303985a44eca30ab 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "ircd.h"
 #include "ircd_log.h"
index e30acb67a23c3399eccdf61ab6372edbed64e4d8..384139016ab6acc0503cdd74f738b52346585391 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
@@ -242,73 +234,3 @@ int mo_rping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
   return 0;
 }
-
-#if 0
-/*
- * m_rping  -- by Run
- *
- *    parv[0] = sender (sptr->name thus)
- * if sender is a person: (traveling towards start server)
- *    parv[1] = pinged server[mask]
- *    parv[2] = start server (current target)
- *    parv[3] = optional remark
- * if sender is a server: (traveling towards pinged server)
- *    parv[1] = pinged server (current target)
- *    parv[2] = original sender (person)
- *    parv[3] = start time in s
- *    parv[4] = start time in us
- *    parv[5] = the optional remark
- */
-int m_rping(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  struct Client *acptr;
-
-  if (!IsPrivileged(sptr))
-    return 0;
-
-  if (parc < (IsAnOper(sptr) ? (MyConnect(sptr) ? 2 : 3) : 6))
-  {
-    return need_more_params(sptr, "RPING");
-    return 0;
-  }
-  if (MyUser(sptr))
-  {
-    if (parc == 2)
-      parv[parc++] = me.name;
-    else if (!(acptr = find_match_server(parv[2])))
-    {
-      parv[3] = parv[2];
-      parv[2] = me.name;
-      parc++;
-    }
-    else
-      parv[2] = acptr->name;
-    if (parc == 3)
-      parv[parc++] = "<No client start time>";
-  }
-
-  if (IsAnOper(sptr))
-  {
-    if (hunt_server(1, cptr, sptr, "%s%s " TOK_RPING " %s %s :%s", 2, parc, parv) != /* XXX DEAD */
-        HUNTED_ISME)
-      return 0;
-    if (!(acptr = find_match_server(parv[1])) || !IsServer(acptr))
-    {
-      sendto_one(sptr, err_str(ERR_NOSUCHSERVER), me.name, parv[0], parv[1]); /* XXX DEAD */
-      return 0;
-    }
-    sendto_one(acptr, ":%s RPING %s %s %s :%s", /* XXX DEAD */
-         me.name, NumServ(acptr), sptr->name, militime(0, 0), parv[3]);
-  }
-  else
-  {
-    if (hunt_server(1, cptr, sptr, "%s%s " TOK_RPING " %s %s %s %s :%s", 1, parc, parv) /* XXX DEAD */
-        != HUNTED_ISME)
-      return 0;
-    sendto_one(cptr, ":%s RPONG %s %s %s %s :%s", me.name, parv[0], /* XXX DEAD */
-        parv[2], parv[3], parv[4], parv[5]);
-  }
-  return 0;
-}
-#endif /* 0 */
-
index 1ff2916fd0429b5b372345b781f41bf4a6d31b03..fc2cb42c4b93d5f5ed49a694400a4c204b6c7cf5 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
@@ -153,54 +145,3 @@ int ms_rpong(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   }
   return 0;
 }
-
-
-#if 0
-/*
- * m_rpong  -- by Run too :)
- *
- * parv[0] = sender prefix
- * parv[1] = from pinged server: start server; from start server: sender
- * parv[2] = from pinged server: sender; from start server: pinged server
- * parv[3] = pingtime in ms
- * parv[4] = client info (for instance start time)
- */
-int m_rpong(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  struct Client *acptr;
-
-  if (!IsServer(sptr))
-    return 0;
-
-  if (parc < 5)
-    return need_more_params(sptr, "RPING");
-
-  if (!(acptr = FindClient(parv[1])))
-    return 0;
-
-  if (!IsMe(acptr))
-  {
-    if (IsServer(acptr) && parc > 5)
-    {
-      sendto_one(acptr, ":%s RPONG %s %s %s %s :%s", /* XXX DEAD */
-          parv[0], parv[1], parv[2], parv[3], parv[4], parv[5]);
-      return 0;
-    }
-  }
-  else
-  {
-    parv[1] = parv[2];
-    parv[2] = sptr->name;
-    parv[0] = me.name;
-    parv[3] = militime(parv[3], parv[4]);
-    parv[4] = parv[5];
-    if (!(acptr = FindUser(parv[1])))
-      return 0;                 /* No bouncing between servers ! */
-  }
-
-  sendto_one(acptr, ":%s RPONG %s %s %s :%s", /* XXX DEAD */
-      parv[0], parv[1], parv[2], parv[3], parv[4]);
-  return 0;
-}
-#endif /* 0 */
-
index 56ce072ce5c85b06ce6b032595c3b40a63c97d5c..5be7971b5ae84df6685363466c808b2e717091db 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
@@ -1398,659 +1390,3 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
   return ret;
 }
-
-
-#if 0
-/*
- *  m_server
- *
- *    parv[0] = sender prefix
- *    parv[1] = servername
- *    parv[2] = hopcount
- *    parv[3] = start timestamp
- *    parv[4] = link timestamp
- *    parv[5] = major protocol version: P09/P10
- *    parv[parc-1] = serverinfo
- *  If cptr is P10:
- *    parv[6] = "YMM", where 'Y' is the server numeric and "MM" is the
- *              numeric nick mask of this server.
- *    parv[7] = 0 (not used yet, mandatory unsigned int after u2.10.06)
- */
-int m_server(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  char*            ch;
-  int              i;
-  char             info[REALLEN + 1];
-  char*            host;
-  struct Client*   acptr;
-  struct Client*   bcptr;
-  struct Client*   LHcptr = 0;
-  struct ConfItem* aconf = 0;
-  struct ConfItem* lhconf = 0;
-  struct Jupe*     ajupe = 0;
-  int              hop;
-  int              ret;
-  int              active_lh_line = 0;
-  unsigned short   prot;
-  time_t           start_timestamp;
-  time_t           timestamp = 0;
-  time_t           recv_time;
-  time_t           ghost = 0;
-
-  if (IsUser(cptr))
-  {
-    sendto_one(cptr, err_str(ERR_ALREADYREGISTRED), me.name, parv[0]); /* XXX DEAD */
-    return 0;
-  }
-
-  if (IsUserPort(cptr))
-    return exit_client_msg(cptr, cptr, &me,
-        "You cannot connect a server to a user port; connect to %s port %u",
-        me.name, server_port);
-
-  recv_time = TStime();
-  info[0] = '\0';
-  if (parc < 7)
-  {
-    return need_more_params(sptr, "SERVER");
-    return exit_client(cptr, cptr, &me, "Need more parameters");
-  }
-  host = parv[1];
-  /*
-   * Detect protocol
-   */
-  if (strlen(parv[5]) != 3 || (parv[5][0] != 'P' && parv[5][0] != 'J'))
-    return exit_client_msg(cptr, sptr, &me, "Bogus protocol (%s)", parv[5]);
-
-  if (!IsServer(cptr))          /* Don't allow silently connecting a server */
-    *parv[5] = 'J';
-
-  prot = atoi(parv[5] + 1);
-  if (prot > atoi(MAJOR_PROTOCOL))
-    prot = atoi(MAJOR_PROTOCOL);
-  /*
-   * Because the previous test is only in 2.10, the following is needed
-   * till all servers are 2.10:
-   */
-  if (IsServer(cptr) && prot > Protocol(cptr))
-    prot = Protocol(cptr);
-  hop = atoi(parv[2]);
-  start_timestamp = atoi(parv[3]);
-  timestamp = atoi(parv[4]);
-  Debug((DEBUG_INFO, "Got SERVER %s with timestamp [%s] age " TIME_T_FMT " ("
-      TIME_T_FMT ")", host, parv[4], start_timestamp, me.serv->timestamp));
-  if ((timestamp < OLDEST_TS || (hop == 1 && start_timestamp < OLDEST_TS)))
-  {
-    return exit_client_msg(cptr, sptr, &me,
-        "Bogus timestamps (%s %s)", parv[3], parv[4]);
-  }
-  ircd_strncpy(info, parv[parc - 1], REALLEN);
-  info[REALLEN] = '\0';
-  if (prot < atoi(MINOR_PROTOCOL)) {
-    sendto_ops("Got incompatible protocol version (%s) from %s", /* XXX DEAD */
-               parv[5], cptr->name);
-    return exit_new_server(cptr, sptr, host, timestamp,
-        "Incompatible protocol: %s", parv[5]);
-  }
-  /*
-   * Check for "FRENCH " infection ;-) (actually this should
-   * be replaced with routine to check the hostname syntax in
-   * general). [ This check is still needed, even after the parse
-   * is fixed, because someone can send "SERVER :foo bar " ].
-   * Also, changed to check other "difficult" characters, now
-   * that parse lets all through... --msa
-   */
-  if (strlen(host) > HOSTLEN)
-    host[HOSTLEN] = '\0';
-  for (ch = host; *ch; ch++)
-    if (*ch <= ' ' || *ch > '~')
-      break;
-  if (*ch || !strchr(host, '.'))
-  {
-    sendto_ops("Bogus server name (%s) from %s", host, cptr->name); /* XXX DEAD */
-    return exit_client_msg(cptr, cptr, &me, "Bogus server name (%s)", host);
-  }
-
-  if (IsServer(cptr))
-  {
-    /*
-     * A local server introduces a new server behind this link.
-     * Check if this is allowed according L:, H: and Q: lines.
-     */
-    if (info[0] == '\0')
-      return exit_client_msg(cptr, cptr, &me,
-          "No server info specified for %s", host);
-    /*
-     * See if the newly found server is behind a guaranteed
-     * leaf (L-line). If so, close the link.
-     */
-    if ((lhconf = find_conf_byhost(cptr->confs, cptr->name, CONF_LEAF)) &&
-        (!lhconf->port || (hop > lhconf->port)))
-    {
-      /*
-       * L: lines normally come in pairs, here we try to
-       * make sure that the oldest link is squitted, not
-       * both.
-       */
-      active_lh_line = 1;
-      if (timestamp <= cptr->serv->timestamp)
-        LHcptr = 0;          /* Kill incoming server */
-      else
-        LHcptr = cptr;          /* Squit ourselfs */
-    }
-    else if (!(lhconf = find_conf_byname(cptr->confs, cptr->name, CONF_HUB)) ||
-             (lhconf->port && (hop > lhconf->port)))
-    {
-      struct Client *ac3ptr;
-      active_lh_line = 2;
-      /* Look for net junction causing this: */
-      LHcptr = 0;            /* incoming server */
-      if (*parv[5] != 'J') {
-        for (ac3ptr = sptr; ac3ptr != &me; ac3ptr = ac3ptr->serv->up) {
-          if (IsJunction(ac3ptr)) {
-            LHcptr = ac3ptr;
-            break;
-          }
-        }
-      }
-    }
-  }
-
-  if (IsUnknown(cptr) || IsHandshake(cptr))
-  {
-    const char* encr;
-
-    /*
-     * A local link that is still in undefined state wants
-     * to be a SERVER. Check if this is allowed and change
-     * status accordingly...
-     */
-    /*
-     * If there is more then one server on the same machine
-     * that we try to connect to, it could be that the /CONNECT
-     * <mask> caused this connect to be put at the wrong place
-     * in the hashtable.        --Run
-     * Same thing for Unknown connections that first send NICK.
-     *                          --Xorath
-     * Better check if the two strings are (caseless) identical 
-     * and not mess with hash internals. 
-     *                          --Nemesi
-     */
-    if ((!(EmptyString(cptr->name)))
-        && (IsUnknown(cptr) || IsHandshake(cptr))
-        && 0 != ircd_strcmp(cptr->name, host))
-      hChangeClient(cptr, host);
-    ircd_strncpy(cptr->name, host, HOSTLEN);
-    ircd_strncpy(cptr->info, info[0] ? info : me.name, REALLEN);
-    cptr->hopcount = hop;
-
-    /* check connection rules */
-    if (0 != conf_eval_crule(host, CRULE_ALL)) {
-      ServerStats->is_ref++;
-      sendto_ops("Refused connection from %s.", cptr->name); /* XXX DEAD */
-      return exit_client(cptr, cptr, &me, "Disallowed by connection rule");
-    }
-    if (conf_check_server(cptr)) {
-      ++ServerStats->is_ref;
-      sendto_ops("Received unauthorized connection from %s.", cptr->name); /* XXX DEAD */
-      return exit_client(cptr, cptr, &me, "No C/N conf lines");
-    }
-
-    host = cptr->name;
-
-    update_load();
-
-    if (!(aconf = find_conf_byname(cptr->confs, host, CONF_SERVER))) {
-      ++ServerStats->is_ref;
-#ifndef GODMODE
-      sendto_ops("Access denied. No conf line for server %s", cptr->name); /* XXX DEAD */
-      return exit_client_msg(cptr, cptr, &me,
-          "Access denied. No conf line for server %s", cptr->name);
-#else /* GODMODE */
-      sendto_ops("General C/N: line active: No line for server %s", cptr->name); /* XXX DEAD */
-      aconf =
-          find_conf_byname(cptr->confs, "general.undernet.org", CONF_SERVER);
-      if (!aconf) {
-        sendto_ops("Neither C/N lines for server %s nor " /* XXX DEAD */
-            "\"general.undernet.org\"", cptr->name);
-        return exit_client_msg(cptr, cptr, &me,
-            "No C/N lines for server %s", cptr->name);
-      }
-#endif /* GODMODE */
-    }
-#ifdef CRYPT_LINK_PASSWORD
-    /* passwd may be NULL. Head it off at the pass... */
-    if (*cptr->passwd)
-    {
-      encr = ircd_crypt(cptr->passwd, aconf->passwd);
-    }
-    else
-      encr = "";
-#else
-    encr = cptr->passwd;
-#endif /* CRYPT_LINK_PASSWORD */
-#ifndef GODMODE
-    if (*aconf->passwd && !!strcmp(aconf->passwd, encr)) {
-      ++ServerStats->is_ref;
-      sendto_ops("Access denied (passwd mismatch) %s", cptr->name); /* XXX DEAD */
-      return exit_client_msg(cptr, cptr, &me,
-          "No Access (passwd mismatch) %s", cptr->name);
-    }
-#endif /* not GODMODE */
-    memset(cptr->passwd, 0, sizeof(cptr->passwd));
-
-#ifndef HUB
-    for (i = 0; i <= HighestFd; i++)
-      if (LocalClientArray[i] && IsServer(LocalClientArray[i])) {
-        active_lh_line = 3;
-        LHcptr = 0;
-        break;
-      }
-#endif
-  }
-
-  /*
-   *  We want to find IsConnecting() and IsHandshake() too,
-   *  use FindClient().
-   *  The second finds collisions with numeric representation of existing
-   *  servers - these shouldn't happen anymore when all upgraded to 2.10.
-   *  -- Run
-   */
-  while ((acptr = FindClient(host)) || 
-         (parc > 7 && (acptr = FindNServer(parv[6]))))
-  {
-    /*
-     *  This link is trying feed me a server that I already have
-     *  access through another path
-     *
-     *  Do not allow Uworld to do this.
-     *  Do not allow servers that are juped.
-     *  Do not allow servers that have older link timestamps
-     *    then this try.
-     *  Do not allow servers that use the same numeric as an existing
-     *    server, but have a different name.
-     *
-     *  If my ircd.conf sucks, I can try to connect to myself:
-     */
-    if (acptr == &me)
-      return exit_client_msg(cptr, cptr, &me,
-          "nick collision with me, check server number in M:? (%s)", host);
-    /*
-     * Detect wrong numeric.
-     */
-    if (0 != ircd_strcmp(acptr->name, host))
-    {
-      sendto_serv_butone(cptr, /* XXX DEAD */
-          ":%s WALLOPS :SERVER Numeric Collision: %s != %s",
-          me.name, acptr->name, host);
-      return exit_client_msg(cptr, cptr, &me,
-          "NUMERIC collision between %s and %s."
-          " Is your server numeric correct ?", host, acptr->name);
-    }
-    /*
-     *  Kill our try, if we had one.
-     */
-    if (IsConnecting(acptr))
-    {
-      if (!active_lh_line && exit_client(cptr, acptr, &me,
-          "Just connected via another link") == CPTR_KILLED)
-        return CPTR_KILLED;
-      /*
-       * We can have only ONE 'IsConnecting', 'IsHandshake' or
-       * 'IsServer', because new 'IsConnecting's are refused to
-       * the same server if we already had it.
-       */
-      break;
-    }
-    /*
-     * Avoid other nick collisions...
-     * This is a doubtfull test though, what else would it be
-     * when it has a server.name ?
-     */
-    else if (!IsServer(acptr) && !IsHandshake(acptr))
-      return exit_client_msg(cptr, cptr, &me,
-          "Nickname %s already exists!", host);
-    /*
-     * Our new server might be a juped server,
-     * or someone trying abuse a second Uworld:
-     */
-    else if (IsServer(acptr) && (0 == ircd_strncmp(acptr->info, "JUPE", 4) ||
-        find_conf_byhost(cptr->confs, acptr->name, CONF_UWORLD)))
-    {
-      if (!IsServer(sptr))
-        return exit_client(cptr, sptr, &me, acptr->info);
-      sendto_one(cptr, ":%s WALLOPS :Received :%s SERVER %s from %s !?!", /* XXX DEAD */
-          me.name, parv[0], parv[1], cptr->name);
-      return exit_new_server(cptr, sptr, host, timestamp, "%s", acptr->info);
-    }
-    /*
-     * Of course we find the handshake this link was before :)
-     */
-    else if (IsHandshake(acptr) && acptr == cptr)
-      break;
-    /*
-     * Here we have a server nick collision...
-     * We don't want to kill the link that was last /connected,
-     * but we neither want to kill a good (old) link.
-     * Therefor we kill the second youngest link.
-     */
-    if (1)
-    {
-      struct Client* c2ptr = 0;
-      struct Client* c3ptr = acptr;
-      struct Client* ac2ptr;
-      struct Client* ac3ptr;
-
-      /* Search youngest link: */
-      for (ac3ptr = acptr; ac3ptr != &me; ac3ptr = ac3ptr->serv->up)
-        if (ac3ptr->serv->timestamp > c3ptr->serv->timestamp)
-          c3ptr = ac3ptr;
-      if (IsServer(sptr))
-      {
-        for (ac3ptr = sptr; ac3ptr != &me; ac3ptr = ac3ptr->serv->up)
-          if (ac3ptr->serv->timestamp > c3ptr->serv->timestamp)
-            c3ptr = ac3ptr;
-      }
-      if (timestamp > c3ptr->serv->timestamp)
-      {
-        c3ptr = 0;
-        c2ptr = acptr;          /* Make sure they differ */
-      }
-      /* Search second youngest link: */
-      for (ac2ptr = acptr; ac2ptr != &me; ac2ptr = ac2ptr->serv->up)
-        if (ac2ptr != c3ptr &&
-            ac2ptr->serv->timestamp >
-            (c2ptr ? c2ptr->serv->timestamp : timestamp))
-          c2ptr = ac2ptr;
-      if (IsServer(sptr))
-      {
-        for (ac2ptr = sptr; ac2ptr != &me; ac2ptr = ac2ptr->serv->up)
-          if (ac2ptr != c3ptr &&
-              ac2ptr->serv->timestamp >
-              (c2ptr ? c2ptr->serv->timestamp : timestamp))
-            c2ptr = ac2ptr;
-      }
-      if (c3ptr && timestamp > (c2ptr ? c2ptr->serv->timestamp : timestamp))
-        c2ptr = 0;
-      /* If timestamps are equal, decide which link to break
-       *  by name.
-       */
-      if ((c2ptr ? c2ptr->serv->timestamp : timestamp) ==
-          (c3ptr ? c3ptr->serv->timestamp : timestamp))
-      {
-        char* n2;
-        char* n2up;
-        char* n3;
-        char* n3up;
-        if (c2ptr)
-        {
-          n2 = c2ptr->name;
-          n2up = MyConnect(c2ptr) ? me.name : c2ptr->serv->up->name;
-        }
-        else
-        {
-          n2 = host;
-          n2up = IsServer(sptr) ? sptr->name : me.name;
-        }
-        if (c3ptr)
-        {
-          n3 = c3ptr->name;
-          n3up = MyConnect(c3ptr) ? me.name : c3ptr->serv->up->name;
-        }
-        else
-        {
-          n3 = host;
-          n3up = IsServer(sptr) ? sptr->name : me.name;
-        }
-        if (strcmp(n2, n2up) > 0)
-          n2 = n2up;
-        if (strcmp(n3, n3up) > 0)
-          n3 = n3up;
-        if (strcmp(n3, n2) > 0)
-        {
-          ac2ptr = c2ptr;
-          c2ptr = c3ptr;
-          c3ptr = ac2ptr;
-        }
-      }
-      /* Now squit the second youngest link: */
-      if (!c2ptr)
-        return exit_new_server(cptr, sptr, host, timestamp,
-            "server %s already exists and is %ld seconds younger.",
-            host, (long)acptr->serv->timestamp - (long)timestamp);
-      else if (c2ptr->from == cptr || IsServer(sptr))
-      {
-        struct Client *killedptrfrom = c2ptr->from;
-        if (active_lh_line)
-        {
-          /*
-           * If the L: or H: line also gets rid of this link,
-           * we sent just one squit.
-           */
-          if (LHcptr && a_kills_b_too(LHcptr, c2ptr))
-            break;
-          /*
-           * If breaking the loop here solves the L: or H:
-           * line problem, we don't squit that.
-           */
-          if (c2ptr->from == cptr || (LHcptr && a_kills_b_too(c2ptr, LHcptr)))
-            active_lh_line = 0;
-          else
-          {
-            /*
-             * If we still have a L: or H: line problem,
-             * we prefer to squit the new server, solving
-             * loop and L:/H: line problem with only one squit.
-             */
-            LHcptr = 0;
-            break;
-          }
-        }
-        /*
-         * If the new server was introduced by a server that caused a
-         * Ghost less then 20 seconds ago, this is probably also
-         * a Ghost... (20 seconds is more then enough because all
-         * SERVER messages are at the beginning of a net.burst). --Run
-         */
-        if (CurrentTime - cptr->serv->ghost < 20)
-        {
-          killedptrfrom = acptr->from;
-          if (exit_client(cptr, acptr, &me, "Ghost loop") == CPTR_KILLED)
-            return CPTR_KILLED;
-        }
-        else if (exit_client_msg(cptr, c2ptr, &me,
-            "Loop <-- %s (new link is %ld seconds younger)", host,
-            (c3ptr ? (long)c3ptr->serv->timestamp : timestamp) -
-            (long)c2ptr->serv->timestamp) == CPTR_KILLED)
-          return CPTR_KILLED;
-        /*
-         * Did we kill the incoming server off already ?
-         */
-        if (killedptrfrom == cptr)
-          return 0;
-      }
-      else
-      {
-        if (active_lh_line)
-        {
-          if (LHcptr && a_kills_b_too(LHcptr, acptr))
-            break;
-          if (acptr->from == cptr || (LHcptr && a_kills_b_too(acptr, LHcptr)))
-            active_lh_line = 0;
-          else
-          {
-            LHcptr = 0;
-            break;
-          }
-        }
-        /*
-         * We can't believe it is a lagged server message
-         * when it directly connects to us...
-         * kill the older link at the ghost, rather then
-         * at the second youngest link, assuming it isn't
-         * a REAL loop.
-         */
-        ghost = CurrentTime;            /* Mark that it caused a ghost */
-        if (exit_client(cptr, acptr, &me, "Ghost") == CPTR_KILLED)
-          return CPTR_KILLED;
-        break;
-      }
-    }
-  }
-
-  if (active_lh_line)
-  {
-    if (LHcptr == 0) {
-      return exit_new_server(cptr, sptr, host, timestamp,
-          (active_lh_line == 2) ?  "Non-Hub link %s <- %s(%s)" : "Leaf-only link %s <- %s(%s)",
-          cptr->name, host,
-          lhconf ? (lhconf->name ? lhconf->name : "*") : "!");
-    }
-    else
-    {
-      int killed = a_kills_b_too(LHcptr, sptr);
-      if (active_lh_line < 3)
-      {
-        if (exit_client_msg(cptr, LHcptr, &me,
-            (active_lh_line == 2) ?  "Non-Hub link %s <- %s(%s)" : "Leaf-only link %s <- %s(%s)",
-            cptr->name, host,
-            lhconf ? (lhconf->name ? lhconf->name : "*") : "!") == CPTR_KILLED)
-          return CPTR_KILLED;
-      }
-      else
-      {
-        ServerStats->is_ref++;
-        if (exit_client(cptr, LHcptr, &me, "I'm a leaf") == CPTR_KILLED)
-          return CPTR_KILLED;
-      }
-      /*
-       * Did we kill the incoming server off already ?
-       */
-      if (killed)
-        return 0;
-    }
-  }
-
-  if (IsServer(cptr))
-  {
-    /*
-     * Server is informing about a new server behind
-     * this link. Create REMOTE server structure,
-     * add it to list and propagate word to my other
-     * server links...
-     */
-
-    acptr = make_client(cptr, STAT_SERVER);
-    make_server(acptr);
-    acptr->serv->prot = prot;
-    acptr->serv->timestamp = timestamp;
-    acptr->hopcount = hop;
-    ircd_strncpy(acptr->name, host, HOSTLEN);
-    ircd_strncpy(acptr->info, info, REALLEN);
-    acptr->serv->up = sptr;
-    acptr->serv->updown = add_dlink(&sptr->serv->down, acptr);
-    /* Use cptr, because we do protocol 9 -> 10 translation
-       for numeric nicks ! */
-    SetServerYXX(cptr, acptr, parv[6]);
-
-    Count_newremoteserver(UserStats);
-    if (Protocol(acptr) < 10)
-      acptr->flags |= FLAGS_TS8;
-    add_client_to_list(acptr);
-    hAddClient(acptr);
-    if (*parv[5] == 'J')
-    {
-      SetBurst(acptr);
-      sendto_op_mask(SNO_NETWORK, "Net junction: %s %s", /* XXX DEAD */
-          sptr->name, acptr->name);
-      SetJunction(acptr);
-    }
-    /*
-     * Old sendto_serv_but_one() call removed because we now need to send
-     * different names to different servers (domain name matching).
-     */
-    for (i = 0; i <= HighestFd; i++)
-    {
-      if (!(bcptr = LocalClientArray[i]) || !IsServer(bcptr) ||
-          bcptr == cptr || IsMe(bcptr))
-        continue;
-      if (0 == match(me.name, acptr->name))
-        continue;
-        sendto_one(bcptr, "%s " TOK_SERVER " %s %d 0 %s %s %s%s 0 :%s", /* XXX DEAD */
-            NumServ(sptr), acptr->name, hop + 1, parv[4], parv[5],
-            NumServCap(acptr), acptr->info);
-    }
-    return 0;
-  }
-
-  if (IsUnknown(cptr) || IsHandshake(cptr))
-  {
-    make_server(cptr);
-    cptr->serv->timestamp = timestamp;
-    cptr->serv->prot = prot;
-    cptr->serv->ghost = ghost;
-    SetServerYXX(cptr, cptr, parv[6]);
-    if (start_timestamp > OLDEST_TS)
-    {
-#ifndef RELIABLE_CLOCK
-#ifdef TESTNET
-      sendto_ops("Debug: my start time: " TIME_T_FMT " ; others start time: " /* XXX DEAD */
-          TIME_T_FMT, me.serv->timestamp, start_timestamp);
-      sendto_ops("Debug: receive time: " TIME_T_FMT " ; received timestamp: " /* XXX DEAD */
-          TIME_T_FMT " ; difference %ld",
-          recv_time, timestamp, timestamp - recv_time);
-#endif
-      if (start_timestamp < me.serv->timestamp)
-      {
-        sendto_ops("got earlier start time: " TIME_T_FMT " < " TIME_T_FMT, /* XXX DEAD */
-            start_timestamp, me.serv->timestamp);
-        me.serv->timestamp = start_timestamp;
-        TSoffset += timestamp - recv_time;
-        sendto_ops("clock adjusted by adding %d", (int)(timestamp - recv_time)); /* XXX DEAD */
-      }
-      else if ((start_timestamp > me.serv->timestamp) && IsUnknown(cptr))
-        cptr->serv->timestamp = TStime();
-
-      else if (timestamp != recv_time)
-      {
-        /*
-         * Equal start times, we have a collision.  Let the connected-to server
-         * decide. This assumes leafs issue more than half of the connection
-         * attempts.
-         */
-        if (IsUnknown(cptr))
-          cptr->serv->timestamp = TStime();
-        else if (IsHandshake(cptr))
-        {
-          sendto_ops("clock adjusted by adding %d", /* XXX DEAD */
-              (int)(timestamp - recv_time));
-          TSoffset += timestamp - recv_time;
-        }
-      }
-#else /* RELIABLE CLOCK IS TRUE, we _always_ use our own clock */
-      if (start_timestamp < me.serv->timestamp)
-        me.serv->timestamp = start_timestamp;
-      if (IsUnknown(cptr))
-        cptr->serv->timestamp = TStime();
-#endif
-    }
-
-    ret = server_estab(cptr, aconf); /* XXX DEAD */
-  }
-  else
-    ret = 0;
-#ifdef RELIABLE_CLOCK
-  if (abs(cptr->serv->timestamp - recv_time) > 30)
-  {
-    sendto_ops("Connected to a net with a timestamp-clock" /* XXX DEAD */
-        " difference of " STIME_T_FMT " seconds! Used SETTIME to correct"
-        " this.", timestamp - recv_time);
-    sendto_one(cptr, ":%s SETTIME " TIME_T_FMT " :%s", /* XXX DEAD */
-        me.name, TStime(), me.name);
-  }
-#endif
-
-  return ret;
-}
-#endif /* 0 */
-
index 6059ee79746e8ce952c85159d6fe7327e6ca71e0..4cca91af010a385363c562115a0ca308f47bbc4d 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
index e1cfa050ac39aa339d6e40d78b67b08c60fc9308..ad6ac3c13757fadf4f11b295d93e88c751b24b1a 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
@@ -258,91 +250,3 @@ int mo_settime(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
   return 0;
 }
-
-  
-#if 0
-/*
- * m_settime
- *
- * parv[0] = sender prefix
- * parv[1] = new time
- * parv[2] = servername (Only used when sptr is an Oper).
- */
-int m_settime(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  time_t t;
-  long int dt;
-  static char tbuf[11];
-  struct DLink *lp;
-
-  if (!IsPrivileged(sptr))
-    return 0;
-
-  if (parc < 2)
-    return need_more_params(sptr, "SETTIME");
-
-  if (parc == 2 && MyUser(sptr))
-    parv[parc++] = me.name;
-
-  t = atoi(parv[1]);
-  dt = TStime() - t;
-
-  if (t < OLDEST_TS || dt < -9000000)
-  {
-    sendto_one(sptr, ":%s NOTICE %s :SETTIME: Bad value", me.name, parv[0]); /* XXX DEAD */
-    return 0;
-  }
-
-  if (IsServer(sptr))           /* send to unlagged servers */
-  {
-#ifdef RELIABLE_CLOCK
-    sprintf_irc(tbuf, TIME_T_FMT, TStime());
-    parv[1] = tbuf;
-#endif
-    for (lp = me.serv->down; lp; lp = lp->next)
-      if (cptr != lp->value.cptr && DBufLength(&lp->value.cptr->sendQ) < 8000) /* XXX DEAD */
-        sendto_one(lp->value.cptr, ":%s SETTIME %s", parv[0], parv[1]); /* XXX DEAD */
-  }
-  else
-  {
-    sprintf_irc(tbuf, TIME_T_FMT, TStime());
-    parv[1] = tbuf;
-    if (hunt_server(1, cptr, sptr, "%s%s " TOK_SETTIME " %s %s", 2, parc, parv) != /* XXX DEAD */
-        HUNTED_ISME)
-      return 0;
-  }
-
-#ifdef RELIABLE_CLOCK
-  if ((dt > 600) || (dt < -600))
-    sendto_serv_butone(0, ":%s " TOK_WALLOPS " :Bad SETTIME from %s: " TIME_T_FMT, /* XXX DEAD */
-                       me.name, sptr->name, t);
-  if (IsUser(sptr))
-  {
-    if (MyUser(sptr) || Protocol(cptr) < 10)
-      sendto_one(sptr, ":%s NOTICE %s :clock is not set %ld seconds %s : " /* XXX DEAD */
-                 "RELIABLE_CLOCK is defined", me.name, parv[0],
-                 (dt < 0) ? -dt : dt, (dt < 0) ? "forwards" : "backwards");
-    else
-      sendto_one(sptr, "%s NOTICE %s%s :clock is not set %ld seconds %s : " /* XXX DEAD */
-                 "RELIABLE_CLOCK is defined", NumServ(&me), NumNick(sptr),
-                 (dt < 0) ? -dt : dt, (dt < 0) ? "forwards" : "backwards");
-  }
-#else
-  sendto_ops("SETTIME from %s, clock is set %ld seconds %s", /* XXX DEAD */
-             sptr->name, (dt < 0) ? -dt : dt,
-             (dt < 0) ? "forwards" : "backwards");
-  TSoffset -= dt;
-  if (IsUser(sptr))
-  {
-    if (MyUser(sptr) || Protocol(cptr) < 10)
-      sendto_one(sptr, ":%s NOTICE %s :clock is set %ld seconds %s", me.name, /* XXX DEAD */
-                 parv[0], (dt < 0) ? -dt : dt, (dt < 0) ? "forwards" : "backwards");
-    else
-      sendto_one(sptr, "%s NOTICE %s%s :clock is set %ld seconds %s", /* XXX DEAD */
-                 NumServ(&me), NumNick(sptr),
-                 (dt < 0) ? -dt : dt, (dt < 0) ? "forwards" : "backwards");
-  }
-#endif
-  return 0;
-}
-#endif /* 0 */
index 2c92997021ea250e99721f00b88e48c602fc2078..21df5b600736c056d9116354cd2cb419febd4abd 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "channel.h"
 #include "client.h"
 #include "hash.h"
@@ -195,89 +187,3 @@ int ms_silence(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   }
   return 0;
 }
-
-
-#if 0
-/*
- * m_silence() - Added 19 May 1994 by Run.
- *
- *   parv[0] = sender prefix
- * From local client:
- *   parv[1] = mask (NULL sends the list)
- * From remote client:
- *   parv[1] = Numeric nick that must be silenced
- *   parv[2] = mask
- */
-int m_silence(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  struct SLink *lp;
-  struct Client *acptr;
-  char c, *cp;
-
-  if (MyUser(sptr))
-  {
-    acptr = sptr;
-    if (parc < 2 || *parv[1] == '\0' || (acptr = FindUser(parv[1])))
-    {
-      if (!(acptr->user))
-        return 0;
-      for (lp = acptr->user->silence; lp; lp = lp->next)
-        sendto_one(sptr, rpl_str(RPL_SILELIST), me.name, /* XXX DEAD */
-            sptr->name, acptr->name, lp->value.cp);
-      sendto_one(sptr, rpl_str(RPL_ENDOFSILELIST), me.name, sptr->name, /* XXX DEAD */
-          acptr->name);
-      return 0;
-    }
-    cp = parv[1];
-    c = *cp;
-    if (c == '-' || c == '+')
-      cp++;
-    else if (!(strchr(cp, '@') || strchr(cp, '.') ||
-        strchr(cp, '!') || strchr(cp, '*')))
-    {
-      sendto_one(sptr, err_str(ERR_NOSUCHNICK), me.name, parv[0], parv[1]); /* XXX DEAD */
-      return -1;
-    }
-    else
-      c = '+';
-    cp = pretty_mask(cp);
-    if ((c == '-' && !del_silence(sptr, cp)) ||
-        (c != '-' && !add_silence(sptr, cp)))
-    {
-      sendto_prefix_one(sptr, sptr, ":%s SILENCE %c%s", parv[0], c, cp); /* XXX DEAD */
-      if (c == '-')
-        sendto_serv_butone(0, ":%s SILENCE * -%s", sptr->name, cp); /* XXX DEAD */
-    }
-  }
-  else if (parc < 3 || *parv[2] == '\0')
-    return need_more_params(sptr, "SILENCE");
-
-  else
-  {
-    if (*parv[1])        /* can be a server */
-      acptr = findNUser(parv[1]);
-    else
-      acptr = FindNServer(parv[1]);
-
-    if (*parv[2] == '-')
-    {
-      if (!del_silence(sptr, parv[2] + 1))
-        sendto_serv_butone(cptr, ":%s SILENCE * %s", parv[0], parv[2]); /* XXX DEAD */
-    }
-    else
-    {
-      add_silence(sptr, parv[2]);
-      if (acptr && IsServer(acptr->from))
-      {
-        if (IsServer(acptr))
-          sendto_one(acptr, ":%s SILENCE %s %s", /* XXX DEAD */
-              parv[0], NumServ(acptr), parv[2]);
-        else
-          sendto_one(acptr, ":%s SILENCE %s%s %s", /* XXX DEAD */
-              parv[0], NumNick(acptr), parv[2]);
-      }
-    }
-  }
-  return 0;
-}
-#endif /* 0 */
index dbe234b1a67b76daab6014999ab6825682103fbe..791b4b595bd069972b208ec2cdcc75dfdd3c4741 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
index e64ed4c15ff2b3eabefa80fe7c8bfbdebcbed7cd..5d145c9e9006a4269b1074ca72927ec1f7c67674 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "ircd.h"
 #include "ircd_policy.h"
@@ -118,20 +110,3 @@ int m_time(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   send_reply(sptr, RPL_TIME, cli_name(&me), TStime(), TSoffset, date((long)0));
   return 0;
 }
-
-#if 0
-/*
- * m_time
- *
- * parv[0] = sender prefix
- * parv[1] = servername
- */
-int m_time(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  if (hunt_server(0, cptr, sptr, "%s%s TIME :%s", 1, parc, parv) == HUNTED_ISME) /* XXX DEAD */
-    sendto_one(sptr, rpl_str(RPL_TIME), me.name, /* XXX DEAD */
-        parv[0], me.name, TStime(), TSoffset, date((long)0));
-  return 0;
-}
-#endif /* 0 */
-
index 2bc58fc7d2bd4d4a781a02d4dd874356c0050b8d..24aaaaa80145293dc559102c3b1c33da7c3df834 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
index 1cd2433b256666794bfbc8283a5e2947cee9f902..950e0f472a3d18e6a026a76a11e5510da27d070a 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "channel.h"
 #include "client.h"
 #include "hash.h"
index f06aaa90b20e779a413f0dcb6923aa0823716f68..f4d8464acc9ec9bba466b04b0701549f2fd0107d 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "class.h"
 #include "client.h"
 #include "hash.h"
index 584f93a81800ff079cffe35f5d46d04ec341c458..cc10cf917e4d83837b823614e73fe364a0f2556b 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
@@ -248,173 +240,3 @@ int mo_uping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   }
   return 0;
 }
-
-
-#if 0
-/*
- * m_uping  -- by Run
- *
- * parv[0] = sender prefix
- * parv[1] = pinged server
- * parv[2] = port
- * parv[3] = hunted server
- * parv[4] = number of requested pings
- */
-int m_uping(struct Client* cptr, struct Client *sptr, int parc, char *parv[])
-{
-  struct ConfItem *aconf;
-  int port;
-  int fd;
-  struct UPing* pptr = 0;
-
-  if (!IsPrivileged(sptr))
-  {
-    sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]); /* XXX DEAD */
-    return -1;
-  }
-
-  if (parc < 2)
-  {
-    sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS), me.name, parv[0], "UPING"); /* XXX DEAD */
-    return 0;
-  }
-
-  if (MyUser(sptr))
-  {
-    if (parc == 2)
-    {
-      parv[parc++] = UDP_PORT;
-      parv[parc++] = me.name;
-      parv[parc++] = "5";
-    }
-    else if (parc == 3)
-    {
-      if (IsDigit(*parv[2]))
-       parv[parc++] = me.name;
-      else
-      {
-       parv[parc++] = parv[2];
-       parv[2] = UDP_PORT;
-      }
-      parv[parc++] = "5";
-    }
-    else if (parc == 4)
-    {
-      if (IsDigit(*parv[2]))
-      {
-       if (IsDigit(*parv[3]))
-       {
-         parv[parc++] = parv[3];
-         parv[3] = me.name;
-       }
-       else
-         parv[parc++] = "5";
-      }
-      else
-      {
-       parv[parc++] = parv[3];
-       parv[3] = parv[2];
-       parv[2] = UDP_PORT;
-      }
-    }
-  }
-  if (hunt_server(1, cptr, sptr, ":%s UPING %s %s %s %s", 3, parc, parv) != HUNTED_ISME) /* XXX DEAD */
-    return 0;
-
-  if (BadPtr(parv[4]) || atoi(parv[4]) <= 0)
-  {
-    if (MyUser(sptr) || Protocol(cptr) < 10)
-      sendto_one(sptr, ":%s NOTICE %s :UPING: Illegal number of packets: %s", /* XXX DEAD */
-         me.name, parv[0], parv[4]);
-    else
-      sendto_one(sptr, "%s NOTICE %s%s :UPING: Illegal number of packets: %s", /* XXX DEAD */
-         NumServ(&me), NumNick(sptr), parv[4]);
-    return 0;
-  }
-
-  /* Check if a CONNECT would be possible at all (adapted from m_connect) */
-  for (aconf = GlobalConfList; aconf; aconf = aconf->next)
-  {
-    if (aconf->status == CONF_SERVER &&
-       match(parv[1], aconf->name) == 0)
-      break;
-  }
-  if (!aconf)
-  {
-    for (aconf = GlobalConfList; aconf; aconf = aconf->next)
-    {
-      if (aconf->status == CONF_SERVER &&
-         (match(parv[1], aconf->host) == 0 ||
-          match(parv[1], strchr(aconf->host, '@') + 1) == 0))
-       break;
-    }
-  }
-  if (!aconf)
-  {
-    if (MyUser(sptr) || Protocol(cptr) < 10)
-      sendto_one(sptr, ":%s NOTICE %s :UPING: Host %s not listed in ircd.conf", /* XXX DEAD */
-         me.name, parv[0], parv[1]);
-    else
-      sendto_one(sptr, /* XXX DEAD */
-         "%s NOTICE %s%s :UPING: Host %s not listed in ircd.conf",
-         NumServ(&me), NumNick(sptr), parv[1]);
-    return 0;
-  }
-
-  if (IsUPing(sptr))
-    cancel_ping(sptr, sptr);  /* Cancel previous ping request */
-
-  /*
-   * Determine port: First user supplied, then default : 7007
-   */
-  if (BadPtr(parv[2]) || (port = atoi(parv[2])) <= 0)
-    port = atoi(UDP_PORT);
-
-  if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
-    int err = errno;
-    sendto_ops("m_uping: socket: %s", (err != EMFILE)  /* XXX DEAD */
-                ? ((strerror(err)) ? strerror(err) : "Unknown error") : "No more sockets");
-    if (MyUser(sptr) || Protocol(cptr) < 10)
-      sendto_one(sptr,  /* XXX DEAD */
-                 ":%s NOTICE %s :UPING: Unable to create udp ping socket",
-                 me.name, parv[0]);
-    else
-      sendto_one(sptr, /* XXX DEAD */
-                 "%s NOTICE %s%s :UPING: Unable to create udp ping socket",
-                 NumServ(&me), NumNick(sptr));
-    ircd_log(L_ERROR, "UPING: Unable to create UDP socket"); /* XXX DEAD */
-    return 0;
-  }
-
-  if (!os_set_nonblocking(fd)) {
-    if (MyUser(sptr) || Protocol(cptr) < 10)
-      sendto_one(sptr, ":%s NOTICE %s :UPING: Can't set fd non-blocking", /* XXX DEAD */
-            me.name, parv[0]);
-    else
-      sendto_one(sptr, "%s NOTICE %s%s :UPING: Can't set fd non-blocking", /* XXX DEAD */
-            NumServ(&me), NumNick(sptr));
-    close(fd);
-    return 0;
-  }
-  pptr = (struct UPing*) MyMalloc(sizeof(struct UPing));
-  assert(0 != pptr);
-  memset(pptr, 0, sizeof(struct UPing));
-
-  pptr->fd = fd;
-  pptr->sin.sin_port = htons(port);
-  pptr->sin.sin_addr.s_addr = aconf->ipnum.s_addr;
-  pptr->sin.sin_family = AF_INET;
-  pptr->count = IRCD_MIN(20, atoi(parv[4]));
-  strcpy(pptr->name, aconf->host);
-  pptr->client = sptr;
-  pptr->index = -1;
-
-  pptr->next = pingList;
-  pingList = pptr;
-
-  SetUPing(sptr);
-  ping_server(pptr);
-  return 0;
-}
-#endif /* 0 */
-
index db862b08cf5947c9b4444a8a4e262ebbf0662ce9..cf862e94ba5664b0004dec9a1927d10068155489 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "ircd_reply.h"
 #include "ircd_string.h"
@@ -122,49 +114,3 @@ int m_userhost(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   send_user_info(sptr, parv[1], RPL_USERHOST, userhost_formatter);
   return 0;
 }
-
-#if 0
-/*
- * m_userhost
- *
- * Added by Darren Reed 13/8/91 to aid clients and reduce the need for
- * complicated requests like WHOIS.
- *
- * Returns user/host information only (no spurious AWAY labels or channels).
- *
- * Rewritten to speed it up by Carlo Wood 3/8/97.
- */
-int m_userhost(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  char *s;
-  int i, j = 5;
-  char *p = 0, *sbuf;
-  struct Client *acptr;
-
-  if (parc < 2)
-    return need_more_params(sptr, "USERHOST");
-
-  sbuf = sprintf_irc(sendbuf, rpl_str(RPL_USERHOST), me.name, parv[0]); /* XXX DEAD */
-  for (i = j, s = ircd_strtok(&p, parv[1], " "); i && s;
-      s = ircd_strtok(&p, (char *)0, " "), i--)
-    if ((acptr = FindUser(s)))
-    {
-      if (i < j)
-        *sbuf++ = ' ';
-      sbuf = sprintf_irc(sbuf, "%s%s=%c%s@%s", acptr->name,
-          IsAnOper(acptr) ? "*" : "", (acptr->user->away) ? '-' : '+',
-          acptr->user->username, acptr->user->host);
-    }
-    else
-    {
-      if (i < j)
-        sendbufto_one(sptr); /* XXX DEAD */
-      sendto_one(sptr, err_str(ERR_NOSUCHNICK), me.name, parv[0], s); /* XXX DEAD */
-      sbuf = sprintf_irc(sendbuf, rpl_str(RPL_USERHOST), me.name, parv[0]); /* XXX DEAD */
-      j = i - 1;
-    }
-  if (j)
-    sendbufto_one(sptr); /* XXX DEAD */
-  return 0;
-}
-#endif
index 14ccba839de95f5e07b1ae4b6517884b1daa21ea..0f66e7b8fd43d47f934b30cef9220b1d2e23a364 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "ircd_reply.h"
 #include "ircd_string.h"
@@ -121,46 +113,3 @@ int m_userip(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   send_user_info(sptr, parv[1], RPL_USERIP, userip_formatter); 
   return 0;
 }
-
-
-#if 0
-/*
- * m_userip added by Carlo Wood 3/8/97.
- *
- * The same as USERHOST, but with the IP-number instead of the hostname.
- */
-int m_userip(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  char *s;
-  int i, j = 5;
-  char *p = 0, *sbuf;
-  struct Client *acptr;
-
-  if (parc < 2)
-    return need_more_params(sptr, "USERIP");
-
-  sbuf = sprintf_irc(sendbuf, rpl_str(RPL_USERIP), me.name, parv[0]); /* XXX DEAD */
-  for (i = j, s = ircd_strtok(&p, parv[1], " "); i && s;
-      s = ircd_strtok(&p, (char *)0, " "), i--)
-    if ((acptr = FindUser(s)))
-    {
-      if (i < j)
-        *sbuf++ = ' ';
-      sbuf = sprintf_irc(sbuf, "%s%s=%c%s@%s", acptr->name,
-          IsAnOper(acptr) ? "*" : "", (acptr->user->away) ? '-' : '+',
-          acptr->user->username, ircd_ntoa((const char*) &acptr->ip));
-    }
-    else
-    {
-      if (i < j)
-        sendbufto_one(sptr); /* XXX DEAD */
-      sendto_one(sptr, err_str(ERR_NOSUCHNICK), me.name, parv[0], s); /* XXX DEAD */
-      sbuf = sprintf_irc(sendbuf, rpl_str(RPL_USERIP), me.name, parv[0]); /* XXX DEAD */
-      j = i - 1;
-    }
-  if (i < j)
-    sendbufto_one(sptr); /* XXX DEAD */
-  return 0;
-}
-#endif /* 0 */
-
index 65c3426dce1c748b35f0178f8e5b13d24ed98aca..082deefcfaa1160920fe78fec36148dc70996b05 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
 #include "ircd_features.h"
 #include "ircd_policy.h"
 #include "ircd_reply.h"
+#include "ircd_snprintf.h"
 #include "ircd_string.h"
 #include "msg.h"
 #include "numeric.h"
@@ -132,7 +125,7 @@ int m_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   {
     char featurebuf[512];
     
-    sprintf_irc(featurebuf,FEATURES,FEATURESVALUES);
+    ircd_snprintf(0, featurebuf, sizeof(featurebuf), FEATURES, FEATURESVALUES);
     
     send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me),
               debug_serveropts());
@@ -171,34 +164,3 @@ int ms_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
   return 0;
 }
-
-#if 0
-/*
- * m_version
- *
- *   parv[0] = sender prefix
- *   parv[1] = remote server
- */
-int m_version(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  struct Client *acptr;
-
-  if (MyConnect(sptr) && parc > 1)
-  {
-    if (!(acptr = find_match_server(parv[1])))
-    {
-      sendto_one(sptr, err_str(ERR_NOSUCHSERVER), me.name, parv[0], parv[1]); /* XXX DEAD */
-      return 0;
-    }
-    parv[1] = acptr->name;
-  }
-
-  if (hunt_server(0, cptr, sptr, "%s%s " TOK_VERSION " :%s", 1, parc, parv) == /* XXX DEAD */
-      HUNTED_ISME)
-    sendto_one(sptr, rpl_str(RPL_VERSION), /* XXX DEAD */
-        me.name, parv[0], version, debugmode, me.name, serveropts);
-
-  return 0;
-}
-#endif /* 0 */
-
index f5163b44ffa51c5e75f541e27bb504e8948a9d30..9ff5a093b833421ddff266fe20b7f0270d9d4828 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "channel.h"
 #include "client.h"
 #include "hash.h"
@@ -161,60 +153,3 @@ int ms_wallchops(struct Client* cptr, struct Client* sptr, int parc, char* parv[
   }
   return 0;
 }
-
-#if 0
-/*
- * m_wallchops
- *
- * parv[0] = sender prefix
- * parv[1] = target channel
- * parv[parc - 1] = wallchops text
- */
-int m_wallchops(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  struct Channel *chptr;
-
-  sptr->flags &= ~FLAGS_TS8;
-
-  if (parc < 2 || *parv[1] == '\0')
-  {
-    sendto_one(sptr, err_str(ERR_NORECIPIENT), me.name, parv[0], "WALLCHOPS"); /* XXX DEAD */
-    return -1;
-  }
-
-  if (parc < 3 || *parv[parc - 1] == '\0')
-  {
-    sendto_one(sptr, err_str(ERR_NOTEXTTOSEND), me.name, parv[0]); /* XXX DEAD */
-    return -1;
-  }
-
-  if (MyUser(sptr))
-    parv[1] = canonize(parv[1]);
-
-  if (IsChannelName(parv[1]))
-  {
-    if ((chptr = FindChannel(parv[1])))
-    {
-      if (client_can_send_to_channel(sptr, chptr))
-      {
-        if (MyUser(sptr) && (chptr->mode.mode & MODE_NOPRIVMSGS) &&
-            check_target_limit(sptr, chptr, chptr->chname, 0))
-          return 0;
-        /* Send to local clients: */
-        sendto_lchanops_butone(cptr, sptr, chptr, /* XXX DEAD */
-            ":%s NOTICE @%s :%s", parv[0], parv[1], parv[parc - 1]);
-        /* And to other servers: */
-        sendto_chanopsserv_butone(cptr, sptr, chptr, /* XXX DEAD */
-            ":%s WC %s :%s", parv[0], parv[1], parv[parc - 1]);
-      }
-      else
-        sendto_one(sptr, err_str(ERR_CANNOTSENDTOCHAN), /* XXX DEAD */
-            me.name, parv[0], parv[1]);
-    }
-  }
-  else
-    sendto_one(sptr, err_str(ERR_NOSUCHCHANNEL), me.name, parv[0], parv[1]); /* XXX DEAD */
-
-  return 0;
-}
-#endif /* 0 */
index 442a97d920bc3a4ff56a680a5e7696492e07c366..466eeabc6dc5ae6c895190b2f5f959d64421eb14 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "ircd_reply.h"
 #include "ircd_string.h"
index cd840d73325f4b4b518d6baafbde9c5d9c9429d1..b453e8870788d4b042c180e73dc928e2205d5189 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "ircd_reply.h"
 #include "ircd_string.h"
index d13124881d580875dc603e13d314acba8e8ebdb2..052e562b11234592f56c75cf7cf8c7874f4ff499 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "channel.h"
 #include "client.h"
 #include "hash.h"
@@ -462,326 +454,3 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
   return 0;
 }
-
-
-#if 0
-/*
- *  m_who
- *
- *  parv[0] = sender prefix
- *  parv[1] = nickname mask list
- *  parv[2] = additional selection flag, only 'o' for now.
- *            and %flags to specify what fields to output
- *            plus a ,querytype if the t flag is specified
- *            so the final thing will be like o%tnchu,777
- *  parv[3] = _optional_ parameter that overrides parv[1]
- *            This can be used as "/quote who foo % :The Black Hacker
- *            to find me, parv[3] _can_ contain spaces !.
- */
-
-int m_who(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  char *mask;           /* The mask we are looking for              */
-  char ch;                      /* Scratch char register                    */
-  struct Channel *chptr;                /* Channel to show                          */
-  struct Client *acptr;         /* Client to show                           */
-
-  int bitsel;                   /* Mask of selectors to apply               */
-  int matchsel;                 /* Wich fields the match should apply on    */
-  int counter;                  /* Query size counter,
-                                   initially used to count fields           */
-  int commas;                   /* Does our mask contain any comma ?
-                                   If so is a list..                        */
-  int fields;                   /* Mask of fields to show                   */
-  int isthere = 0;              /* When this set the user is member of chptr */
-  char *nick;                   /* Single element extracted from
-                                   the mask list                            */
-  char *p;                      /* Scratch char pointer                     */
-  char *qrt;                    /* Pointer to the query type                */
-  static char mymask[512];      /* To save the mask before corrupting it    */
-
-  /* Let's find where is our mask, and if actually contains something */
-  mask = ((parc > 1) ? parv[1] : 0);
-  if (parc > 3 && parv[3])
-    mask = parv[3];
-  if (mask && ((mask[0] == '\0') ||
-      (mask[1] == '\0' && ((mask[0] == '0') || (mask[0] == '*')))))
-    mask = 0;
-
-  /* Evaluate the flags now, we consider the second parameter 
-     as "matchFlags%fieldsToInclude,querytype"           */
-  bitsel = fields = counter = matchsel = 0;
-  qrt = 0;
-  if (parc > 2 && parv[2] && *parv[2])
-  {
-    p = parv[2];
-    while (((ch = *(p++))) && (ch != '%') && (ch != ','))
-      switch (ch)
-      {
-        case 'o':
-        case 'O':
-          bitsel |= WHOSELECT_OPER;
-          continue;
-        case 'x':
-        case 'X':
-          bitsel |= WHOSELECT_EXTRA;
-#ifdef WPATH
-          if (IsAnOper(sptr))
-            write_log(WPATH, "# " TIME_T_FMT " %s!%s@%s WHO %s %s\n", /* XXX DEAD */
-                CurrentTime, sptr->name, sptr->user->username, sptr->user->host,
-                (BadPtr(parv[3]) ? parv[1] : parv[3]), parv[2]);
-#endif /* WPATH */
-          continue;
-        case 'n':
-        case 'N':
-          matchsel |= WHO_FIELD_NIC;
-          continue;
-        case 'u':
-        case 'U':
-          matchsel |= WHO_FIELD_UID;
-          continue;
-        case 'h':
-        case 'H':
-          matchsel |= WHO_FIELD_HOS;
-          continue;
-        case 'i':
-        case 'I':
-          matchsel |= WHO_FIELD_NIP;
-          continue;
-        case 's':
-        case 'S':
-          matchsel |= WHO_FIELD_SER;
-          continue;
-        case 'r':
-        case 'R':
-          matchsel |= WHO_FIELD_REN;
-          continue;
-      }
-    if (ch == '%')
-      while ((ch = *p++) && (ch != ','))
-      {
-        counter++;
-        switch (ch)
-        {
-          case 'c':
-          case 'C':
-            fields |= WHO_FIELD_CHA;
-            break;
-          case 'd':
-          case 'D':
-            fields |= WHO_FIELD_DIS;
-            break;
-          case 'f':
-          case 'F':
-            fields |= WHO_FIELD_FLA;
-            break;
-          case 'h':
-          case 'H':
-            fields |= WHO_FIELD_HOS;
-            break;
-          case 'i':
-          case 'I':
-            fields |= WHO_FIELD_NIP;
-            break;
-          case 'n':
-          case 'N':
-            fields |= WHO_FIELD_NIC;
-            break;
-          case 'r':
-          case 'R':
-            fields |= WHO_FIELD_REN;
-            break;
-          case 's':
-          case 'S':
-            fields |= WHO_FIELD_SER;
-            break;
-          case 't':
-          case 'T':
-            fields |= WHO_FIELD_QTY;
-            break;
-          case 'u':
-          case 'U':
-            fields |= WHO_FIELD_UID;
-            break;
-          default:
-            break;
-        }
-      };
-    if (ch)
-      qrt = p;
-  }
-
-  if (!matchsel)
-    matchsel = WHO_FIELD_DEF;
-  if (!fields)
-    counter = 7;
-
-  if (qrt && (fields & WHO_FIELD_QTY))
-  {
-    p = qrt;
-    if (!((*p > '9') || (*p < '0')))
-      p++;
-    if (!((*p > '9') || (*p < '0')))
-      p++;
-    if (!((*p > '9') || (*p < '0')))
-      p++;
-    *p = '\0';
-  }
-  else
-    qrt = 0;
-
-  /* I'd love to add also a check on the number of matches fields per time */
-  counter = (2048 / (counter + 4));
-  if (mask && (strlen(mask) > 510))
-    mask[510] = '\0';
-  move_marker();
-  commas = (mask && strchr(mask, ','));
-
-  /* First treat mask as a list of plain nicks/channels */
-  if (mask)
-  {
-    strcpy(mymask, mask);
-    for (p = 0, nick = ircd_strtok(&p, mymask, ","); nick;
-        nick = ircd_strtok(&p, 0, ","))
-    {
-      if (IsChannelName(nick) && (chptr = FindChannel(nick)))
-      {
-        isthere = (find_channel_member(sptr, chptr) != 0);
-        if (isthere || SEE_CHANNEL(sptr, chptr, bitsel))
-        {
-          struct Membership* member;
-          for (member = chptr->members; member; member = member->next_member)
-          {
-            acptr = member->user;
-            if ((bitsel & WHOSELECT_OPER) && !(IsAnOper(acptr)))
-              continue;
-            if ((acptr != sptr) && (member->status & CHFL_ZOMBIE))
-              continue;
-            if (!(isthere || (SEE_USER(sptr, acptr, bitsel))))
-              continue;
-            if (!Process(acptr))        /* This can't be moved before other checks */
-              continue;
-            if (!(isthere || (SHOW_MORE(sptr, counter))))
-              break;
-            do_who(sptr, acptr, chptr, fields, qrt);
-          }
-        }
-      }
-      else
-      {
-        if ((acptr = FindUser(nick)) &&
-            ((!(bitsel & WHOSELECT_OPER)) || IsAnOper(acptr)) &&
-            Process(acptr) && SHOW_MORE(sptr, counter))
-        {
-          do_who(sptr, acptr, 0, fields, qrt);
-        }
-      }
-    }
-  }
-
-  /* If we didn't have any comma in the mask treat it as a
-     real mask and try to match all relevant fields */
-  if (!(commas || (counter < 1)))
-  {
-    int minlen, cset;
-    static struct in_mask imask;
-    if (mask)
-    {
-      matchcomp(mymask, &minlen, &cset, mask);
-      if (matchcompIP(&imask, mask))
-        matchsel &= ~WHO_FIELD_NIP;
-      if ((minlen > NICKLEN) || !(cset & NTL_IRCNK))
-        matchsel &= ~WHO_FIELD_NIC;
-      if ((matchsel & WHO_FIELD_SER) &&
-          ((minlen > HOSTLEN) || (!(cset & NTL_IRCHN))
-          || (!markMatchexServer(mymask, minlen))))
-        matchsel &= ~WHO_FIELD_SER;
-      if ((minlen > USERLEN) || !(cset & NTL_IRCUI))
-        matchsel &= ~WHO_FIELD_UID;
-      if ((minlen > HOSTLEN) || !(cset & NTL_IRCHN))
-        matchsel &= ~WHO_FIELD_HOS;
-    }
-
-    /* First of all loop through the clients in common channels */
-    if ((!(counter < 1)) && matchsel) {
-      struct Membership* member;
-      struct Membership* chan;
-      for (chan = sptr->user->channel; chan; chan = chan->next_channel) {
-        chptr = chan->channel;
-        for (member = chptr->members; member; member = member->next_member)
-        {
-          acptr = member->user;
-          if (!(IsUser(acptr) && Process(acptr)))
-            continue;           /* Now Process() is at the beginning, if we fail
-                                   we'll never have to show this acptr in this query */
-          if ((bitsel & WHOSELECT_OPER) && !IsAnOper(acptr))
-            continue;
-          if ((mask) &&
-              ((!(matchsel & WHO_FIELD_NIC))
-              || matchexec(acptr->name, mymask, minlen))
-              && ((!(matchsel & WHO_FIELD_UID))
-              || matchexec(acptr->user->username, mymask, minlen))
-              && ((!(matchsel & WHO_FIELD_SER))
-              || (!(acptr->user->server->flags & FLAGS_MAP)))
-              && ((!(matchsel & WHO_FIELD_HOS))
-              || matchexec(acptr->user->host, mymask, minlen))
-              && ((!(matchsel & WHO_FIELD_REN))
-              || matchexec(acptr->info, mymask, minlen))
-              && ((!(matchsel & WHO_FIELD_NIP))
-              || ((((acptr->ip.s_addr & imask.mask.s_addr) !=
-              imask.bits.s_addr)) || (imask.fall
-              && matchexec(inet_ntoa(acptr->ip), mymask, minlen)))))
-            continue;
-          if (!SHOW_MORE(sptr, counter))
-            break;
-          do_who(sptr, acptr, chptr, fields, qrt);
-        }
-      }
-    }
-    /* Loop through all clients :-\, if we still have something to match to 
-       and we can show more clients */
-    if ((!(counter < 1)) && matchsel)
-      for (acptr = me.prev; acptr; acptr = acptr->prev)
-      {
-        if (!(IsUser(acptr) && Process(acptr)))
-          continue;
-        if ((bitsel & WHOSELECT_OPER) && !IsAnOper(acptr))
-          continue;
-        if (!(SEE_USER(sptr, acptr, bitsel)))
-          continue;
-        if ((mask) &&
-            ((!(matchsel & WHO_FIELD_NIC))
-            || matchexec(acptr->name, mymask, minlen))
-            && ((!(matchsel & WHO_FIELD_UID))
-            || matchexec(acptr->user->username, mymask, minlen))
-            && ((!(matchsel & WHO_FIELD_SER))
-            || (!(acptr->user->server->flags & FLAGS_MAP)))
-            && ((!(matchsel & WHO_FIELD_HOS))
-            || matchexec(acptr->user->host, mymask, minlen))
-            && ((!(matchsel & WHO_FIELD_REN))
-            || matchexec(acptr->info, mymask, minlen))
-            && ((!(matchsel & WHO_FIELD_NIP))
-            || ((((acptr->ip.s_addr & imask.mask.s_addr) != imask.bits.s_addr))
-            || (imask.fall
-            && matchexec(inet_ntoa(acptr->ip), mymask, minlen)))))
-          continue;
-        if (!SHOW_MORE(sptr, counter))
-          break;
-        do_who(sptr, acptr, 0, fields, qrt);
-      }
-  }
-
-  /* Make a clean mask suitable to be sent in the "end of" */
-  if (mask && (p = strchr(mask, ' ')))
-    *p = '\0';
-  sendto_one(sptr, rpl_str(RPL_ENDOFWHO), /* XXX DEAD */
-      me.name, parv[0], BadPtr(mask) ? "*" : mask);
-
-  /* Notify the user if we decided that his query was too long */
-  if (counter < 0)
-    sendto_one(sptr, err_str(ERR_QUERYTOOLONG), me.name, parv[0], "WHO"); /* XXX DEAD */
-
-  return 0;
-}
-#endif /* 0 */
-
index 5a5d8cb3809ed10e52c79af1f4215f485ae83c83..45ac83bf6367142c9cc12b6b1f08a1cb8c8d85c6 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "channel.h"
 #include "client.h"
 #include "hash.h"
index 8090d0fdbebb420e48a559c06e372a777515e5c8..2d8e9d1fad116588deaffbf34122c4271cdbaed9 100644 (file)
  */
 #include "config.h"
 
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
@@ -170,67 +162,3 @@ int m_whowas(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   send_reply(sptr, RPL_ENDOFWHOWAS, parv[1]);
   return 0;
 }
-
-
-#if 0
-/*
- * m_whowas
- *
- * parv[0] = sender prefix
- * parv[1] = nickname queried
- * parv[2] = maximum returned items (optional, default is unlimitted)
- * parv[3] = remote server target (Opers only, max returned items 20)
- */
-int m_whowas(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  struct Whowas *temp;
-  int cur = 0;
-  int max = -1, found = 0;
-  char *p, *nick, *s;
-
-  if (parc < 2)
-  {
-    sendto_one(sptr, err_str(ERR_NONICKNAMEGIVEN), me.name, parv[0]); /* XXX DEAD */
-    return 0;
-  }
-  if (parc > 2)
-    max = atoi(parv[2]);
-  if (parc > 3)
-    if (hunt_server(1, cptr, sptr, "%s%s " TOK_WHOWAS " %s %s :%s", 3, parc, parv)) /* XXX DEAD */
-      return 0;
-
-  parv[1] = canonize(parv[1]);
-  if (!MyConnect(sptr) && (max > 20))
-    max = 20;                   /* Set max replies at 20 */
-  for (s = parv[1]; (nick = ircd_strtok(&p, s, ",")); s = 0)
-  {
-    /* Search through bucket, finding all nicknames that match */
-    found = 0;
-    for (temp = whowashash[hash_whowas_name(nick)]; temp; temp = temp->hnext)
-    {
-      if (0 == ircd_strcmp(nick, temp->name))
-      {
-        sendto_one(sptr, rpl_str(RPL_WHOWASUSER), /* XXX DEAD */
-            me.name, parv[0], temp->name, temp->username,
-            temp->hostname, temp->realname);
-        sendto_one(sptr, rpl_str(RPL_WHOISSERVER), me.name, parv[0], /* XXX DEAD */
-            temp->name, temp->servername, myctime(temp->logoff));
-        if (temp->away)
-          sendto_one(sptr, rpl_str(RPL_AWAY), /* XXX DEAD */
-              me.name, parv[0], temp->name, temp->away);
-        cur++;
-        found++;
-      }
-      if (max >= 0 && cur >= max)
-        break;
-    }
-    if (!found)
-      sendto_one(sptr, err_str(ERR_WASNOSUCHNICK), me.name, parv[0], nick); /* XXX DEAD */
-    /* To keep parv[1] intact for ENDOFWHOWAS */
-    if (p)
-      p[-1] = ',';
-  }
-  sendto_one(sptr, rpl_str(RPL_ENDOFWHOWAS), me.name, parv[0], parv[1]); /* XXX DEAD */
-  return 0;
-}
-#endif /* 0 */
index 3ded4cc5ab92ae8b9b51b3ebba60f03a7f29f9b5..3af11a558605f6e547f0054e1145214bbf0f84ab 100644 (file)
@@ -20,6 +20,7 @@
 #include "ircd_log.h"
 #include "ircd_osdep.h"
 #include "ircd_reply.h"
+#include "ircd_snprintf.h"
 #include "ircd_string.h"
 #include "msg.h"
 #include "numeric.h"
@@ -27,7 +28,6 @@
 #include "s_debug.h"
 #include "s_misc.h"
 #include "send.h"
-#include "sprintf_irc.h"
 #include "struct.h"
 #include "support.h"
 #include "sys.h"
@@ -335,7 +335,8 @@ static void start_resolver(void)
   spare_fd = open("/dev/null",O_RDONLY,0);
   if ((spare_fd < 0) || (spare_fd > 255)) {
     char sparemsg[80];
-    sprintf_irc(sparemsg, "invalid spare_fd %d", spare_fd);
+    ircd_snprintf(0, sparemsg, sizeof(sparemsg), "invalid spare_fd %d",
+                 spare_fd);
     server_restart(sparemsg);
   }
 
@@ -715,9 +716,9 @@ static void do_query_number(const struct DNSQuery* query,
 
   assert(0 != addr);
   cp = (const unsigned char*) &addr->s_addr;
-  sprintf_irc(ipbuf, "%u.%u.%u.%u.in-addr.arpa.",
-              (unsigned int)(cp[3]), (unsigned int)(cp[2]),
-              (unsigned int)(cp[1]), (unsigned int)(cp[0]));
+  ircd_snprintf(0, ipbuf, sizeof(ipbuf), "%u.%u.%u.%u.in-addr.arpa.",
+               (unsigned int)(cp[3]), (unsigned int)(cp[2]),
+               (unsigned int)(cp[1]), (unsigned int)(cp[0]));
 
   if (!request) {
     request              = make_request(query);
@@ -1449,9 +1450,6 @@ static struct CacheEntry* add_to_cache(struct CacheEntry* ocp)
 */
 static void update_list(struct ResRequest* request, struct CacheEntry* cachep)
 {
-#if 0
-  struct CacheEntry** cpp;
-#endif
   struct CacheEntry*  cp = cachep;
   char*    s;
   char*    t;
@@ -1466,17 +1464,6 @@ static void update_list(struct ResRequest* request, struct CacheEntry* cachep)
    * If found, move the entry to the top of the list and return.
    */
   ++cainfo.ca_updates;
-#if 0
-  for (cpp = &cacheTop; *cpp; cpp = &((*cpp)->list_next)) {
-    if (cp == *cpp)
-      break;
-  }
-  if (!*cpp)
-    return;
-  *cpp = cp->list_next;
-  cp->list_next = cacheTop;
-  cacheTop = cp;
-#endif
 
   if (!request)
     return;
index 5ac17026e57bf808463d022eaf7bafa8773e4aca..6ad278a87e35082cbe675434dbd573d4109b726c 100644 (file)
@@ -39,6 +39,7 @@
 #include "ircd_features.h"
 #include "ircd_log.h"
 #include "ircd_osdep.h"
+#include "ircd_snprintf.h"
 #include "ircd_string.h"
 #include "list.h"
 #include "numeric.h"
@@ -48,7 +49,6 @@
 #include "s_debug.h"
 #include "s_misc.h"
 #include "send.h"
-#include "sprintf_irc.h"
 #include "struct.h"
 #include "sys.h"               /* TRUE bleah */
 
@@ -430,24 +430,14 @@ static int start_auth_query(struct AuthRequest* auth)
   assert(0 != auth->client);
 
   if ((fd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
-#if 0
-    report_error(SOCKET_ERROR_MSG, get_client_name(auth->client, HIDE_IP), errno);
-#endif
     ++ServerStats->is_abad;
     return 0;
   }
   if ((MAXCONNECTIONS - 10) < fd) {
-#if 0
-    report_error(CONNLIMIT_ERROR_MSG, 
-                 get_client_name(auth->client, HIDE_IP), errno);
-#endif
     close(fd);
     return 0;
   }
   if (!os_set_nonblocking(fd)) {
-#if 0
-    report_error(NONB_ERROR_MSG, get_client_name(auth->client, HIDE_IP), errno);
-#endif
     close(fd);
     return 0;
   }
@@ -465,10 +455,6 @@ static int start_auth_query(struct AuthRequest* auth)
   local_addr.sin_port = htons(0);
 
   if (bind(fd, (struct sockaddr*) &local_addr, sizeof(struct sockaddr_in))) {
-#if 0
-    report_error(BIND_ERROR_MSG,
-                 get_client_name(auth->client, HIDE_IP), errno);
-#endif
     close(fd);
     return 0;
   }
@@ -578,69 +564,6 @@ static char* check_ident_reply(char* reply)
   return token;
 }
 
-#if 0
-/*
- * GetValidIdent - parse ident query reply from identd server
- * 
- * Inputs        - pointer to ident buf
- * Output        - NULL if no valid ident found, otherwise pointer to name
- * Side effects        -
- */
-static char* GetValidIdent(char *buf)
-{
-  int   remp = 0;
-  int   locp = 0;
-  char* colon1Ptr;
-  char* colon2Ptr;
-  char* colon3Ptr;
-  char* commaPtr;
-  char* remotePortString;
-
-  /* All this to get rid of a sscanf() fun. */
-  remotePortString = buf;
-  
-  colon1Ptr = strchr(remotePortString,':');
-  if(!colon1Ptr)
-    return 0;
-
-  *colon1Ptr = '\0';
-  colon1Ptr++;
-  colon2Ptr = strchr(colon1Ptr,':');
-  if(!colon2Ptr)
-    return 0;
-
-  *colon2Ptr = '\0';
-  colon2Ptr++;
-  commaPtr = strchr(remotePortString, ',');
-
-  if(!commaPtr)
-    return 0;
-
-  *commaPtr = '\0';
-  commaPtr++;
-
-  remp = atoi(remotePortString);
-  if(!remp)
-    return 0;
-              
-  locp = atoi(commaPtr);
-  if(!locp)
-    return 0;
-
-  /* look for USERID bordered by first pair of colons */
-  if(!strstr(colon1Ptr, "USERID"))
-    return 0;
-
-  colon3Ptr = strchr(colon2Ptr,':');
-  if(!colon3Ptr)
-    return 0;
-  
-  *colon3Ptr = '\0';
-  colon3Ptr++;
-  return(colon3Ptr);
-}
-#endif
-
 /*
  * start_auth - starts auth (identd) and dns queries for a client
  */
@@ -722,9 +645,9 @@ void send_auth_query(struct AuthRequest* auth)
     auth_error(auth, 1);
     return;
   }
-  sprintf_irc(authbuf, "%u , %u\r\n",
-             (unsigned int) ntohs(them.sin_port),
-             (unsigned int) ntohs(us.sin_port));
+  ircd_snprintf(0, authbuf, sizeof(authbuf), "%u , %u\r\n",
+               (unsigned int) ntohs(them.sin_port),
+               (unsigned int) ntohs(us.sin_port));
 
   if (IO_SUCCESS == os_send_nonb(auth->fd, authbuf, strlen(authbuf), &count)) {
     ClearAuthConnect(auth);
@@ -780,9 +703,6 @@ void read_auth_reply(struct AuthRequest* auth)
   }
   else {
     ++ServerStats->is_abad;
-#if 0
-    strcpy(cli_username(auth->client), "unknown");
-#endif
   }
   unlink_auth_request(auth, &AuthPollList);
 
@@ -793,5 +713,3 @@ void read_auth_reply(struct AuthRequest* auth)
     free_auth_request(auth);
   }
 }
-
-
index ed5bc8399de23f8b952bf4670631aeab3aa2ac64..459c9d399c929f2409eb7f158dcf6bd6bf9ad394 100644 (file)
@@ -31,6 +31,7 @@
 #include "ircd_features.h"
 #include "ircd_osdep.h"
 #include "ircd_reply.h"
+#include "ircd_snprintf.h"
 #include "ircd_string.h"
 #include "ircd.h"
 #include "list.h"
@@ -49,7 +50,6 @@
 #include "s_misc.h"
 #include "s_user.h"
 #include "send.h"
-#include "sprintf_irc.h"
 #include "struct.h"
 #include "support.h"
 #include "sys.h"
@@ -890,7 +890,8 @@ int connect_server(struct ConfItem* aconf, struct Client* by,
    */
   make_server(cptr);
   if (by && IsUser(by)) {
-    sprintf_irc(cli_serv(cptr)->by, "%s%s", NumNick(by));
+    ircd_snprintf(0, cli_serv(cptr)->by, sizeof(cli_serv(cptr)->by), "%s%s",
+                 NumNick(by));
     assert(0 == cli_serv(cptr)->user);
     cli_serv(cptr)->user = cli_user(by);
     cli_user(by)->refcnt++;
index 05cd7ce2b8e81a689cb835398401eb9a697495f9..276d4265b80d73654a9e093e2581b8febafe3c99 100644 (file)
@@ -50,7 +50,6 @@
 #include "s_debug.h"
 #include "s_misc.h"
 #include "send.h"
-#include "sprintf_irc.h"
 #include "struct.h"
 #include "support.h"
 #include "sys.h"
@@ -882,7 +881,8 @@ void conf_add_deny(const char* const* fields, int count, int ip_kill)
     else {
       conf->bits = bits2;
     }
-    sprintf_irc(ipname, "%d.%d.%d.%d", ad[0], ad[1], ad[2], ad[3]);
+    ircd_snprintf(0, ipname, sizeof(ipname), "%d.%d.%d.%d", ad[0], ad[1],
+                 ad[2], ad[3]);
     
     /*
      * This ensures endian correctness
index 8e3728a29239e5bd894f28621ab21bd0e2c6cd4e..dca9205def79ba1615c22485f0c40e31eb47c587 100644 (file)
@@ -290,13 +290,6 @@ void count_memory(struct Client *cptr, char *nick)
   {
     ch++;
     chm += (strlen(chptr->chname) + sizeof(struct Channel));
-#if 0
-    /*
-     * XXX - Members already counted in clients, don't count twice
-     */
-    for (member = chptr->members; member; member = member->next_member)
-      chu++;
-#endif
     for (link = chptr->invites; link; link = link->next)
       chi++;
     for (link = chptr->banlist; link; link = link->next)
index f5a382d6a04798b84dcddbcd37756038e82401a7..837952bea3665a85a7e53ae5b75c3760f4570b91 100644 (file)
@@ -22,7 +22,6 @@
 
 #include "numeric.h"
 #include "s_debug.h"
-#include "sprintf_irc.h"
 
 #include <assert.h>
 #include <string.h>
@@ -1245,6 +1244,212 @@ const struct Numeric* get_error_numeric(int n)
 
 static char numbuff[512];
 
+/* *INDENT-OFF* */
+
+static const char atoi_tab[4000] = {
+    '0','0','0',0, '0','0','1',0, '0','0','2',0, '0','0','3',0, '0','0','4',0,
+    '0','0','5',0, '0','0','6',0, '0','0','7',0, '0','0','8',0, '0','0','9',0,
+    '0','1','0',0, '0','1','1',0, '0','1','2',0, '0','1','3',0, '0','1','4',0,
+    '0','1','5',0, '0','1','6',0, '0','1','7',0, '0','1','8',0, '0','1','9',0,
+    '0','2','0',0, '0','2','1',0, '0','2','2',0, '0','2','3',0, '0','2','4',0,
+    '0','2','5',0, '0','2','6',0, '0','2','7',0, '0','2','8',0, '0','2','9',0,
+    '0','3','0',0, '0','3','1',0, '0','3','2',0, '0','3','3',0, '0','3','4',0,
+    '0','3','5',0, '0','3','6',0, '0','3','7',0, '0','3','8',0, '0','3','9',0,
+    '0','4','0',0, '0','4','1',0, '0','4','2',0, '0','4','3',0, '0','4','4',0,
+    '0','4','5',0, '0','4','6',0, '0','4','7',0, '0','4','8',0, '0','4','9',0,
+    '0','5','0',0, '0','5','1',0, '0','5','2',0, '0','5','3',0, '0','5','4',0,
+    '0','5','5',0, '0','5','6',0, '0','5','7',0, '0','5','8',0, '0','5','9',0,
+    '0','6','0',0, '0','6','1',0, '0','6','2',0, '0','6','3',0, '0','6','4',0,
+    '0','6','5',0, '0','6','6',0, '0','6','7',0, '0','6','8',0, '0','6','9',0,
+    '0','7','0',0, '0','7','1',0, '0','7','2',0, '0','7','3',0, '0','7','4',0,
+    '0','7','5',0, '0','7','6',0, '0','7','7',0, '0','7','8',0, '0','7','9',0,
+    '0','8','0',0, '0','8','1',0, '0','8','2',0, '0','8','3',0, '0','8','4',0,
+    '0','8','5',0, '0','8','6',0, '0','8','7',0, '0','8','8',0, '0','8','9',0,
+    '0','9','0',0, '0','9','1',0, '0','9','2',0, '0','9','3',0, '0','9','4',0,
+    '0','9','5',0, '0','9','6',0, '0','9','7',0, '0','9','8',0, '0','9','9',0,
+    '1','0','0',0, '1','0','1',0, '1','0','2',0, '1','0','3',0, '1','0','4',0,
+    '1','0','5',0, '1','0','6',0, '1','0','7',0, '1','0','8',0, '1','0','9',0,
+    '1','1','0',0, '1','1','1',0, '1','1','2',0, '1','1','3',0, '1','1','4',0,
+    '1','1','5',0, '1','1','6',0, '1','1','7',0, '1','1','8',0, '1','1','9',0,
+    '1','2','0',0, '1','2','1',0, '1','2','2',0, '1','2','3',0, '1','2','4',0,
+    '1','2','5',0, '1','2','6',0, '1','2','7',0, '1','2','8',0, '1','2','9',0,
+    '1','3','0',0, '1','3','1',0, '1','3','2',0, '1','3','3',0, '1','3','4',0,
+    '1','3','5',0, '1','3','6',0, '1','3','7',0, '1','3','8',0, '1','3','9',0,
+    '1','4','0',0, '1','4','1',0, '1','4','2',0, '1','4','3',0, '1','4','4',0,
+    '1','4','5',0, '1','4','6',0, '1','4','7',0, '1','4','8',0, '1','4','9',0,
+    '1','5','0',0, '1','5','1',0, '1','5','2',0, '1','5','3',0, '1','5','4',0,
+    '1','5','5',0, '1','5','6',0, '1','5','7',0, '1','5','8',0, '1','5','9',0,
+    '1','6','0',0, '1','6','1',0, '1','6','2',0, '1','6','3',0, '1','6','4',0,
+    '1','6','5',0, '1','6','6',0, '1','6','7',0, '1','6','8',0, '1','6','9',0,
+    '1','7','0',0, '1','7','1',0, '1','7','2',0, '1','7','3',0, '1','7','4',0,
+    '1','7','5',0, '1','7','6',0, '1','7','7',0, '1','7','8',0, '1','7','9',0,
+    '1','8','0',0, '1','8','1',0, '1','8','2',0, '1','8','3',0, '1','8','4',0,
+    '1','8','5',0, '1','8','6',0, '1','8','7',0, '1','8','8',0, '1','8','9',0,
+    '1','9','0',0, '1','9','1',0, '1','9','2',0, '1','9','3',0, '1','9','4',0,
+    '1','9','5',0, '1','9','6',0, '1','9','7',0, '1','9','8',0, '1','9','9',0,
+    '2','0','0',0, '2','0','1',0, '2','0','2',0, '2','0','3',0, '2','0','4',0,
+    '2','0','5',0, '2','0','6',0, '2','0','7',0, '2','0','8',0, '2','0','9',0,
+    '2','1','0',0, '2','1','1',0, '2','1','2',0, '2','1','3',0, '2','1','4',0,
+    '2','1','5',0, '2','1','6',0, '2','1','7',0, '2','1','8',0, '2','1','9',0,
+    '2','2','0',0, '2','2','1',0, '2','2','2',0, '2','2','3',0, '2','2','4',0,
+    '2','2','5',0, '2','2','6',0, '2','2','7',0, '2','2','8',0, '2','2','9',0,
+    '2','3','0',0, '2','3','1',0, '2','3','2',0, '2','3','3',0, '2','3','4',0,
+    '2','3','5',0, '2','3','6',0, '2','3','7',0, '2','3','8',0, '2','3','9',0,
+    '2','4','0',0, '2','4','1',0, '2','4','2',0, '2','4','3',0, '2','4','4',0,
+    '2','4','5',0, '2','4','6',0, '2','4','7',0, '2','4','8',0, '2','4','9',0,
+    '2','5','0',0, '2','5','1',0, '2','5','2',0, '2','5','3',0, '2','5','4',0,
+    '2','5','5',0, '2','5','6',0, '2','5','7',0, '2','5','8',0, '2','5','9',0,
+    '2','6','0',0, '2','6','1',0, '2','6','2',0, '2','6','3',0, '2','6','4',0,
+    '2','6','5',0, '2','6','6',0, '2','6','7',0, '2','6','8',0, '2','6','9',0,
+    '2','7','0',0, '2','7','1',0, '2','7','2',0, '2','7','3',0, '2','7','4',0,
+    '2','7','5',0, '2','7','6',0, '2','7','7',0, '2','7','8',0, '2','7','9',0,
+    '2','8','0',0, '2','8','1',0, '2','8','2',0, '2','8','3',0, '2','8','4',0,
+    '2','8','5',0, '2','8','6',0, '2','8','7',0, '2','8','8',0, '2','8','9',0,
+    '2','9','0',0, '2','9','1',0, '2','9','2',0, '2','9','3',0, '2','9','4',0,
+    '2','9','5',0, '2','9','6',0, '2','9','7',0, '2','9','8',0, '2','9','9',0,
+    '3','0','0',0, '3','0','1',0, '3','0','2',0, '3','0','3',0, '3','0','4',0,
+    '3','0','5',0, '3','0','6',0, '3','0','7',0, '3','0','8',0, '3','0','9',0,
+    '3','1','0',0, '3','1','1',0, '3','1','2',0, '3','1','3',0, '3','1','4',0,
+    '3','1','5',0, '3','1','6',0, '3','1','7',0, '3','1','8',0, '3','1','9',0,
+    '3','2','0',0, '3','2','1',0, '3','2','2',0, '3','2','3',0, '3','2','4',0,
+    '3','2','5',0, '3','2','6',0, '3','2','7',0, '3','2','8',0, '3','2','9',0,
+    '3','3','0',0, '3','3','1',0, '3','3','2',0, '3','3','3',0, '3','3','4',0,
+    '3','3','5',0, '3','3','6',0, '3','3','7',0, '3','3','8',0, '3','3','9',0,
+    '3','4','0',0, '3','4','1',0, '3','4','2',0, '3','4','3',0, '3','4','4',0,
+    '3','4','5',0, '3','4','6',0, '3','4','7',0, '3','4','8',0, '3','4','9',0,
+    '3','5','0',0, '3','5','1',0, '3','5','2',0, '3','5','3',0, '3','5','4',0,
+    '3','5','5',0, '3','5','6',0, '3','5','7',0, '3','5','8',0, '3','5','9',0,
+    '3','6','0',0, '3','6','1',0, '3','6','2',0, '3','6','3',0, '3','6','4',0,
+    '3','6','5',0, '3','6','6',0, '3','6','7',0, '3','6','8',0, '3','6','9',0,
+    '3','7','0',0, '3','7','1',0, '3','7','2',0, '3','7','3',0, '3','7','4',0,
+    '3','7','5',0, '3','7','6',0, '3','7','7',0, '3','7','8',0, '3','7','9',0,
+    '3','8','0',0, '3','8','1',0, '3','8','2',0, '3','8','3',0, '3','8','4',0,
+    '3','8','5',0, '3','8','6',0, '3','8','7',0, '3','8','8',0, '3','8','9',0,
+    '3','9','0',0, '3','9','1',0, '3','9','2',0, '3','9','3',0, '3','9','4',0,
+    '3','9','5',0, '3','9','6',0, '3','9','7',0, '3','9','8',0, '3','9','9',0,
+    '4','0','0',0, '4','0','1',0, '4','0','2',0, '4','0','3',0, '4','0','4',0,
+    '4','0','5',0, '4','0','6',0, '4','0','7',0, '4','0','8',0, '4','0','9',0,
+    '4','1','0',0, '4','1','1',0, '4','1','2',0, '4','1','3',0, '4','1','4',0,
+    '4','1','5',0, '4','1','6',0, '4','1','7',0, '4','1','8',0, '4','1','9',0,
+    '4','2','0',0, '4','2','1',0, '4','2','2',0, '4','2','3',0, '4','2','4',0,
+    '4','2','5',0, '4','2','6',0, '4','2','7',0, '4','2','8',0, '4','2','9',0,
+    '4','3','0',0, '4','3','1',0, '4','3','2',0, '4','3','3',0, '4','3','4',0,
+    '4','3','5',0, '4','3','6',0, '4','3','7',0, '4','3','8',0, '4','3','9',0,
+    '4','4','0',0, '4','4','1',0, '4','4','2',0, '4','4','3',0, '4','4','4',0,
+    '4','4','5',0, '4','4','6',0, '4','4','7',0, '4','4','8',0, '4','4','9',0,
+    '4','5','0',0, '4','5','1',0, '4','5','2',0, '4','5','3',0, '4','5','4',0,
+    '4','5','5',0, '4','5','6',0, '4','5','7',0, '4','5','8',0, '4','5','9',0,
+    '4','6','0',0, '4','6','1',0, '4','6','2',0, '4','6','3',0, '4','6','4',0,
+    '4','6','5',0, '4','6','6',0, '4','6','7',0, '4','6','8',0, '4','6','9',0,
+    '4','7','0',0, '4','7','1',0, '4','7','2',0, '4','7','3',0, '4','7','4',0,
+    '4','7','5',0, '4','7','6',0, '4','7','7',0, '4','7','8',0, '4','7','9',0,
+    '4','8','0',0, '4','8','1',0, '4','8','2',0, '4','8','3',0, '4','8','4',0,
+    '4','8','5',0, '4','8','6',0, '4','8','7',0, '4','8','8',0, '4','8','9',0,
+    '4','9','0',0, '4','9','1',0, '4','9','2',0, '4','9','3',0, '4','9','4',0,
+    '4','9','5',0, '4','9','6',0, '4','9','7',0, '4','9','8',0, '4','9','9',0,
+    '5','0','0',0, '5','0','1',0, '5','0','2',0, '5','0','3',0, '5','0','4',0,
+    '5','0','5',0, '5','0','6',0, '5','0','7',0, '5','0','8',0, '5','0','9',0,
+    '5','1','0',0, '5','1','1',0, '5','1','2',0, '5','1','3',0, '5','1','4',0,
+    '5','1','5',0, '5','1','6',0, '5','1','7',0, '5','1','8',0, '5','1','9',0,
+    '5','2','0',0, '5','2','1',0, '5','2','2',0, '5','2','3',0, '5','2','4',0,
+    '5','2','5',0, '5','2','6',0, '5','2','7',0, '5','2','8',0, '5','2','9',0,
+    '5','3','0',0, '5','3','1',0, '5','3','2',0, '5','3','3',0, '5','3','4',0,
+    '5','3','5',0, '5','3','6',0, '5','3','7',0, '5','3','8',0, '5','3','9',0,
+    '5','4','0',0, '5','4','1',0, '5','4','2',0, '5','4','3',0, '5','4','4',0,
+    '5','4','5',0, '5','4','6',0, '5','4','7',0, '5','4','8',0, '5','4','9',0,
+    '5','5','0',0, '5','5','1',0, '5','5','2',0, '5','5','3',0, '5','5','4',0,
+    '5','5','5',0, '5','5','6',0, '5','5','7',0, '5','5','8',0, '5','5','9',0,
+    '5','6','0',0, '5','6','1',0, '5','6','2',0, '5','6','3',0, '5','6','4',0,
+    '5','6','5',0, '5','6','6',0, '5','6','7',0, '5','6','8',0, '5','6','9',0,
+    '5','7','0',0, '5','7','1',0, '5','7','2',0, '5','7','3',0, '5','7','4',0,
+    '5','7','5',0, '5','7','6',0, '5','7','7',0, '5','7','8',0, '5','7','9',0,
+    '5','8','0',0, '5','8','1',0, '5','8','2',0, '5','8','3',0, '5','8','4',0,
+    '5','8','5',0, '5','8','6',0, '5','8','7',0, '5','8','8',0, '5','8','9',0,
+    '5','9','0',0, '5','9','1',0, '5','9','2',0, '5','9','3',0, '5','9','4',0,
+    '5','9','5',0, '5','9','6',0, '5','9','7',0, '5','9','8',0, '5','9','9',0,
+    '6','0','0',0, '6','0','1',0, '6','0','2',0, '6','0','3',0, '6','0','4',0,
+    '6','0','5',0, '6','0','6',0, '6','0','7',0, '6','0','8',0, '6','0','9',0,
+    '6','1','0',0, '6','1','1',0, '6','1','2',0, '6','1','3',0, '6','1','4',0,
+    '6','1','5',0, '6','1','6',0, '6','1','7',0, '6','1','8',0, '6','1','9',0,
+    '6','2','0',0, '6','2','1',0, '6','2','2',0, '6','2','3',0, '6','2','4',0,
+    '6','2','5',0, '6','2','6',0, '6','2','7',0, '6','2','8',0, '6','2','9',0,
+    '6','3','0',0, '6','3','1',0, '6','3','2',0, '6','3','3',0, '6','3','4',0,
+    '6','3','5',0, '6','3','6',0, '6','3','7',0, '6','3','8',0, '6','3','9',0,
+    '6','4','0',0, '6','4','1',0, '6','4','2',0, '6','4','3',0, '6','4','4',0,
+    '6','4','5',0, '6','4','6',0, '6','4','7',0, '6','4','8',0, '6','4','9',0,
+    '6','5','0',0, '6','5','1',0, '6','5','2',0, '6','5','3',0, '6','5','4',0,
+    '6','5','5',0, '6','5','6',0, '6','5','7',0, '6','5','8',0, '6','5','9',0,
+    '6','6','0',0, '6','6','1',0, '6','6','2',0, '6','6','3',0, '6','6','4',0,
+    '6','6','5',0, '6','6','6',0, '6','6','7',0, '6','6','8',0, '6','6','9',0,
+    '6','7','0',0, '6','7','1',0, '6','7','2',0, '6','7','3',0, '6','7','4',0,
+    '6','7','5',0, '6','7','6',0, '6','7','7',0, '6','7','8',0, '6','7','9',0,
+    '6','8','0',0, '6','8','1',0, '6','8','2',0, '6','8','3',0, '6','8','4',0,
+    '6','8','5',0, '6','8','6',0, '6','8','7',0, '6','8','8',0, '6','8','9',0,
+    '6','9','0',0, '6','9','1',0, '6','9','2',0, '6','9','3',0, '6','9','4',0,
+    '6','9','5',0, '6','9','6',0, '6','9','7',0, '6','9','8',0, '6','9','9',0,
+    '7','0','0',0, '7','0','1',0, '7','0','2',0, '7','0','3',0, '7','0','4',0,
+    '7','0','5',0, '7','0','6',0, '7','0','7',0, '7','0','8',0, '7','0','9',0,
+    '7','1','0',0, '7','1','1',0, '7','1','2',0, '7','1','3',0, '7','1','4',0,
+    '7','1','5',0, '7','1','6',0, '7','1','7',0, '7','1','8',0, '7','1','9',0,
+    '7','2','0',0, '7','2','1',0, '7','2','2',0, '7','2','3',0, '7','2','4',0,
+    '7','2','5',0, '7','2','6',0, '7','2','7',0, '7','2','8',0, '7','2','9',0,
+    '7','3','0',0, '7','3','1',0, '7','3','2',0, '7','3','3',0, '7','3','4',0,
+    '7','3','5',0, '7','3','6',0, '7','3','7',0, '7','3','8',0, '7','3','9',0,
+    '7','4','0',0, '7','4','1',0, '7','4','2',0, '7','4','3',0, '7','4','4',0,
+    '7','4','5',0, '7','4','6',0, '7','4','7',0, '7','4','8',0, '7','4','9',0,
+    '7','5','0',0, '7','5','1',0, '7','5','2',0, '7','5','3',0, '7','5','4',0,
+    '7','5','5',0, '7','5','6',0, '7','5','7',0, '7','5','8',0, '7','5','9',0,
+    '7','6','0',0, '7','6','1',0, '7','6','2',0, '7','6','3',0, '7','6','4',0,
+    '7','6','5',0, '7','6','6',0, '7','6','7',0, '7','6','8',0, '7','6','9',0,
+    '7','7','0',0, '7','7','1',0, '7','7','2',0, '7','7','3',0, '7','7','4',0,
+    '7','7','5',0, '7','7','6',0, '7','7','7',0, '7','7','8',0, '7','7','9',0,
+    '7','8','0',0, '7','8','1',0, '7','8','2',0, '7','8','3',0, '7','8','4',0,
+    '7','8','5',0, '7','8','6',0, '7','8','7',0, '7','8','8',0, '7','8','9',0,
+    '7','9','0',0, '7','9','1',0, '7','9','2',0, '7','9','3',0, '7','9','4',0,
+    '7','9','5',0, '7','9','6',0, '7','9','7',0, '7','9','8',0, '7','9','9',0,
+    '8','0','0',0, '8','0','1',0, '8','0','2',0, '8','0','3',0, '8','0','4',0,
+    '8','0','5',0, '8','0','6',0, '8','0','7',0, '8','0','8',0, '8','0','9',0,
+    '8','1','0',0, '8','1','1',0, '8','1','2',0, '8','1','3',0, '8','1','4',0,
+    '8','1','5',0, '8','1','6',0, '8','1','7',0, '8','1','8',0, '8','1','9',0,
+    '8','2','0',0, '8','2','1',0, '8','2','2',0, '8','2','3',0, '8','2','4',0,
+    '8','2','5',0, '8','2','6',0, '8','2','7',0, '8','2','8',0, '8','2','9',0,
+    '8','3','0',0, '8','3','1',0, '8','3','2',0, '8','3','3',0, '8','3','4',0,
+    '8','3','5',0, '8','3','6',0, '8','3','7',0, '8','3','8',0, '8','3','9',0,
+    '8','4','0',0, '8','4','1',0, '8','4','2',0, '8','4','3',0, '8','4','4',0,
+    '8','4','5',0, '8','4','6',0, '8','4','7',0, '8','4','8',0, '8','4','9',0,
+    '8','5','0',0, '8','5','1',0, '8','5','2',0, '8','5','3',0, '8','5','4',0,
+    '8','5','5',0, '8','5','6',0, '8','5','7',0, '8','5','8',0, '8','5','9',0,
+    '8','6','0',0, '8','6','1',0, '8','6','2',0, '8','6','3',0, '8','6','4',0,
+    '8','6','5',0, '8','6','6',0, '8','6','7',0, '8','6','8',0, '8','6','9',0,
+    '8','7','0',0, '8','7','1',0, '8','7','2',0, '8','7','3',0, '8','7','4',0,
+    '8','7','5',0, '8','7','6',0, '8','7','7',0, '8','7','8',0, '8','7','9',0,
+    '8','8','0',0, '8','8','1',0, '8','8','2',0, '8','8','3',0, '8','8','4',0,
+    '8','8','5',0, '8','8','6',0, '8','8','7',0, '8','8','8',0, '8','8','9',0,
+    '8','9','0',0, '8','9','1',0, '8','9','2',0, '8','9','3',0, '8','9','4',0,
+    '8','9','5',0, '8','9','6',0, '8','9','7',0, '8','9','8',0, '8','9','9',0,
+    '9','0','0',0, '9','0','1',0, '9','0','2',0, '9','0','3',0, '9','0','4',0,
+    '9','0','5',0, '9','0','6',0, '9','0','7',0, '9','0','8',0, '9','0','9',0,
+    '9','1','0',0, '9','1','1',0, '9','1','2',0, '9','1','3',0, '9','1','4',0,
+    '9','1','5',0, '9','1','6',0, '9','1','7',0, '9','1','8',0, '9','1','9',0,
+    '9','2','0',0, '9','2','1',0, '9','2','2',0, '9','2','3',0, '9','2','4',0,
+    '9','2','5',0, '9','2','6',0, '9','2','7',0, '9','2','8',0, '9','2','9',0,
+    '9','3','0',0, '9','3','1',0, '9','3','2',0, '9','3','3',0, '9','3','4',0,
+    '9','3','5',0, '9','3','6',0, '9','3','7',0, '9','3','8',0, '9','3','9',0,
+    '9','4','0',0, '9','4','1',0, '9','4','2',0, '9','4','3',0, '9','4','4',0,
+    '9','4','5',0, '9','4','6',0, '9','4','7',0, '9','4','8',0, '9','4','9',0,
+    '9','5','0',0, '9','5','1',0, '9','5','2',0, '9','5','3',0, '9','5','4',0,
+    '9','5','5',0, '9','5','6',0, '9','5','7',0, '9','5','8',0, '9','5','9',0,
+    '9','6','0',0, '9','6','1',0, '9','6','2',0, '9','6','3',0, '9','6','4',0,
+    '9','6','5',0, '9','6','6',0, '9','6','7',0, '9','6','8',0, '9','6','9',0,
+    '9','7','0',0, '9','7','1',0, '9','7','2',0, '9','7','3',0, '9','7','4',0,
+    '9','7','5',0, '9','7','6',0, '9','7','7',0, '9','7','8',0, '9','7','9',0,
+    '9','8','0',0, '9','8','1',0, '9','8','2',0, '9','8','3',0, '9','8','4',0,
+    '9','8','5',0, '9','8','6',0, '9','8','7',0, '9','8','8',0, '9','8','9',0,
+    '9','9','0',0, '9','9','1',0, '9','9','2',0, '9','9','3',0, '9','9','4',0,
+    '9','9','5',0, '9','9','6',0, '9','9','7',0, '9','9','8',0, '9','9','9',0 };
+
+/* *INDENT-ON* */
+
 /* "inline" */
 #define prepbuf(buffer, num, tail)                      \
 {                                                       \
index aafdb25b348b00e9ba4eb227e921712e5df94d42..99ed512d81e0694881b0f5570857fb30ae6cddcb 100644 (file)
@@ -34,6 +34,7 @@
 #include "ircd_log.h"
 #include "ircd_policy.h"
 #include "ircd_reply.h"
+#include "ircd_snprintf.h"
 #include "ircd_string.h"
 #include "list.h"
 #include "match.h"
@@ -48,7 +49,6 @@
 #include "s_debug.h"
 #include "s_user.h"
 #include "send.h"
-#include "sprintf_irc.h"
 #include "struct.h"
 #include "support.h"
 #include "sys.h"
@@ -168,7 +168,7 @@ const char* get_client_name(const struct Client* sptr, int showip)
 
   if (MyConnect(sptr)) {
     if (showip)
-      sprintf_irc(nbuf, "%s[%s@%s]", cli_name(sptr),
+      ircd_snprintf(0, nbuf, sizeof(nbuf), "%s[%s@%s]", cli_name(sptr),
             (IsIdented(sptr)) ? cli_username(sptr) : "", cli_sock_ip(sptr));
     else
         return cli_name(sptr);
@@ -498,7 +498,7 @@ int vexit_client_msg(struct Client *cptr, struct Client *bcptr, struct Client *s
     const char *pattern, va_list vl)
 {
   char msgbuf[1024];
-  vsprintf_irc(msgbuf, pattern, vl);
+  ircd_vsnprintf(0, msgbuf, sizeof(msgbuf), pattern, vl);
   return exit_client(cptr, bcptr, sptr, msgbuf);
 }
 
@@ -509,7 +509,7 @@ int exit_client_msg(struct Client *cptr, struct Client *bcptr,
   char msgbuf[1024];
 
   va_start(vl, pattern);
-  vsprintf_irc(msgbuf, pattern, vl);
+  ircd_vsnprintf(0, msgbuf, sizeof(msgbuf), pattern, vl);
   va_end(vl);
 
   return exit_client(cptr, bcptr, sptr, msgbuf);
index 5b8cb84a9cbddb231efabbf12fa3834527881643..e7b3ddf79f62b0b55ff37eb190411a4d52f64742 100644 (file)
@@ -51,7 +51,6 @@
 #include "s_misc.h"
 #include "s_user.h"
 #include "send.h"
-#include "sprintf_irc.h"
 #include "struct.h"
 #include "sys.h"
 #include "userload.h"
index 3887a998589c95830fb8be54a87875f5315388fc..3af97a6d5e7fb30e34044e334a316e3d01fe5b86 100644 (file)
@@ -37,6 +37,7 @@
 #include "ircd_log.h"
 #include "ircd_policy.h"
 #include "ircd_reply.h"
+#include "ircd_snprintf.h"
 #include "ircd_string.h"
 #include "list.h"
 #include "match.h"
@@ -54,7 +55,6 @@
 #include "s_misc.h"
 #include "s_serv.h" /* max_client_count */
 #include "send.h"
-#include "sprintf_irc.h"
 #include "struct.h"
 #include "support.h"
 #include "supported.h"
@@ -567,7 +567,7 @@ int register_user(struct Client *cptr, struct Client *sptr,
     send_reply(sptr, RPL_YOURHOST, cli_name(&me), version);
     send_reply(sptr, RPL_CREATED, creation);
     send_reply(sptr, RPL_MYINFO, cli_name(&me), version);
-    sprintf_irc(featurebuf,FEATURES,FEATURESVALUES);
+    ircd_snprintf(0, featurebuf, sizeof(featurebuf), FEATURES, FEATURESVALUES);
     send_reply(sptr, RPL_ISUPPORT, featurebuf);
     m_lusers(sptr, sptr, 1, parv);
     update_load();
@@ -1448,9 +1448,10 @@ int is_silenced(struct Client *sptr, struct Client *acptr)
 
   if (!cli_user(acptr) || !(lp = cli_user(acptr)->silence) || !(user = cli_user(sptr)))
     return 0;
-  sprintf_irc(sender, "%s!%s@%s", cli_name(sptr), user->username, user->host);
-  sprintf_irc(senderip, "%s!%s@%s", cli_name(sptr), user->username,
-              ircd_ntoa((const char*) &(cli_ip(sptr))));
+  ircd_snprintf(0, sender, sizeof(sender), "%s!%s@%s", cli_name(sptr),
+               user->username, user->host);
+  ircd_snprintf(0, senderip, sizeof(senderip), "%s!%s@%s", cli_name(sptr),
+               user->username, ircd_ntoa((const char*) &(cli_ip(sptr))));
   for (; lp; lp = lp->next)
   {
     if ((!(lp->flags & CHFL_SILENCE_IPMASK) && !match(lp->value.cp, sender)) ||
index 6da453bd967f1a6f823f0c0bcaf34f5f1906eef0..6f7e1d3d8bfe4e02a86f0a8523b52dc00f2d64cb 100644 (file)
@@ -36,7 +36,6 @@
 #include "s_debug.h"
 #include "s_misc.h"
 #include "s_user.h"
-#include "sprintf_irc.h"
 #include "struct.h"
 #include "sys.h"
 
diff --git a/ircd/sprintf_irc.c b/ircd/sprintf_irc.c
deleted file mode 100644 (file)
index a9dc53b..0000000
+++ /dev/null
@@ -1,418 +0,0 @@
-/*
- * IRC - Internet Relay Chat, ircd/sprintf_irc.c
- *
- * (C) Copyright 1997
- *
- * Author:
- *
- * 1024/624ACAD5 1997/01/26 Carlo Wood, Run on IRC <carlo@runaway.xs4all.nl>
- * Key fingerprint = 32 EC A7 B6 AC DB 65 A6  F6 F6 55 DD 1C DC FF 61
- * Get key from pgp-public-keys server or
- * finger carlo@runaway.xs4all.nl for public key (dialin, try at 21-22h GMT).
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id$
- */
-#include "config.h"
-
-#include "sprintf_irc.h"
-#include "sys.h"
-#include <stdio.h>
-
-
-/* *INDENT-OFF* */
-
-const char atoi_tab[4000] = {
-    '0','0','0',0, '0','0','1',0, '0','0','2',0, '0','0','3',0, '0','0','4',0,
-    '0','0','5',0, '0','0','6',0, '0','0','7',0, '0','0','8',0, '0','0','9',0,
-    '0','1','0',0, '0','1','1',0, '0','1','2',0, '0','1','3',0, '0','1','4',0,
-    '0','1','5',0, '0','1','6',0, '0','1','7',0, '0','1','8',0, '0','1','9',0,
-    '0','2','0',0, '0','2','1',0, '0','2','2',0, '0','2','3',0, '0','2','4',0,
-    '0','2','5',0, '0','2','6',0, '0','2','7',0, '0','2','8',0, '0','2','9',0,
-    '0','3','0',0, '0','3','1',0, '0','3','2',0, '0','3','3',0, '0','3','4',0,
-    '0','3','5',0, '0','3','6',0, '0','3','7',0, '0','3','8',0, '0','3','9',0,
-    '0','4','0',0, '0','4','1',0, '0','4','2',0, '0','4','3',0, '0','4','4',0,
-    '0','4','5',0, '0','4','6',0, '0','4','7',0, '0','4','8',0, '0','4','9',0,
-    '0','5','0',0, '0','5','1',0, '0','5','2',0, '0','5','3',0, '0','5','4',0,
-    '0','5','5',0, '0','5','6',0, '0','5','7',0, '0','5','8',0, '0','5','9',0,
-    '0','6','0',0, '0','6','1',0, '0','6','2',0, '0','6','3',0, '0','6','4',0,
-    '0','6','5',0, '0','6','6',0, '0','6','7',0, '0','6','8',0, '0','6','9',0,
-    '0','7','0',0, '0','7','1',0, '0','7','2',0, '0','7','3',0, '0','7','4',0,
-    '0','7','5',0, '0','7','6',0, '0','7','7',0, '0','7','8',0, '0','7','9',0,
-    '0','8','0',0, '0','8','1',0, '0','8','2',0, '0','8','3',0, '0','8','4',0,
-    '0','8','5',0, '0','8','6',0, '0','8','7',0, '0','8','8',0, '0','8','9',0,
-    '0','9','0',0, '0','9','1',0, '0','9','2',0, '0','9','3',0, '0','9','4',0,
-    '0','9','5',0, '0','9','6',0, '0','9','7',0, '0','9','8',0, '0','9','9',0,
-    '1','0','0',0, '1','0','1',0, '1','0','2',0, '1','0','3',0, '1','0','4',0,
-    '1','0','5',0, '1','0','6',0, '1','0','7',0, '1','0','8',0, '1','0','9',0,
-    '1','1','0',0, '1','1','1',0, '1','1','2',0, '1','1','3',0, '1','1','4',0,
-    '1','1','5',0, '1','1','6',0, '1','1','7',0, '1','1','8',0, '1','1','9',0,
-    '1','2','0',0, '1','2','1',0, '1','2','2',0, '1','2','3',0, '1','2','4',0,
-    '1','2','5',0, '1','2','6',0, '1','2','7',0, '1','2','8',0, '1','2','9',0,
-    '1','3','0',0, '1','3','1',0, '1','3','2',0, '1','3','3',0, '1','3','4',0,
-    '1','3','5',0, '1','3','6',0, '1','3','7',0, '1','3','8',0, '1','3','9',0,
-    '1','4','0',0, '1','4','1',0, '1','4','2',0, '1','4','3',0, '1','4','4',0,
-    '1','4','5',0, '1','4','6',0, '1','4','7',0, '1','4','8',0, '1','4','9',0,
-    '1','5','0',0, '1','5','1',0, '1','5','2',0, '1','5','3',0, '1','5','4',0,
-    '1','5','5',0, '1','5','6',0, '1','5','7',0, '1','5','8',0, '1','5','9',0,
-    '1','6','0',0, '1','6','1',0, '1','6','2',0, '1','6','3',0, '1','6','4',0,
-    '1','6','5',0, '1','6','6',0, '1','6','7',0, '1','6','8',0, '1','6','9',0,
-    '1','7','0',0, '1','7','1',0, '1','7','2',0, '1','7','3',0, '1','7','4',0,
-    '1','7','5',0, '1','7','6',0, '1','7','7',0, '1','7','8',0, '1','7','9',0,
-    '1','8','0',0, '1','8','1',0, '1','8','2',0, '1','8','3',0, '1','8','4',0,
-    '1','8','5',0, '1','8','6',0, '1','8','7',0, '1','8','8',0, '1','8','9',0,
-    '1','9','0',0, '1','9','1',0, '1','9','2',0, '1','9','3',0, '1','9','4',0,
-    '1','9','5',0, '1','9','6',0, '1','9','7',0, '1','9','8',0, '1','9','9',0,
-    '2','0','0',0, '2','0','1',0, '2','0','2',0, '2','0','3',0, '2','0','4',0,
-    '2','0','5',0, '2','0','6',0, '2','0','7',0, '2','0','8',0, '2','0','9',0,
-    '2','1','0',0, '2','1','1',0, '2','1','2',0, '2','1','3',0, '2','1','4',0,
-    '2','1','5',0, '2','1','6',0, '2','1','7',0, '2','1','8',0, '2','1','9',0,
-    '2','2','0',0, '2','2','1',0, '2','2','2',0, '2','2','3',0, '2','2','4',0,
-    '2','2','5',0, '2','2','6',0, '2','2','7',0, '2','2','8',0, '2','2','9',0,
-    '2','3','0',0, '2','3','1',0, '2','3','2',0, '2','3','3',0, '2','3','4',0,
-    '2','3','5',0, '2','3','6',0, '2','3','7',0, '2','3','8',0, '2','3','9',0,
-    '2','4','0',0, '2','4','1',0, '2','4','2',0, '2','4','3',0, '2','4','4',0,
-    '2','4','5',0, '2','4','6',0, '2','4','7',0, '2','4','8',0, '2','4','9',0,
-    '2','5','0',0, '2','5','1',0, '2','5','2',0, '2','5','3',0, '2','5','4',0,
-    '2','5','5',0, '2','5','6',0, '2','5','7',0, '2','5','8',0, '2','5','9',0,
-    '2','6','0',0, '2','6','1',0, '2','6','2',0, '2','6','3',0, '2','6','4',0,
-    '2','6','5',0, '2','6','6',0, '2','6','7',0, '2','6','8',0, '2','6','9',0,
-    '2','7','0',0, '2','7','1',0, '2','7','2',0, '2','7','3',0, '2','7','4',0,
-    '2','7','5',0, '2','7','6',0, '2','7','7',0, '2','7','8',0, '2','7','9',0,
-    '2','8','0',0, '2','8','1',0, '2','8','2',0, '2','8','3',0, '2','8','4',0,
-    '2','8','5',0, '2','8','6',0, '2','8','7',0, '2','8','8',0, '2','8','9',0,
-    '2','9','0',0, '2','9','1',0, '2','9','2',0, '2','9','3',0, '2','9','4',0,
-    '2','9','5',0, '2','9','6',0, '2','9','7',0, '2','9','8',0, '2','9','9',0,
-    '3','0','0',0, '3','0','1',0, '3','0','2',0, '3','0','3',0, '3','0','4',0,
-    '3','0','5',0, '3','0','6',0, '3','0','7',0, '3','0','8',0, '3','0','9',0,
-    '3','1','0',0, '3','1','1',0, '3','1','2',0, '3','1','3',0, '3','1','4',0,
-    '3','1','5',0, '3','1','6',0, '3','1','7',0, '3','1','8',0, '3','1','9',0,
-    '3','2','0',0, '3','2','1',0, '3','2','2',0, '3','2','3',0, '3','2','4',0,
-    '3','2','5',0, '3','2','6',0, '3','2','7',0, '3','2','8',0, '3','2','9',0,
-    '3','3','0',0, '3','3','1',0, '3','3','2',0, '3','3','3',0, '3','3','4',0,
-    '3','3','5',0, '3','3','6',0, '3','3','7',0, '3','3','8',0, '3','3','9',0,
-    '3','4','0',0, '3','4','1',0, '3','4','2',0, '3','4','3',0, '3','4','4',0,
-    '3','4','5',0, '3','4','6',0, '3','4','7',0, '3','4','8',0, '3','4','9',0,
-    '3','5','0',0, '3','5','1',0, '3','5','2',0, '3','5','3',0, '3','5','4',0,
-    '3','5','5',0, '3','5','6',0, '3','5','7',0, '3','5','8',0, '3','5','9',0,
-    '3','6','0',0, '3','6','1',0, '3','6','2',0, '3','6','3',0, '3','6','4',0,
-    '3','6','5',0, '3','6','6',0, '3','6','7',0, '3','6','8',0, '3','6','9',0,
-    '3','7','0',0, '3','7','1',0, '3','7','2',0, '3','7','3',0, '3','7','4',0,
-    '3','7','5',0, '3','7','6',0, '3','7','7',0, '3','7','8',0, '3','7','9',0,
-    '3','8','0',0, '3','8','1',0, '3','8','2',0, '3','8','3',0, '3','8','4',0,
-    '3','8','5',0, '3','8','6',0, '3','8','7',0, '3','8','8',0, '3','8','9',0,
-    '3','9','0',0, '3','9','1',0, '3','9','2',0, '3','9','3',0, '3','9','4',0,
-    '3','9','5',0, '3','9','6',0, '3','9','7',0, '3','9','8',0, '3','9','9',0,
-    '4','0','0',0, '4','0','1',0, '4','0','2',0, '4','0','3',0, '4','0','4',0,
-    '4','0','5',0, '4','0','6',0, '4','0','7',0, '4','0','8',0, '4','0','9',0,
-    '4','1','0',0, '4','1','1',0, '4','1','2',0, '4','1','3',0, '4','1','4',0,
-    '4','1','5',0, '4','1','6',0, '4','1','7',0, '4','1','8',0, '4','1','9',0,
-    '4','2','0',0, '4','2','1',0, '4','2','2',0, '4','2','3',0, '4','2','4',0,
-    '4','2','5',0, '4','2','6',0, '4','2','7',0, '4','2','8',0, '4','2','9',0,
-    '4','3','0',0, '4','3','1',0, '4','3','2',0, '4','3','3',0, '4','3','4',0,
-    '4','3','5',0, '4','3','6',0, '4','3','7',0, '4','3','8',0, '4','3','9',0,
-    '4','4','0',0, '4','4','1',0, '4','4','2',0, '4','4','3',0, '4','4','4',0,
-    '4','4','5',0, '4','4','6',0, '4','4','7',0, '4','4','8',0, '4','4','9',0,
-    '4','5','0',0, '4','5','1',0, '4','5','2',0, '4','5','3',0, '4','5','4',0,
-    '4','5','5',0, '4','5','6',0, '4','5','7',0, '4','5','8',0, '4','5','9',0,
-    '4','6','0',0, '4','6','1',0, '4','6','2',0, '4','6','3',0, '4','6','4',0,
-    '4','6','5',0, '4','6','6',0, '4','6','7',0, '4','6','8',0, '4','6','9',0,
-    '4','7','0',0, '4','7','1',0, '4','7','2',0, '4','7','3',0, '4','7','4',0,
-    '4','7','5',0, '4','7','6',0, '4','7','7',0, '4','7','8',0, '4','7','9',0,
-    '4','8','0',0, '4','8','1',0, '4','8','2',0, '4','8','3',0, '4','8','4',0,
-    '4','8','5',0, '4','8','6',0, '4','8','7',0, '4','8','8',0, '4','8','9',0,
-    '4','9','0',0, '4','9','1',0, '4','9','2',0, '4','9','3',0, '4','9','4',0,
-    '4','9','5',0, '4','9','6',0, '4','9','7',0, '4','9','8',0, '4','9','9',0,
-    '5','0','0',0, '5','0','1',0, '5','0','2',0, '5','0','3',0, '5','0','4',0,
-    '5','0','5',0, '5','0','6',0, '5','0','7',0, '5','0','8',0, '5','0','9',0,
-    '5','1','0',0, '5','1','1',0, '5','1','2',0, '5','1','3',0, '5','1','4',0,
-    '5','1','5',0, '5','1','6',0, '5','1','7',0, '5','1','8',0, '5','1','9',0,
-    '5','2','0',0, '5','2','1',0, '5','2','2',0, '5','2','3',0, '5','2','4',0,
-    '5','2','5',0, '5','2','6',0, '5','2','7',0, '5','2','8',0, '5','2','9',0,
-    '5','3','0',0, '5','3','1',0, '5','3','2',0, '5','3','3',0, '5','3','4',0,
-    '5','3','5',0, '5','3','6',0, '5','3','7',0, '5','3','8',0, '5','3','9',0,
-    '5','4','0',0, '5','4','1',0, '5','4','2',0, '5','4','3',0, '5','4','4',0,
-    '5','4','5',0, '5','4','6',0, '5','4','7',0, '5','4','8',0, '5','4','9',0,
-    '5','5','0',0, '5','5','1',0, '5','5','2',0, '5','5','3',0, '5','5','4',0,
-    '5','5','5',0, '5','5','6',0, '5','5','7',0, '5','5','8',0, '5','5','9',0,
-    '5','6','0',0, '5','6','1',0, '5','6','2',0, '5','6','3',0, '5','6','4',0,
-    '5','6','5',0, '5','6','6',0, '5','6','7',0, '5','6','8',0, '5','6','9',0,
-    '5','7','0',0, '5','7','1',0, '5','7','2',0, '5','7','3',0, '5','7','4',0,
-    '5','7','5',0, '5','7','6',0, '5','7','7',0, '5','7','8',0, '5','7','9',0,
-    '5','8','0',0, '5','8','1',0, '5','8','2',0, '5','8','3',0, '5','8','4',0,
-    '5','8','5',0, '5','8','6',0, '5','8','7',0, '5','8','8',0, '5','8','9',0,
-    '5','9','0',0, '5','9','1',0, '5','9','2',0, '5','9','3',0, '5','9','4',0,
-    '5','9','5',0, '5','9','6',0, '5','9','7',0, '5','9','8',0, '5','9','9',0,
-    '6','0','0',0, '6','0','1',0, '6','0','2',0, '6','0','3',0, '6','0','4',0,
-    '6','0','5',0, '6','0','6',0, '6','0','7',0, '6','0','8',0, '6','0','9',0,
-    '6','1','0',0, '6','1','1',0, '6','1','2',0, '6','1','3',0, '6','1','4',0,
-    '6','1','5',0, '6','1','6',0, '6','1','7',0, '6','1','8',0, '6','1','9',0,
-    '6','2','0',0, '6','2','1',0, '6','2','2',0, '6','2','3',0, '6','2','4',0,
-    '6','2','5',0, '6','2','6',0, '6','2','7',0, '6','2','8',0, '6','2','9',0,
-    '6','3','0',0, '6','3','1',0, '6','3','2',0, '6','3','3',0, '6','3','4',0,
-    '6','3','5',0, '6','3','6',0, '6','3','7',0, '6','3','8',0, '6','3','9',0,
-    '6','4','0',0, '6','4','1',0, '6','4','2',0, '6','4','3',0, '6','4','4',0,
-    '6','4','5',0, '6','4','6',0, '6','4','7',0, '6','4','8',0, '6','4','9',0,
-    '6','5','0',0, '6','5','1',0, '6','5','2',0, '6','5','3',0, '6','5','4',0,
-    '6','5','5',0, '6','5','6',0, '6','5','7',0, '6','5','8',0, '6','5','9',0,
-    '6','6','0',0, '6','6','1',0, '6','6','2',0, '6','6','3',0, '6','6','4',0,
-    '6','6','5',0, '6','6','6',0, '6','6','7',0, '6','6','8',0, '6','6','9',0,
-    '6','7','0',0, '6','7','1',0, '6','7','2',0, '6','7','3',0, '6','7','4',0,
-    '6','7','5',0, '6','7','6',0, '6','7','7',0, '6','7','8',0, '6','7','9',0,
-    '6','8','0',0, '6','8','1',0, '6','8','2',0, '6','8','3',0, '6','8','4',0,
-    '6','8','5',0, '6','8','6',0, '6','8','7',0, '6','8','8',0, '6','8','9',0,
-    '6','9','0',0, '6','9','1',0, '6','9','2',0, '6','9','3',0, '6','9','4',0,
-    '6','9','5',0, '6','9','6',0, '6','9','7',0, '6','9','8',0, '6','9','9',0,
-    '7','0','0',0, '7','0','1',0, '7','0','2',0, '7','0','3',0, '7','0','4',0,
-    '7','0','5',0, '7','0','6',0, '7','0','7',0, '7','0','8',0, '7','0','9',0,
-    '7','1','0',0, '7','1','1',0, '7','1','2',0, '7','1','3',0, '7','1','4',0,
-    '7','1','5',0, '7','1','6',0, '7','1','7',0, '7','1','8',0, '7','1','9',0,
-    '7','2','0',0, '7','2','1',0, '7','2','2',0, '7','2','3',0, '7','2','4',0,
-    '7','2','5',0, '7','2','6',0, '7','2','7',0, '7','2','8',0, '7','2','9',0,
-    '7','3','0',0, '7','3','1',0, '7','3','2',0, '7','3','3',0, '7','3','4',0,
-    '7','3','5',0, '7','3','6',0, '7','3','7',0, '7','3','8',0, '7','3','9',0,
-    '7','4','0',0, '7','4','1',0, '7','4','2',0, '7','4','3',0, '7','4','4',0,
-    '7','4','5',0, '7','4','6',0, '7','4','7',0, '7','4','8',0, '7','4','9',0,
-    '7','5','0',0, '7','5','1',0, '7','5','2',0, '7','5','3',0, '7','5','4',0,
-    '7','5','5',0, '7','5','6',0, '7','5','7',0, '7','5','8',0, '7','5','9',0,
-    '7','6','0',0, '7','6','1',0, '7','6','2',0, '7','6','3',0, '7','6','4',0,
-    '7','6','5',0, '7','6','6',0, '7','6','7',0, '7','6','8',0, '7','6','9',0,
-    '7','7','0',0, '7','7','1',0, '7','7','2',0, '7','7','3',0, '7','7','4',0,
-    '7','7','5',0, '7','7','6',0, '7','7','7',0, '7','7','8',0, '7','7','9',0,
-    '7','8','0',0, '7','8','1',0, '7','8','2',0, '7','8','3',0, '7','8','4',0,
-    '7','8','5',0, '7','8','6',0, '7','8','7',0, '7','8','8',0, '7','8','9',0,
-    '7','9','0',0, '7','9','1',0, '7','9','2',0, '7','9','3',0, '7','9','4',0,
-    '7','9','5',0, '7','9','6',0, '7','9','7',0, '7','9','8',0, '7','9','9',0,
-    '8','0','0',0, '8','0','1',0, '8','0','2',0, '8','0','3',0, '8','0','4',0,
-    '8','0','5',0, '8','0','6',0, '8','0','7',0, '8','0','8',0, '8','0','9',0,
-    '8','1','0',0, '8','1','1',0, '8','1','2',0, '8','1','3',0, '8','1','4',0,
-    '8','1','5',0, '8','1','6',0, '8','1','7',0, '8','1','8',0, '8','1','9',0,
-    '8','2','0',0, '8','2','1',0, '8','2','2',0, '8','2','3',0, '8','2','4',0,
-    '8','2','5',0, '8','2','6',0, '8','2','7',0, '8','2','8',0, '8','2','9',0,
-    '8','3','0',0, '8','3','1',0, '8','3','2',0, '8','3','3',0, '8','3','4',0,
-    '8','3','5',0, '8','3','6',0, '8','3','7',0, '8','3','8',0, '8','3','9',0,
-    '8','4','0',0, '8','4','1',0, '8','4','2',0, '8','4','3',0, '8','4','4',0,
-    '8','4','5',0, '8','4','6',0, '8','4','7',0, '8','4','8',0, '8','4','9',0,
-    '8','5','0',0, '8','5','1',0, '8','5','2',0, '8','5','3',0, '8','5','4',0,
-    '8','5','5',0, '8','5','6',0, '8','5','7',0, '8','5','8',0, '8','5','9',0,
-    '8','6','0',0, '8','6','1',0, '8','6','2',0, '8','6','3',0, '8','6','4',0,
-    '8','6','5',0, '8','6','6',0, '8','6','7',0, '8','6','8',0, '8','6','9',0,
-    '8','7','0',0, '8','7','1',0, '8','7','2',0, '8','7','3',0, '8','7','4',0,
-    '8','7','5',0, '8','7','6',0, '8','7','7',0, '8','7','8',0, '8','7','9',0,
-    '8','8','0',0, '8','8','1',0, '8','8','2',0, '8','8','3',0, '8','8','4',0,
-    '8','8','5',0, '8','8','6',0, '8','8','7',0, '8','8','8',0, '8','8','9',0,
-    '8','9','0',0, '8','9','1',0, '8','9','2',0, '8','9','3',0, '8','9','4',0,
-    '8','9','5',0, '8','9','6',0, '8','9','7',0, '8','9','8',0, '8','9','9',0,
-    '9','0','0',0, '9','0','1',0, '9','0','2',0, '9','0','3',0, '9','0','4',0,
-    '9','0','5',0, '9','0','6',0, '9','0','7',0, '9','0','8',0, '9','0','9',0,
-    '9','1','0',0, '9','1','1',0, '9','1','2',0, '9','1','3',0, '9','1','4',0,
-    '9','1','5',0, '9','1','6',0, '9','1','7',0, '9','1','8',0, '9','1','9',0,
-    '9','2','0',0, '9','2','1',0, '9','2','2',0, '9','2','3',0, '9','2','4',0,
-    '9','2','5',0, '9','2','6',0, '9','2','7',0, '9','2','8',0, '9','2','9',0,
-    '9','3','0',0, '9','3','1',0, '9','3','2',0, '9','3','3',0, '9','3','4',0,
-    '9','3','5',0, '9','3','6',0, '9','3','7',0, '9','3','8',0, '9','3','9',0,
-    '9','4','0',0, '9','4','1',0, '9','4','2',0, '9','4','3',0, '9','4','4',0,
-    '9','4','5',0, '9','4','6',0, '9','4','7',0, '9','4','8',0, '9','4','9',0,
-    '9','5','0',0, '9','5','1',0, '9','5','2',0, '9','5','3',0, '9','5','4',0,
-    '9','5','5',0, '9','5','6',0, '9','5','7',0, '9','5','8',0, '9','5','9',0,
-    '9','6','0',0, '9','6','1',0, '9','6','2',0, '9','6','3',0, '9','6','4',0,
-    '9','6','5',0, '9','6','6',0, '9','6','7',0, '9','6','8',0, '9','6','9',0,
-    '9','7','0',0, '9','7','1',0, '9','7','2',0, '9','7','3',0, '9','7','4',0,
-    '9','7','5',0, '9','7','6',0, '9','7','7',0, '9','7','8',0, '9','7','9',0,
-    '9','8','0',0, '9','8','1',0, '9','8','2',0, '9','8','3',0, '9','8','4',0,
-    '9','8','5',0, '9','8','6',0, '9','8','7',0, '9','8','8',0, '9','8','9',0,
-    '9','9','0',0, '9','9','1',0, '9','9','2',0, '9','9','3',0, '9','9','4',0,
-    '9','9','5',0, '9','9','6',0, '9','9','7',0, '9','9','8',0, '9','9','9',0 };
-
-/* *INDENT-ON* */
-
-static char scratch_buffer[32];
-
-/*
- * sprintf_irc
- *
- * sprintf_irc is optimized for the formats: %c, %s, %lu, %d and %u.
- * Where %lu actually equals %l09u (for printing time_t timestamps).
- *
- * sprintf_irc is NOT optimized for any other format and resorts to using
- * the normal sprintf when it encounters a format it doesn't understand
- * (including padding, width, precision etc).
- *
- * The following benchmark was measured on a PPro200 with linux 2.0.30,
- * libc 5.4.28, compiled with gcc-2.7.2.1 with -O3.
- *
- * Format                       sprintf         sprintf_irc     Speed up factor
- *
- * "12345678901234567890"       3.385 us        0.859 us        3.94
- * "%s", buffer (20 chars)      3.780 us        0.547 us        6.91
- * "%c%c%c", c1, c2, c3         3.640 us        0.376 us        9.68
- * "%lu", (time_t)t             5.851 us        0.842 us        6.95
- *
- * Less important:
- * "%d", 31337                  4.487 us        0.852 us        5.27
- * "%u.%u.%u.%u",               9.069 us        2.431 us        3.73
- *
- * Not used:
- * "%03d", 401                  4.348 us
- * "%N"                                         0.216 us        20.13
- *
- * --Run
- */
-char *vsprintf_irc(char *str, const char *format, va_list vl)
-{
-  char c;
-
-  while ((c = *format++))
-  {
-    if (c == '%')
-    {
-      c = *format++;            /* May never be '\0' ! */
-      if (c == 'c')
-      {
-        *str++ = (char)va_arg(vl, int);
-        continue;
-      }
-      if (c == 's')
-      {
-        const char *p1 = va_arg(vl, const char *);
-        if ((*str = *p1))
-          while ((*++str = *++p1));
-        continue;
-      }
-      if (c == 'l' && *format == 'u')   /* Prints time_t value in interval
-                                           [ 100000000 , 4294967295 ]
-                                           Actually prints like "%09lu" */
-      {
-        unsigned long v1;
-        unsigned long v2;
-        const char *ap;
-        ++format;
-        v1 = va_arg(vl, unsigned long);
-        if (v1 > 999999999L)
-        {
-          v2 = v1 / 1000000000;
-          v1 -= v2 * 1000000000;
-          *str++ = '0' + v2;
-        }
-        v2 = v1 / 1000000;
-        v1 -= v2 * 1000000;
-        ap = atoi_tab + (v2 << 2);
-        *str++ = *ap++;
-        *str++ = *ap++;
-        *str++ = *ap;
-        v2 = v1 / 1000;
-        v1 -= v2 * 1000;
-        ap = atoi_tab + (v2 << 2);
-        *str++ = *ap++;
-        *str++ = *ap++;
-        *str++ = *ap;
-        ap = atoi_tab + (v1 << 2);
-        *str++ = *ap++;
-        *str++ = *ap++;
-        *str++ = *ap;
-        continue;
-      }
-#if 0                           /* Not used */
-      if (c == 'N')             /* Prints "%03u" a numeric value in the
-                                   range [ 0, 999 ], padded with zero's */
-      {
-        unsigned int v1;
-        const char *ap;
-        v1 = va_arg(vl, unsigned int);
-        ap = atoi_tab + (v1 << 2);
-        *str++ = *ap++;
-        *str++ = *ap++;
-        *str++ = *ap;
-        continue;
-      }
-#endif
-      if (c == 'd')
-      {
-        unsigned int v1, v2;
-        const char *ap;
-        char *s = &scratch_buffer[sizeof(scratch_buffer) - 2];
-        v1 = va_arg(vl, int);
-        if ((int)v1 <= 0)
-        {
-          if (v1 == 0)
-          {
-            *str++ = '0';
-            continue;
-          }
-          *str++ = '-';
-          v1 = -v1;
-        }
-        do
-        {
-          v2 = v1 / 1000;
-          ap = atoi_tab + 2 + ((v1 - 1000 * v2) << 2);
-          *s-- = *ap--;
-          *s-- = *ap--;
-          *s-- = *ap;
-        }
-        while ((v1 = v2) > 0);
-        while ('0' == *++s);
-        *str = *s;
-        while ((*++str = *++s));
-        continue;
-      }
-      if (c == 'u')
-      {
-        unsigned int v1, v2;
-        const char *ap;
-        char *s = &scratch_buffer[sizeof(scratch_buffer) - 2];
-        v1 = va_arg(vl, unsigned int);
-        if (v1 == 0)
-        {
-          *str++ = '0';
-          continue;
-        }
-        do
-        {
-          v2 = v1 / 1000;
-          ap = atoi_tab + 2 + ((v1 - 1000 * v2) << 2);
-          *s-- = *ap--;
-          *s-- = *ap--;
-          *s-- = *ap;
-        }
-        while ((v1 = v2) > 0);
-        while ('0' == *++s);
-        *str = *s;
-        while ((*++str = *++s));
-        continue;
-      }
-      if (c != '%')
-      {
-        format -= 2;
-        str += vsprintf(str, format, vl);
-        break;
-      }
-    }
-    *str++ = c;
-  }
-  *str = 0;
-  return str;
-}
-
-char *sprintf_irc(char *str, const char *format, ...)
-{
-  va_list vl;
-  char *ret;
-  va_start(vl, format);
-  ret = vsprintf_irc(str, format, vl);
-  va_end(vl);
-  return ret;
-}
index d05395fead12b1eb6b5354d115d3916eeb5896b9..dae19e05b58ff5d8446aaee77158e85e6bd93c65 100644 (file)
@@ -28,7 +28,6 @@
 #include "s_bsd.h"
 #include "s_debug.h"
 #include "send.h"
-#include "sprintf_irc.h"
 #include "sys.h"
 
 #include <signal.h>   /* kill */
index 39a9bc7507a0b1a1e0e1a5b81612db39ab55d83b..25f354519fcdb43b933cbba95a09df2a4bd52598 100644 (file)
@@ -45,7 +45,6 @@
 #include "s_misc.h"
 #include "s_user.h"
 #include "send.h"
-#include "sprintf_irc.h"
 #include "struct.h"
 #include "support.h"
 #include "sys.h"
@@ -201,7 +200,8 @@ void do_who(struct Client* sptr, struct Client* acptr, struct Channel* repchan,
     strcat(p1, sptr == acptr ? "0" : "3");
     p1++;
 #else
-    p1 = sprintf_irc(p1, "%d", cli_hopcount(acptr));
+    /* three digit hopcount maximum */
+    p1 += ircd_snprintf(0, p1, 3, "%d", cli_hopcount(acptr));
 #endif
   }
 
@@ -209,7 +209,8 @@ void do_who(struct Client* sptr, struct Client* acptr, struct Channel* repchan,
   {
     *p1++ = ' ';
     if (MyUser(acptr)) {
-           p1 = sprintf_irc(p1, "%d", CurrentTime - cli_user(acptr)->last);
+           p1 += ircd_snprintf(0, p1, 11, "%d",
+                               CurrentTime - cli_user(acptr)->last);
     }    
     else {
            *p1++ = '0';