From 2a5e6e4315981d554da47c175668aadc6640f534 Mon Sep 17 00:00:00 2001 From: Remco Rijnders Date: Sun, 5 Jul 2009 07:02:48 +0200 Subject: [PATCH 1/1] Initial import of 'Serene5.28' into git repository. --- CHANGES | 13 + Config | 1368 +++++++++++++ INSTALL | 169 ++ LICENSE | 249 +++ Makefile.dist | 176 ++ bsdinstall | 83 + doc/CHANGES.old | 102 + doc/INSTALL | 962 +++++++++ doc/conf.doc | 773 ++++++++ doc/example.conf | 322 +++ doc/opermotd.doc | 7 + include/channel.h | 42 + include/cio.h | 27 + include/ciofunc.h | 20 + include/class.h | 69 + include/common.h | 177 ++ include/config.h | 600 ++++++ include/dbuf.h | 163 ++ include/h.h | 326 ++++ include/hash.h | 46 + include/inet.h | 49 + include/msg.h | 353 ++++ include/nameser.h | 248 +++ include/numeric.h | 292 +++ include/patchlevel.h | 127 ++ include/res.h | 67 + include/resolv.h | 78 + include/sock.h | 44 + include/struct.h | 995 ++++++++++ include/sys.h | 253 +++ include/userload.h | 52 + include/whowas.h | 97 + src/Makefile | 238 +++ src/bsd.c | 179 ++ src/buildm4 | 88 + src/channel.c | 4405 ++++++++++++++++++++++++++++++++++++++++++ src/chkconf.c | 629 ++++++ src/class.c | 223 +++ src/crypt/Makefile | 36 + src/crypt/README | 62 + src/crypt/crypter | 53 + src/crypt/mkpasswd.c | 40 + src/dbuf.c | 334 ++++ src/hash.c | 1190 ++++++++++++ src/ircd.c | 967 ++++++++++ src/list.c | 590 ++++++ src/list2.c | 464 +++++ src/masking.c | 179 ++ src/match.c | 349 ++++ src/md5.c | 162 ++ src/packet.c | 205 ++ src/parse.c | 556 ++++++ src/res.c | 1334 +++++++++++++ src/res_comp.c | 328 ++++ src/res_init.c | 204 ++ src/res_mkquery.c | 188 ++ src/res_skipname.c | 32 + src/s_bsd.c | 1950 +++++++++++++++++++ src/s_conf.c | 2409 +++++++++++++++++++++++ src/s_debug.c | 421 ++++ src/s_err.c | 785 ++++++++ src/s_misc.c | 938 +++++++++ src/s_numeric.c | 122 ++ src/s_ping.c | 487 +++++ src/s_serv.c | 3235 +++++++++++++++++++++++++++++++ src/s_user.c | 3818 ++++++++++++++++++++++++++++++++++++ src/s_zip.c | 240 +++ src/send.c | 1030 ++++++++++ src/strtoul.c | 109 ++ src/support.c | 440 +++++ src/userload.c | 375 ++++ src/version.c.SH | 82 + src/whowas.c | 276 +++ 73 files changed, 38101 insertions(+) create mode 100644 CHANGES create mode 100755 Config create mode 100644 INSTALL create mode 100644 LICENSE create mode 100755 Makefile.dist create mode 100755 bsdinstall create mode 100644 doc/CHANGES.old create mode 100644 doc/INSTALL create mode 100644 doc/conf.doc create mode 100644 doc/example.conf create mode 100644 doc/opermotd.doc create mode 100644 include/channel.h create mode 100644 include/cio.h create mode 100644 include/ciofunc.h create mode 100644 include/class.h create mode 100644 include/common.h create mode 100644 include/config.h create mode 100644 include/dbuf.h create mode 100644 include/h.h create mode 100644 include/hash.h create mode 100644 include/inet.h create mode 100644 include/msg.h create mode 100644 include/nameser.h create mode 100644 include/numeric.h create mode 100644 include/patchlevel.h create mode 100644 include/res.h create mode 100644 include/resolv.h create mode 100644 include/sock.h create mode 100644 include/struct.h create mode 100644 include/sys.h create mode 100644 include/userload.h create mode 100644 include/whowas.h create mode 100644 src/Makefile create mode 100644 src/bsd.c create mode 100755 src/buildm4 create mode 100644 src/channel.c create mode 100644 src/chkconf.c create mode 100644 src/class.c create mode 100755 src/crypt/Makefile create mode 100644 src/crypt/README create mode 100755 src/crypt/crypter create mode 100755 src/crypt/mkpasswd.c create mode 100644 src/dbuf.c create mode 100644 src/hash.c create mode 100644 src/ircd.c create mode 100644 src/list.c create mode 100644 src/list2.c create mode 100644 src/masking.c create mode 100644 src/match.c create mode 100644 src/md5.c create mode 100644 src/packet.c create mode 100644 src/parse.c create mode 100644 src/res.c create mode 100644 src/res_comp.c create mode 100644 src/res_init.c create mode 100644 src/res_mkquery.c create mode 100644 src/res_skipname.c create mode 100644 src/s_bsd.c create mode 100644 src/s_conf.c create mode 100644 src/s_debug.c create mode 100644 src/s_err.c create mode 100644 src/s_misc.c create mode 100644 src/s_numeric.c create mode 100644 src/s_ping.c create mode 100644 src/s_serv.c create mode 100644 src/s_user.c create mode 100644 src/s_zip.c create mode 100644 src/send.c create mode 100644 src/strtoul.c create mode 100644 src/support.c create mode 100644 src/userload.c create mode 100755 src/version.c.SH create mode 100644 src/whowas.c diff --git a/CHANGES b/CHANGES new file mode 100644 index 0000000..55b3c7e --- /dev/null +++ b/CHANGES @@ -0,0 +1,13 @@ +######################################################################### +# Changes in Serene5.27 (see doc/CHANGES.old for older changes) # +######################################################################### +o: Changed StarChat references to Serene + +######################################################################### +# Changes in Serene5.28 (see doc/CHANGES.old for older changes) # +######################################################################### +o: /whowas now shows the actual server to normal users. +o: /whois shows the connection arguments the client used to connect to + IRC operators. +o: Length for QUIT messages increased to 180 characters (up from 120). +o: Forbid DCC SEND and CHAT functions for unregistered nicks. diff --git a/Config b/Config new file mode 100755 index 0000000..45d1f51 --- /dev/null +++ b/Config @@ -0,0 +1,1368 @@ +#!/bin/sh + +# Copyright 1996,1997,1998 Michael Graff +# You may distribute this file freely providing this notice +# remains intact. +# +# Modified August 1999 by GZ +# InnerFIRE + +IRCD_VERSION="Serene5.28" +CONF_DATE=`date` +LAST_VERSION="Serene5.27" +# +trap "" 13 14 15 +MV=mv +RM=rm +SETUP=include/setup.h +OPTIONS_H=include/options.h +OPTIONS=Options +MAKEINST=.install +AUTO_CONFIG="" +# +GLIBCCHECK=undef +STDLIBH=undef +STDDEFH=undef +SYSSYSLOGH=undef +PARAMH=undef +UNISTDH=undef +STRINGH=undef +STRINGSH=undef +STRCASECMP=undef +RUSAGEH=undef +HINDEX=undef +STRERROR=undef +STRTOKEN=define +STRTOK=define +INETADDR=define +INETNTOA=define +INETNETOF=define +GETTIMEOFDAY=undef +LRAND48=undef +STRTOUL=undef +LOCALD=define +NEEDSKIPNAME="" +CCPATH='' +HAVE_BZERO=undef +GETRUSAGE_2=undef +TIMES_2=undef +POSIX_NBLOCK=undef +BSD_NBLOCK=undef +POSIX_SIGNAL=undef +BSD_SIGNAL=undef +TMP=/tmp/.Configtmp$$.c +EXEC=/tmp/.Configtmp$$ +PLATE=/tmp/.ConPlate$$ +c='' +n='' +# +# Some reasonable defaults +# +DEFOPT="-O" +DEFCFLAGS="$DEFOPT" +DEFLIBS="none" +OSNAME="Could not determine Operating System" +# +CONTACT_URL="http://www.serenity-irc.net/connect.html" +CONTACT_EMAIL="" +SERVICES_NAME="Services.Serenity-IRC.Net" +KLINE_ADDRESS="" +ZIP_LINKS="1" +DPATH="$HOME/ircd" +SPATH="$HOME/ircd/ircd" +HUB="" +CRYPT_OPER_PASSWORD="1" +CRYPT_ILINE_PASSWORD=$CRYPT_OPER_PASSWORD +MAXCONNECTIONS="1024" + +# +# load $OPTIONS if present +# +if [ -r "$OPTIONS" ] ; then + . $OPTIONS +fi + +# +2>/dev/null +if [ "`eval echo -n 'a'`" = "-n a" ] ; then + c='\c' +else + n='-n' +fi + +case $# in + 1 ) + case "z${1}" in + z--help | z-h ) + echo " -n Use the Options file from a previous setup" + echo " " + echo " --help display this help and exit" + echo " --version output version information and exit" + echo " " + exit 0 ;; + z--version ) + echo "Config $IRCD_VERSION"; exit 0 ;; + z-n ) + if [ "$LAST_VERSION" != "$IRCD_VERSION" ] ; then + echo "You specified the no-questions-asked configure, but the version" + echo "of Config which created your Options file was LAST_VERSION," + echo "And the current version is $IRCD_VERSION." + echo " " + echo "Please read the prompts carefully since some of them may have" + echo "changed." + echo " " + else + AUTO_CONFIG=Yes + fi ;; + * ) ;; + esac + ;; + * ) ;; +esac + +if [ "$LAST_VERSION" != "$IRCD_VERSION" ] ; then + if [ -r CHANGES ] ; then + more CHANGES + echo $n "[Enter to begin]" + read cc + fi +fi + +clear + +# +# Take a wild stab at the OS, and take reasonable defaults for each +# +# Include zlib as default for server compression, +# if they don't want it, they have a backspace key. +# patched: 5/30/00 Paul de Regt [Ax0n] (deregt@accessnw.net) + +OS=`uname -a` +case "$OS" in + *NetBSD*) + DEFCFLAGS="$DEFOPT" + DEFLIBS="-lcrypt -lz" + OSNAME="NetBSD" + ;; + *FreeBSD*) + DEFCFLAGS="$DEFOPT" + DEFLIBS="-lcrypt -lz" + OSNAME="FreeBSD" + ;; + *SCO_SV*) + DEFCFLAGS="$DEFOPT -DSCOUNIX" + DEFLIBS="-lsocket -lz" + OSNAME="SCO Openserver" + NEEDSKIPNAME="Yep" + ;; + *OSF1*alpha*) + DEFCFLAGS="$DEFOPT" + DEFLIBS="-lz" + OSNAME="OSF/1 or Digital Unix" + ;; + *SunOS*4.*) + DEFCFLAGS="$DEFOPT" + DEFLIBS="-lz" + OSNAME="SunOS 4.x" + LOCALD=undef + ;; + *SunOS*5.*) + DEFCFLAGS="$DEFOPT -DSOL20" + DEFLIBS="-lsocket -lnsl -lresolv -lz" + OSNAME="Solaris 2.x (or SunOS 5.x)" + LOCALD=undef + ;; + *Darwin*) + DEFCFLAGS="$DEFOPT" + DEFLIBS="-lz" + OSNAME="Darwin" + ;; + *Linux*) +# New, cleaner detection code. -8/15/99 Sean-Paul Rees (sean@dreamfire.net) + cat > $TMP << __EOF__ +#include +main() +{ + #ifdef __GLIBC__ + printf("%d_%d\n", __GLIBC__, __GLIBC_MINOR__); + #else + printf("0\n"); + #endif + + exit(0); +} +__EOF__ +# +# Yes, I know we don't have $CCPATH and $XCFLAGS and such set up yet, +# but below should work on just about any Linux system +# +# Glibc version now correctly detected (major.minor) +# patched: 8/15/99 Sean-Paul Rees (sean@dreamfire.net) +# + cc $TMP -o $EXEC >/dev/null 2>&1 + GLIBCVERS=`$EXEC` + + case $GLIBCVERS in + 0) # This is Linux without Glibc. + OSNAME="Linux" + DEFLIBS="-lz" + ;; + 2*) # Linux with Glibc 2.x + OSNAME="Linux (Glibc $GLIBCVERS)" + DEFLIBS="-lcrypt -lresolv -lz" + ;; + esac + + DEFCFLAGS="$DEFOPT" + ;; + *HP-UX*.09.*) + DEFCFLAGS="$DEFOPT" + DEFLIBS="-lz" + OSNAME="HPUX 9.x" + ;; + *HP-UX*.10.*) + DEFCFLAGS="$DEFOPT" + DEFLIBS="-lz" + OSNAME="HPUX 10.x" + ;; +esac + +echo " " +echo Operating System: $OSNAME +echo " " + +# Create Makefile if it doesn't exist... +if [ ! -f Makefile ] ; then + cp Makefile.dist Makefile +fi +cat << __EOF__ +Welcome to autoconfigure for the Serenity-IRC server version $IRCD_VERSION. + +Config will generate a system-specific $SETUP file, a top +level Makefile and a persistant options file named +$OPTIONS + +Enter "none" at any prompt to effect a null entry. + +__EOF__ + +runonce="" +FOO=`egrep "^CC=" Makefile 2>/dev/null | sed -e 's/^[^=]*[ ]*=\(.*\)/\1/'` +while [ -z "$CCPATH" ] ; do + MYP=`echo "$PATH" | sed -e 's/:/ /g'` + echo "Which compiler do you use, gcc or cc?" + echo $n "[$FOO] -> $c" + if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then + read cc + else + cc="" + fi + if [ -z "$cc" ] ; then + cc=$FOO + CCPATH=$FOO + elif [ -f $cc ] ; then + CCPATH=$cc + else + for i in $MYP; do + if [ -f $i/$cc -a -z "$CCPATH" ] ; then + CCPATH=$i/$cc + fi + done + fi + if [ -z "$CCPATH" ]; then runonce="Yes"; fi +done +if [ "$FOO" != "$cc" ] ; then + MYP=`echo "$CCPATH" | sed -e 's@/@ @g'` + set $MYP + if [ $2 ] ; then + while [ $2 ] ; do + shift + done + fi + if [ $1 = "gcc" ] ; then + CCPATH="$CCPATH" + fi +fi +echo "Compiler selected: $CCPATH" +echo " " +# Check it out +cat > $TMP <<__EOF__ +main() {} +__EOF__ +$CCPATH $TMP -o $EXEC >/dev/null 2>&1 +if [ ! -f $EXEC ] ; then + echo "You don't have $CCPATH or it's broken." + exit 1 +fi +# Fix Makefile +# +$RM -f Makefile.tmp +sed -e "s@^CC=\(.*\)@CC=$CCPATH@" Makefile > Makefile.tmp +cp Makefile.tmp Makefile +$RM -f Makefile.tmp +# +echo "Enter additional flags to give to $CCPATH" +FOO=`egrep "^XCFLAGS=" Makefile 2>/dev/null | sed -e 's/^[^=]*=[ ]*\(.*\)/\1/'` +if [ -z "$FOO" ] ; then + echo "I recommend $DEFCFLAGS" + FOO="$DEFCFLAGS" +fi +echo $n "[$FOO] -> $c" +if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then + read cc +else + cc="" +fi +if [ -z "$cc" ] ; then + cc="$FOO" +fi +if [ "$cc" = "none" ] ; then + cc='' +fi +XCFLAGS=$cc +# Fix Makefile +# +$RM -f Makefile.tmp +sed -e "s@^XCFLAGS=\(.*\)@XCFLAGS=$XCFLAGS@" Makefile > Makefile.tmp +cp Makefile.tmp Makefile +$RM -f Makefile.tmp +# +cat <<__EOF__ + +If you need to use any extra libraries when compiling the server, +please tell me now and please include all the -l and -L flags. + +You should use the recommended value unless you have a compelling reason +not to... +__EOF__ +LIBS=`egrep "^IRCDLIBS=" Makefile 2>/dev/null | sed -e 's/^[^=]*=\(.*\)/\1/' | tr -d "\012"` +if [ -z "$LIBS" ] ; then + echo "I suggest: $DEFLIBS" + LIBS="$DEFLIBS" +fi +echo $n "[$LIBS] -> $c" +if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then + read cc +else + cc="" +fi +if [ -z "$cc" ] ; then + cc="$LIBS" +fi +if [ "$cc" = "none" ] ; then + cc='' +fi +LIBS=$cc +# Fix Makefile +# +$RM -f Makefile.tmp +sed -e "s@^IRCDLIBS=\(.*\)@IRCDLIBS=$LIBS@" Makefile > Makefile.tmp +cp Makefile.tmp Makefile +$RM -f Makefile.tmp +# +COMP="$CCPATH $XCFLAGS $TMP -o $EXEC $LIBS" +# +echo 'Checking out /usr/include' +echo $n "Looking for /usr/include/stdlib.h...$c" +if [ -r /usr/include/stdlib.h ] ; then + STDLIBH=define + echo 'found' +else + echo 'not found' +fi +echo $n "Looking for stddef.h...$c" +if [ -r /usr/include/stddef.h ] ; then + STDDEFH=define + echo 'found' +else + echo 'not found' +fi +echo $n "Looking for /usr/include/sys/syslog.h...$c" +if [ -r /usr/include/sys/syslog.h ] ; then + SYSSYSLOGH=define + echo 'found' +else + echo 'not found' +fi + +echo $n "Looking for /usr/include/sys/param.h...$c" +if [ -r /usr/include/sys/param.h ] ; then + PARAMH=define + echo 'found' +else + echo 'not found' +fi +echo $n "Looking for /usr/include/unistd.h...$c" +if [ -r /usr/include/unistd.h ] ; then + UNISTDH=define + echo 'found' +else + echo 'not found' +fi +echo $n "Looking for /usr/include/string.h...$c" +if [ -r /usr/include/string.h ] ; then + STRINGH=define + echo 'found' +else + echo 'not found' +fi +echo $n "Looking for /usr/include/strings.h...$c" +if [ -r /usr/include/strings.h ] ; then + STRINGSH=define + echo 'found' +else + echo 'not found' +fi +echo $n "Looking for /usr/include/sys/rusage.h...$c" +if [ -r /usr/include/sys/rusage.h ] ; then + RUSAGEH=define + echo 'found' +else + echo 'not found (good)' +fi +# +# to b or not to b +# +echo $n "Searching for bcopy/bzero/bcmp...$c" +cat > $TMP <<__EOF__ +main() +{ + char a[3], b[3]; + bzero(b,3); + bcopy(a,b,3); + (void)bcmp(a,b,3); + exit(0); +} +__EOF__ +$COMP >/dev/null 2>&1 +if [ $? -eq 0 ] ; then + echo "located bcopy/bzero/bcmp" + HAVE_BZERO=define +else + echo "No bcopy/bzero/bcmp found" + HAVE_BZERO=undef +fi +echo " " +echo $n "Which one, gettimeofday, or lrand48..$c" +cat > $TMP <<__EOF__ +#include +#include +main() + { + struct timeval tv; + (void) gettimeofday(&tv, NULL); + } +__EOF__ +$COMP >/dev/null 2>&1 +if [ $? -eq 0 ] ; then + echo "gettimeofday found" + GETTIMEOFDAY=define +else + echo "No gettimeofday. Trying lrand48." +cat > $TMP <<__EOF__ +main() +{ + int a; + a=lrand48(); +} +__EOF__ + $COMP >/dev/null 2>&1 + if [ $? -eq 0 ] ; then + echo "lrand48 found" + LRAND48=define + fi +fi +# +# check for non-blocking fd style available.. +# +echo 'Checking for POSIX/BSD/SYSV' +if [ -f $TMP -o -d $TMP ] ; then + $RM -f $TMP +fi +cat > $PLATE <<__EOF__ +#include +#include +#include +#include +#include +#include +alarmed() +{ + exit(1); +} +main() +{ + char b[12], x[32]; + int f, l = sizeof(x); + f = socket(AF_INET, SOCK_DGRAM, 0); + if (f >= 0 && !(fcntl(f, F_SETFL, BLOCKING))) { + signal(SIGALRM, alarmed); + alarm(3); + recvfrom(f, b, 12, 0, x, &l); + alarm(0); + exit(0); + } + exit(1); +} +__EOF__ +sed -e 's/BLOCKING/O_NONBLOCK/' $PLATE > $TMP +$COMP >/dev/null 2>&1 +if [ 0 -eq $? ] ; then + $EXEC +fi +if [ 0 -eq $? ] ; then + POSIX_NBLOCK=define +else + echo 'O_NONBLOCK not present/working in fcntl.h or sys/ioctl.h' + if [ -f $TMP -o -d $TMP ] ; then + $RM -f $TMP $EXEC; + fi + sed -e 's/BLOCKING/O_NDELAY/' $PLATE > $TMP + $COMP >/dev/null 2>&1 + if [ 0 -eq $? ] ; then + $EXEC + fi + if [ 0 -eq $? ] ; then + BSD_NBLOCK=define + else + echo 'O_NDELAY not present/working in fcntl.h or sys/ioctl.h' + if [ -f $TMP -o -d $TMP ] ; then + $RM -f $TMP $EXEC; + fi + sed -e 's/BLOCKING/FIONBIO/' $PLATE > $TMP + $COMP >/dev/null 2>&1 + if [ 0 -eq $? ] ; then + echo 'ERROR: FIONBIO not found! No option found!' + else + echo "Using SysV blocking" + fi + fi +fi +$RM -f $TMP $PLATE $EXEC +echo "Blocking selected: $BLOCK"; +# +# reliable signals ? +# +echo 'Looking for reliable signals...' +echo "Checking if you have 'action from POSIX..." +cat > $TMP <<__EOF__ +#include + +main() +{ /* poor replacement for NULL but who cares here ? */ + sigaction(SIGTERM, (struct sigaction *)0L, (struct sigaction *)0L); +} +__EOF__ +$COMP >/dev/null 2>&1 +if [ $? -eq 0 ] ; then + echo "'action from POSIX found" + POSIX_SIGNAL=define +else + $RM -f $EXEC $TMP + cat > $TMP <<__EOF__ +#include +int calls = 0; +void handler() +{ + if (calls) + return; + calls++; + kill(getpid(), SIGTERM); + sleep(1); +} +main() +{ + signal(SIGTERM, handler); + kill(getpid(), SIGTERM); + exit (0); +} +__EOF__ + echo $n "No, but you have...$c" + $COMP >/dev/null 2>&1 + $EXEC + if [ $? -eq 0 ] ; then + echo 'reliable signals found' + BSD_SIGNAL=define + else + echo "unreliable SYSV detected" + fi +fi +$RM -f $EXEC $TMP +# +echo 'Now those strings libraries...' +cat > $TMP <<__EOF__ +#$STRINGH STRINGH +#$STRINGSH STRINGSH +#ifdef STRINGH +#include +#endif +#ifdef STRINGSH +#include +#endif +main() +{ + char *s = index("foo", 'o'); + exit(0); +} +__EOF__ +$COMP >/dev/null 2>&1 +if [ $? -eq 0 ] ; then + echo "you have index()!" + HINDEX=define +else + echo "I guess there is a strchr() out there somewhere..." +fi +$RM -f $EXEC $TMP +# +# getrusage or times ? +# +echo $n "One for debugging, mainly, getrusage(2) or times(2)...$c" +cat > $TMP <<__EOF__ +#include +#include +#include +main() +{ + struct rusage rus; + (void)getrusage(RUSAGE_SELF, &rus); +} +__EOF__ +$COMP >/dev/null 2>&1 +if [ $? -eq 0 ] ; then + GETRUSAGE_2=define + echo "getrusage()" +else + $RM -f $EXEC $TMP + cat > $TMP <<__EOF__ +#include +#include +#include +main() +{ + struct tms tmsbuf; + (void)times(&tmsbuf); +} +__EOF__ + $COMP >/dev/null 2>&1 + if [ $? -eq 0 ] ; then + TIMES_2=define + echo "times()" + else + echo "couldn't get either ?!" + fi +fi +# +# what do we need that isn't here already ? +# +echo -n "Looking for strcasecmp..." +cat > $TMP <<__EOF__ +#$STRINGH STRINGH +#$STRINGSH STRINGSH +#ifdef STRINGH +#include +#endif +#ifdef STRINGSH +#include +#endif +main() +{ + char *s = strcasecmp('a', 'a'); + exit(0); +} +__EOF__ +$COMP >/dev/null 2>&1 +if [ $? -eq 0 ] ; then + echo "strcasecmp found" + STRCASECMP=define +else + echo "No strcasecmp found" +fi +#$RM -f $EXEC $TMP +echo "Checking for additional components..." +echo $n "Searching...$c" +cat > $TMP <<__EOF__ +main() +{ + unsigned long foo; + + char *s = strtoul("0x12345", &foo, 16); + exit(0); +} +__EOF__ +$COMP >/dev/null 2>&1 +if [ $? -ne 0 ] ; then + echo $n " strtoul$c" + $RM -f Makefile.tmp + sed -e "s@^STRTOUL=\(.*\)@STRTOUL=strtoul.o@" Makefile > Makefile.tmp + cp Makefile.tmp Makefile + $RM -f Makefile.tmp +else + $RM -f Makefile.tmp + sed -e "s@^STRTOUL=\(.*\)@STRTOUL=@" Makefile > Makefile.tmp + cp Makefile.tmp Makefile + $RM -f Makefile.tmp +fi +$RM -f $EXEC $TMP +cat > $TMP <<__EOF__ +main() +{ + char *s = strerror(0); + exit(0); +} +__EOF__ +$COMP >/dev/null 2>&1 +if [ $? -ne 0 ] ; then + echo $n " strerror$c" +else + STRERROR=define +fi +$RM -f $EXEC $TMP +cat > $TMP <<__EOF__ +#include +#include +#include +#include + +main() +{ + dn_skipname("",""); + exit(0); +} +__EOF__ +$COMP >/dev/null 2>&1 +# dn_skipname passes the small test but won't resolve when ircd is linked. +# Hmmm... +if [ $? -ne 0 -o "$OSNAME" = "Linux RedHat 5.0" -o -n "$NEEDSKIPNAME" -o "$GLIBCCHECK" = "define" ] ; then + echo $n " dn_skipname$c" + $RM -f Makefile.tmp + sed -e "s@^RES=\(.*\)@RES=res_skipname.o@" Makefile > Makefile.tmp + cp Makefile.tmp Makefile + $RM -f Makefile.tmp +else + $RM -f Makefile.tmp + sed -e "s@^RES=\(.*\)@RES=res_init.o@" Makefile > Makefile.tmp + cp Makefile.tmp Makefile + $RM -f Makefile.tmp +fi +$RM -f $EXEC $TMP +cat > $TMP <<__EOF__ +#include +main() +{ + u_int32_t foo; + exit(0); +} +__EOF__ +$COMP >/dev/null 2>&1 +if [ $? -ne 0 ] ; then + echo $n " u_int32_t$c" + $RM -f Makefile.tmp + sed -e "s@^NEED_U_INT32_T=\(.*\)@NEED_U_INT32_T=-DNEED_U_INT32_T@" Makefile > Makefile.tmp + cp Makefile.tmp Makefile + $RM -f Makefile.tmp +else + $RM -f Makefile.tmp + sed -e "s@^NEED_U_INT32_T=\(.*\)@NEED_U_INT32_T=@" Makefile > Makefile.tmp + cp Makefile.tmp Makefile + $RM -f Makefile.tmp +fi +$RM -f $EXEC $TMP +cat > $TMP <<__EOF__ +#$STRINGH STRINGH +#$STRINGSH STRINGSH +#ifdef STRINGH +#include +#endif +#ifdef STRINGSH +#include +#endif +main() +{ + char t[] = "a", **p = NULL, *s = strtoken(&p, t, ","); + if (!strcmp(t, s)) + exit(0); + exit(1); +} +__EOF__ +$COMP >/dev/null 2>&1 +if [ $? -ne 0 ] ; then + echo $n " strtoken$c" + STRTOKEN=undef +else + $EXEC + if [ $? -ne 0 ] ; then + echo $n " strtoken$c" + STRTOKEN=undef + fi +fi +$RM -f $EXEC $TMP +cat > $TMP <<__EOF__ +#$STRINGH STRINGH +#$STRINGSH STRINGSH +#ifdef STRINGH +#include +#endif +#ifdef STRINGSH +#include +#endif +main() +{ + char t[] = "a", *s = strtok(t, ","); + if (!strcmp(t, s)) + exit(0); + exit(1); +} +__EOF__ +$COMP >/dev/null 2>&1 +if [ $? -ne 0 ] ; then + echo $n " strtok$c" + STRTOK=undef +else + $EXEC + if [ $? -ne 0 ] ; then + echo $n " strtok$c" + STRTOK=undef + fi +fi +$RM -f $EXEC $TMP +cat > $TMP << __EOF__ +#include +#include +main() +{ + struct in_addr in; + (void)inet_addr("1.2.3.4"); +} +__EOF__ +$COMP >/dev/null 2>&1 +if [ $? -ne 0 ] ; then + echo $n " inet_addr$c" + INETADDR=undef +fi +$RM -f $EXEC $TMP +cat > $TMP << __EOF__ +#include +#include +main() +{ + struct in_addr in; + in.s_addr = 0x12345678; + (void)inet_ntoa(in); +} +__EOF__ +$COMP >/dev/null 2>&1 +if [ $? -ne 0 ] ; then + echo $n " inet_ntoa$c" +fi +$RM -f $EXEC $TMP +cat > $TMP << __EOF__ +#include +#include +main() +{ + struct in_addr in; + in.s_addr = 0x87654321; + (void)inet_netof(in); +} +__EOF__ +$COMP >/dev/null 2>&1 +if [ $? -ne 0 ] ; then + echo $n " inet_netof$c" + INETNETOF=undef +fi +$RM -f $EXEC $TMP +echo " " + +$RM -f $EXEC $TMP $PLATE +cat > $SETUP <<__EOF__ +#define IRCD_VERSION "$IRCD_VERSION" +#$PARAMH HAVE_PARAM_H +#$UNISTDH HAVE_UNISTD_H +#$STRINGH HAVE_STRING_H +#$STRINGSH HAVE_STRINGS_H +#$STDLIBH HAVE_STDLIB_H +#$STDDEFH HAVE_STDDEF_H +#$SYSSYSLOGH HAVE_SYSSYSLOG_H +#$HINDEX HAVE_INDEX +#$STRERROR HAVE_STRERROR +#$STRTOKEN HAVE_STRTOKEN +#$STRTOK HAVE_STRTOK +#$INETADDR HAVE_INET_ADDR +#$INETNTOA HAVE_INET_NTOA +#$INETNETOF HAVE_INET_NETOF +#$GETTIMEOFDAY GETTIMEOFDAY +#$LRAND48 HAVE_LRAND48 +#$STRCASECMP HAVE_STRCASECMP +#$HAVE_BZERO HAVE_BZERO +#$POSIX_NBLOCK HAVE_POSIX_NBLOCK +#$BSD_NBLOCK HAVE_BSD_NBLOCK +#$POSIX_SIGNAL HAVE_POSIX_SIGNALS +#$BSD_SIGNAL HAVE_BSD_SIGNALS +#$TIMES_2 HAVE_TIMES_2 +#$GETRUSAGE_2 HAVE_GETRUSAGE_2 +__EOF__ + +if [ $? -ne 0 -o "$OSNAME" = "Darwin" ] ; then +echo "#define __Darwin__" >> $SETUP +fi + +# +# Now, get site specific options. +# + +FOO="" +runonce="" +while [ -z "$FOO" ] ; do + FOO="$KLINE_ADDRESS" + echo " " + echo "What is the contact address for connect problems due to the" + echo "user being K:lined, shown to the user when they attempt to" + echo "connect? This should be a valid email address." + echo " " + echo "For all servers, note that this message is displayed when" + echo "the user is affected by a local K:line or k:line. With" + echo "Services-based autokills, the message is set up automatically" + echo "by Services to ask the user to email kline@serenity-irc.net. It is" + echo "recommended that you set this up to give a valid email address" + echo "for the server's admin, not kline@serenity-irc.net." + echo $n "[$FOO] -> $c" + if [ -z "$AUTO_CONFIG" -o -n "$runonce" -o -z "$FOO" ] ; then + read cc + else + cc="" + runonce=Yes + fi + if [ -z "$cc" ] ; then + cc=$FOO + fi + case "$cc" in + *@*.*) + KLINE_ADDRESS=$cc + FOO="$KLINE_ADDRESS" + ;; + *) + echo " " + echo "Read the instructions and try again... You did not enter a" + echo "proper email address (user@host.domain)." + FOO="" + ;; + esac +done + +FOO="" +runonce="" +while [ -z "$FOO" ] ; do + FOO="$DPATH" + echo "" + echo "What directory are all the server configuration files in?" + echo $n "[$FOO] -> $c" + if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then + read cc + else + cc="" + runonce=Yes + fi + if [ -z "$cc" ] ; then + cc=$FOO + fi +done +DPATH=$cc + +FOO="" +runonce="" +while [ -z "$FOO" ] ; do + FOO="$DPATH/ircd" + echo "" + echo "What is the explicit path to where the ircd binary will be" + echo "installed? This should point to a file, not a directory" + echo $n "[$FOO] -> $c" + if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then + read cc + else + cc="" + runonce=Yes + fi + if [ -z "$cc" ] ; then + cc=$FOO + fi +done +SPATH=$cc + +FOO="" +runonce="" +while [ -z "$FOO" ] ; do + echo "" + echo "What is your local domain name? This is used for /stats w to" + echo "report local clients vs. remote clients." + if [ "$LOCALD" = "define" ] ; then + echo "Auto-probing local host..." + HOSTNAME=`hostname` + if [ $? -eq 0 ]; then + TEMPHOST="${HOSTNAME#*.}" + if [ "${#HOSTNAME}" -ne "${#TEMPHOST}" ]; then + FOO="${TEMPHOST}" + else + echo "" + echo "This guess probably isn't right:" + FOO="${HOSTNAME}" + fi + else + FOO="$DOMAINNAME" + fi + else + echo "Skipping auto-probe. (Bad OS: $OSNAME)" + FOO="configure.this" + fi + echo $n "[$FOO] -> $c" + if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then + read cc + else + cc="" + runonce=Yes + fi + if [ -z "$cc" ] ; then + cc=$FOO + fi + FOO=$cc +done +DOMAINNAME=$cc + +FOO="" +runonce="" +while [ -z "$FOO" ] ; do + if [ -n "$HUB" ] ; then + FOO="Yes" + else + FOO="No" + fi + echo "" + echo "Are you running as a HUB server?" + echo $n "[$FOO] -> $c" + if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then + read cc + else + cc="" + runonce=Yes + fi + if [ -z "$cc" ] ; then + cc=$FOO + fi + case "$cc" in + [Yy]*) + HUB="1" + ;; + [Nn]*) + HUB="" + ;; + *) + echo "" + echo "You need to enter either Yes or No here..." + echo "" + FOO="" + ;; + esac +done + +FOO="" +runonce="" +while [ -z "$FOO" ] ; do + if [ -n "$CRYPT_OPER_PASSWORD" ] ; then + FOO="Yes" + else + FOO="No" + fi + echo "" + echo "Do you use encrypted operator passwords?" + echo $n "[$FOO] -> $c" + if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then + read cc + else + cc="" + runonce=Yes + fi + if [ -z "$cc" ] ; then + cc=$FOO + fi + case "$cc" in + [Yy]*) + CRYPT_OPER_PASSWORD="1" + ;; + [Nn]*) + CRYPT_OPER_PASSWORD="" + ;; + *) + echo "" + echo "You need to enter either Yes or No here..." + echo "" + FOO="" + ;; + esac +done +CRYPT_ILINE_PASSWORD=$CRYPT_OPER_PASSWORD + +FOO="" +runonce="" +while [ -z "$FOO" ] ; do + if [ -n "$ZIP_LINKS" ] ; then + FOO="Yes" + else + FOO="No" + fi + echo "" + echo "Do you want to enable server compression?" + echo $n "[$FOO] -> $c" + if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then + read cc + else + cc="" + runonce=Yes + fi + if [ -z "$cc" ] ; then + cc=$FOO + fi + case "$cc" in + [Yy]*) + ZIP_LINKS="1" + ;; + [Nn]*) + ZIP_LINKS="" + ;; + *) + echo "" + echo "You need to enter either Yes or No here..." + echo "" + FOO="" + ;; + esac +done + +FOO="" +runonce="" +while [ -z "$FOO" ] ; do + FOO="$MAXCONNECTIONS" + echo "" + echo "How many file descriptors (or sockets) can the irc server use?" + echo $n "[$FOO] -> $c" + if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then + read cc + else + cc="" + runonce=Yes + fi + if [ -z "$cc" ] ; then + cc=$FOO + fi + case "$cc" in + [1-9][0-9][0-9]*) + MAXCONNECTIONS="$cc" + ;; + *) + echo "" + echo "You need to enter a number here, greater or equal to 100." + echo "" + FOO="" + ;; + esac +done + +# +# check FD_SETSIZE and override if needed. +# + +cat > $TMP <<__EOF__ +#include +#include + +#ifndef FD_SETSIZE +#define FD_SETSIZE -1 +#endif + +/* + * Prints "notdef" if FD_SETSIZE is undefined, + * "ok" if FD_SETSIZE is at least as large as provided on the + * compile command line (-DMAXCONNECTIONS=1234) + * "###" if it is less. (### is the FD_SETSIZE value) + */ +int +main(int argc, char *argv[]) +{ + if (FD_SETSIZE == -1) + printf("notdef\n"); + else if (FD_SETSIZE >= MAXCONNECTIONS) + printf("ok\n"); + else + printf("%d\n", FD_SETSIZE); + + return 0; +} +__EOF__ +$COMP "-DMAXCONNECTIONS=$MAXCONNECTIONS" >/dev/null 2>&1 +if [ $? -ne 0 ] ; then + echo " " + echo "I could not derrive what your system allows for the maximum number" + echo "of connections becuase the test program did not compile." + echo " " + FD_SETSIZE="" +else + fd_setsize_ok=`$EXEC` + case $fd_setsize_ok in + notdef) + echo " " + echo "I could not derrive what your system allows for the maximum" + echo "number of connections because the test program did not find" + echo "a system-supplied value for FD_SETSIZE. Assuming it is" + echo "defined correctly but the test program cannot find it." + echo " " + FD_SETSIZE="" + ;; + ok) + echo " " + echo "Your system-supplied value for FD_SETSIZE is large enough" + echo "for ircd to leave it untouched." + echo " " + FD_SETSIZE="" + ;; + *) + echo " " + echo "Your system-supplied value for FD_SETSIZE is $fd_setsize_ok" + echo "but you requested $MAXCONNECTIONS for ircd. FD_SETSIZE will" + echo "be overridden using -DFD_SETSIZE=$MAXCONNECTIONS when" + echo "compiling ircd." + echo " " + FD_SETSIZE=$MAXCONNECTIONS + ;; + esac +fi + +if [ -n "$FD_SETSIZE" ] ; then + $RM -f Makefile.tmp + sed -e "s@^FD_SETSIZE=\(.*\)@FD_SETSIZE=-DFD_SETSIZE=$FD_SETSIZE@" Makefile > Makefile.tmp + cp Makefile.tmp Makefile + $RM -f Makefile.tmp +else + $RM -f Makefile.tmp + sed -e "s@^FD_SETSIZE=\(.*\)@FD_SETSIZE=@" Makefile > Makefile.tmp + cp Makefile.tmp Makefile + $RM -f Makefile.tmp +fi + +$RM -f $EXEC $TMP + + +cat <<__EOF__ + +The file "$OPTIONS" was either created or rewritten to contain your +answers to the above questions. + +This file is automatically generated and will be updated each time you +run Config. You should retain a copy of this to help migrate to future +versions of the server with ease. + +__EOF__ + +# +# continue the $SETUP file +# +cat >> $SETUP << __EOF__ +#define DPATH "$DPATH" +#define SPATH "$SPATH" +#define MAXCONNECTIONS $MAXCONNECTIONS +__EOF__ +if [ -n "$HUB" ] ; then + echo "#define HUB" >> $SETUP +else + echo "#undef HUB" >> $SETUP +fi +if [ -n "$CRYPT_OPER_PASSWORD" ] ; then + echo "#define CRYPT_OPER_PASSWORD 1" >> $SETUP +else + echo "#undef CRYPT_OPER_PASSWORD" >> $SETUP +fi +if [ -n "$CRYPT_ILINE_PASSWORD" ] ; then + echo "#define CRYPT_ILINE_PASSWORD 1" >> $SETUP +else + echo "#undef CRYPT_ILINE_PASSWORD" >> $SETUP +fi +if [ -n "$CONTACT_URL" ] ; then + echo "#define CONTACT_URL \"$CONTACT_URL\"" >> $SETUP +fi +if [ -n "$CONTACT_EMAIL" ] ; then + echo "#define CONTACT_EMAIL \"$CONTACT_EMAIL\"" >> $SETUP +fi +if [ -n "$SERVICES_NAME" ] ; then + echo "#define SERVICES_NAME \"$SERVICES_NAME\"" >> $SETUP +fi +if [ -n "$KLINE_ADDRESS" ] ; then + echo "#define KLINE_ADDRESS \"$KLINE_ADDRESS\"" >> $SETUP +fi +if [ -n "$DOMAINNAME" ] ; then + echo "#define DOMAINNAME \"$DOMAINNAME\"" >> $SETUP +else + echo "#undef DOMAINNAME" >> $SETUP +fi +if [ -n "$ZIP_LINKS" ] ; then + echo "#define ZIP_LINKS 1" >> $SETUP +else + echo "#undef ZIP_LINKS" >> $SETUP +fi + +# +# Create file for make install +# +rm -f $MAKEINST +cat > $MAKEINST << __EOF__ + +if [ ! -d $DPATH ] ; then + mkdir $DPATH +fi + +if [ -f $SPATH ] ; then + cp $SPATH $SPATH.old +fi + +if [ -f $DPATH/ircd.pid ] ; then + kill -9 \`cat $DPATH/ircd.pid \` +fi + +cp src/ircd $SPATH +$SPATH +__EOF__ +# +chmod 711 $MAKEINST +# +# create the persistant file +# +rm -f $OPTIONS +cat > $OPTIONS << __EOF__ +# +# VERSION: $IRCD_VERSION +# DATE: $CONF_DATE +# +# This file is automatically generated and will be updated each time you +# run Config. You should retain a copy of this to help migrate to future +# versions of the server with ease. +# +LAST_VERSION="$IRCD_VERSION" +CONTACT_URL="$CONTACT_URL" +CONTACT_EMAIL="$CONTACT_EMAIL" +SERVICES_NAME="$SERVICES_NAME" +KLINE_ADDRESS="$KLINE_ADDRESS" +ZIP_LINKS="$ZIP_LINKS" +DPATH="$DPATH" +SPATH="$SPATH" +HUB="$HUB" +PARANOIA="$PARANOIA" +CRYPT_OPER_PASSWORD="$CRYPT_OPER_PASSWORD" +MAXCONNECTIONS="$MAXCONNECTIONS" +DOMAINNAME="$DOMAINNAME" +__EOF__ + +cat <<__EOF__ + + Config is complete. + + Before compiling, check the contents of include/config.h for any strange + things you usually set. If you want them to be included in the future, + ask them to be moved to the setup.h file on remmy@serenity-irc.net. + +__EOF__ diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..245fbff --- /dev/null +++ b/INSTALL @@ -0,0 +1,169 @@ +Installation Procedures for the StarChat IRC Server: +======================================================================= +by Alexei Kosut (Lefler) +with changes for dal4.3.6 by Mikko Hänninen (Wizzu) +for dal4.3.6 +with changes for dal4.4.11 by Cabal95 (cabal95@dal.net) +with changes for Star4.10.Spire by GZ (gz@starchat.net) +======================================================================= + +This document describes how to install ircd, the unix daemon that acts as +an IRC server. Specifically, for the StarChat IRC Network, though some +information may be applicable to other networks as well. + +For more information on StarChat or this server, please see our WWW page at +, or contact us at sc@starchat.net. + +For help with this ircd, try joining #ircd on StarChat. There you will find a friendly +staff who can help you with most common problems affecting the ircd. If they can't help, +they'll probably be able to find someone who will. :-) + +The StarChat server is available from ftp://utopia.starchat.net/pub/, along with the +latest copy of this document. + + +======================================================================= +This version of the StarChat IRC Server is known to compile on the following +platforms, and with the following compilers. If you wish to add to this +list, send the relevant information to us. + +OS and Version Compiler and Version Comments +------------------- ------------------------ ------------------------------- +NetBSD 1.2B gcc 2.7.2 + +FreeBSD 2.1.0 gcc 2.6.3 Do NOT use crypt at all... + +SunOS 4.1.4 gcc 2.7-96q1 (Cygnus) + +Solaris 2.4 gcc 2.7-96q1 (Cygnus) (SunOS 5.4) + +Solaris 2.5 SunWorks Pro C (SunOS 5.5.1) + cc: SC4.0 18 Oct 1995 C 4.0 + +Digital Unix 3.2 gcc 2.7-96q3 (Cygnus) + +Linux 2.0.24 gcc 2.7.2.1 should now also compile + under Red Hat 5.0 + +HPUX 9.01 gcc 2.6.3 + +HPUX 10.01 gcc 2.7-96q3 (Cygnus) + +======================================================================= +Unpacking the Distribution + +If you are reading this, you have most likely already done this, but to +recap: + +The StarChat server +comes tarred and gzipped. To uncompress it and expand it, use the +following command at the Unix prompt: + +tar -xzf Star4.10.tar.gz + +This will create a new directory called Star4.10, and unpack the source +into it. + +======================================================================= +Editing the Configuration Files + +In previous versions of the source code many files had to be edited to +make things right for any given server. + +In this version you DO NOT NEED TO EDIT THE Makefile OR ANY FILES +IN include! That is, unless you set some strange options. If you +find the need to edit include/config.h, for example, mail us and +tell us why ; Config can be made smarter, and that will make it so +you won't have to edit anything for the next version + +======================================================================= +Compiling Your Server + +Windows users: You must compile the Config program first. To do this +run the following command: $CC src\Config.c +where $CC is the name of your compiler. for MSVC users that is 'cl' + +To build the server, simply run + % ./Config +to start the configuraton program. This program looks at your system +and generate the include/setup.h, include/options.h, and Options files. +You will be asked some questions. Usually the default answers are the best +ones and most correct. To accept the default, just hit RETURN. + +Next, type 'make'. This will compile your server. Depending on your system, +this may be a good time for a caffeine break. (MSVC users run 'nmake') + +Hopefully, the server will compile without incident. If it does not, and +you are not able to determine the error, please email coding@starchat.net +and hopefully someone will be able to help you with the problem. If you +do need to fix something, mail there with a patch. Alternatively, try #ircd +on StarChat. + +BE CERTAIN TO INCLUDE OPERATING SYSTEM INFORMATION (uname -a) AND COMPILER +VERSION (gcc -v, for instance) IN ALL BUG REPORTS. + +Common problems +=============== + +If, when you try to compile, something like the following halts make: +res.o: In function `proc_answer': +/home/GZ/Star4.10/src/res.c:617: undefined reference to `dn_expand' +/home/GZ/Star4.10/src/res.c:622: undefined reference to `_getshort' +/home/GZ/Star4.10/src/res.c:624: undefined reference to `_getshort' + +you need to include a separate library. Rerun ./Config and in the space +where it asks you what additional libraries you would like to include, +type "-lresolv". If a similar problem occurs referring to 'crypt', +include the "-lcrypt" library aswell. +======================================================================= +Installing the Files + +'make install' does not work in this release -- it doesn't do anything +except a compile if that is needed. + +The only files you need are the binary from src/ircd and and an ircd.conf +(see below for copying doc/example.conf as your initial ircd.conf). You +probably will want to create a MOTD file too, as well as place the man +pages from the doc directory to appropriate place in your system. + + +======================================================================= +Configuring Your Server + +The previous step places a file named 'example.conf' into your irc +directory you specified to Config. + +To create an IRC configuration file, type: + cp example.conf ircd.conf + +Now edit this file to reflect your server. The file is mainly +self-explanatory. Note that if you plan to use your server on StarChat, +make sure that you have the following line: + +U:services.starchat.net:*:* + +If you need help configuring your file, please join StarChat, go to channel +#ircd, and ask. + + +======================================================================= +Starting Your Server + +Simply enter the complete path to the executable into the Unix command +line, then hit return. Your server is now operational, assuming that you +have completed all the steps described above. + +NOTE: If you get something like the following when running ircd: + +ircd fd table too big +Hard Limit: 256 IRC max: 1024 +Fix MAXCONNECTIONS + +You need to change config.h and recompile. Find the line that says +"#define MAXCONNECTIONS 1024", and change it to the number given after +"Hard Limit" (most likely 256), then make the server again, following the +above instructions. + +Enjoy! + +- GZ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9a17037 --- /dev/null +++ b/LICENSE @@ -0,0 +1,249 @@ + + GNU GENERAL PUBLIC LICENSE + Version 1, February 1989 + + Copyright (C) 1989 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The license agreements of most software companies try to keep users +at the mercy of those companies. By contrast, our General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. The +General Public License applies to the Free Software Foundation's +software and to any other program whose authors commit to using it. +You can use it for your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Specifically, the General Public License is designed to make +sure that you have the freedom to give away or sell copies of free +software, that you receive source code or can get it if you want it, +that you can change the software or use pieces of it in new free +programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of a such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must tell them their rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any program or other work which +contains a notice placed by the copyright holder saying it may be +distributed under the terms of this General Public License. The +"Program", below, refers to any such program or work, and a "work based +on the Program" means either the Program or any work containing the +Program or a portion of it, either verbatim or with modifications. Each +licensee is addressed as "you". + + 1. You may copy and distribute verbatim copies of the Program's source +code as you receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice and +disclaimer of warranty; keep intact all the notices that refer to this +General Public License and to the absence of any warranty; and give any +other recipients of the Program a copy of this General Public License +along with the Program. You may charge a fee for the physical act of +transferring a copy. + + 2. You may modify your copy or copies of the Program or any portion of +it, and copy and distribute such modifications under the terms of Paragraph +1 above, provided that you also do the following: + + a) cause the modified files to carry prominent notices stating that + you changed the files and the date of any change; and + + b) cause the whole of any work that you distribute or publish, that + in whole or in part contains the Program or any part thereof, either + with or without modifications, to be licensed at no charge to all + third parties under the terms of this General Public License (except + that you may choose to grant warranty protection to some or all + third parties, at your option). + + c) If the modified program normally reads commands interactively when + run, you must cause it, when started running for such interactive use + in the simplest and most usual way, to print or display an + announcement including an appropriate copyright notice and a notice + that there is no warranty (or else, saying that you provide a + warranty) and that users may redistribute the program under these + conditions, and telling the user how to view a copy of this General + Public License. + + d) You may charge a fee for the physical act of transferring a + copy, and you may at your option offer warranty protection in + exchange for a fee. + +Mere aggregation of another independent work with the Program (or its +derivative) on a volume of a storage or distribution medium does not bring +the other work under the scope of these terms. + + 3. You may copy and distribute the Program (or a portion or derivative of +it, under Paragraph 2) in object code or executable form under the terms of +Paragraphs 1 and 2 above provided that you also do one of the following: + + a) accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of + Paragraphs 1 and 2 above; or, + + b) accompany it with a written offer, valid for at least three + years, to give any third party free (except for a nominal charge + for the cost of distribution) a complete machine-readable copy of the + corresponding source code, to be distributed under the terms of + Paragraphs 1 and 2 above; or, + + c) accompany it with the information you received as to where the + corresponding source code may be obtained. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form alone.) + +Source code for a work means the preferred form of the work for making +modifications to it. For an executable file, complete source code means +all the source code for all modules it contains; but, as a special +exception, it need not include source code for modules which are standard +libraries that accompany the operating system on which the executable +file runs, or for standard header files or definitions files that +accompany that operating system. + + 4. You may not copy, modify, sublicense, distribute or transfer the +Program except as expressly provided under this General Public License. +Any attempt otherwise to copy, modify, sublicense, distribute or transfer +the Program is void, and will automatically terminate your rights to use +the Program under this License. However, parties who have received +copies, or rights to use copies, from you under this General Public +License will not have their licenses terminated so long as such parties +remain in full compliance. + + 5. By copying, distributing or modifying the Program (or any work based +on the Program) you indicate your acceptance of this license to do so, +and all its terms and conditions. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the original +licensor to copy, distribute or modify the Program subject to these +terms and conditions. You may not impose any further restrictions on the +recipients' exercise of the rights granted herein. + + 7. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of the license which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +the license, you may choose any version ever published by the Free Software +Foundation. + + 8. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to humanity, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + + To do so, attach the following notices to the program. It is safest to +attach them to the start of each source file to most effectively convey +the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 1, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19xx name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the +appropriate parts of the General Public License. Of course, the +commands you use may be called something other than `show w' and `show +c'; they could even be mouse-clicks or menu items--whatever suits your +program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + program `Gnomovision' (a program to direct compilers to make passes + at assemblers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/Makefile.dist b/Makefile.dist new file mode 100755 index 0000000..7a27634 --- /dev/null +++ b/Makefile.dist @@ -0,0 +1,176 @@ +#/************************************************************************ +#* IRC - Internet Relay Chat, Makefile +#* Copyright (C) 1990, Jarkko Oikarinen +#* +#* This program is free software; you can redistribute it and/or modify +#* it under the terms of the GNU General Public License as published by +#* the Free Software Foundation; either version 1, or (at your option) +#* any later version. +#* +#* This program is distributed in the hope that it will be useful, +#* but WITHOUT ANY WARRANTY; without even the implied warranty of +#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#* GNU General Public License for more details. +#* +#* You should have received a copy of the GNU General Public License +#* along with this program; if not, write to the Free Software +#* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +#*/ + +CC=gcc +INCLUDEDIR=../include + +# [CHANGEME] +# Default flags: +# Change XCFLAGS if you don't like what Config puts there. Same with +# IRCDLIBS. +# +# If you are configuring by hand, try "-O -g" for XCFLAGS, and leave +# IRCDLIBS blank. If that fails, try recomendations below. +# +XCFLAGS= +IRCDLIBS= + +# +# use the following on MIPS: +#CFLAGS= -systype bsd43 -DSYSTYPE_BSD43 -I$(INCLUDEDIR) +# For Irix 4.x (SGI), use the following: +#CFLAGS= -g -cckr -I$(INCLUDEDIR) +# +# on NEXT use: +#CFLAGS=-bsd -I$(INCLUDEDIR) +#on NeXT other than 2.0: +#IRCDLIBS=-lsys_s +# +# AIX 370 flags +#CFLAGS=-D_BSD -Hxa -I$(INCLUDEDIR) +#IRCDLIBS=-lbsd +# +# Dynix/ptx V2.0.x +#CFLAGS= -I$(INCLUDEDIR) -O -Xo +#IRCDLIBS= -lsocket -linet -lnsl -lseq +# +# Dynix/ptx V1.x.x +#IRCDLIBS= -lsocket -linet -lnsl -lseq +# +#use the following on SUN OS without nameserver libraries inside libc +#IRCDLIBS=-lresolv +# +# Solaris 2 +#IRCDLIBS=-lsocket -lnsl -lresolv -L/usr/ucblib -R/usr/ucblib -lgen +# +# ESIX +#CFLAGS=-O -I$(INCLUDEDIR) -I/usr/ucbinclude +#IRCDLIBS=-L/usr/ucblib -L/usr/lib -lsocket -lucb -lns -lnsl +# +# LDFLAGS - flags to send the loader (ld). SunOS users may want to add +# -Bstatic here. +# +#LDFLAGS=-Bstatic +# +#Dell SVR4 +#CC=gcc +#CFLAGS= -I$(INCLUDEDIR) -O2 +#IRCDLIBS=-lsocket -lnsl -lucb + +# [CHANGEME] +# IRCDMODE is the mode you want the binary to be. +# The 4 at the front is important (allows for setuidness) +# +# WARNING: if you are making ircd SUID or SGID, check config.h to make sure +# you are not defining CMDLINE_CONFIG +IRCDMODE = 711 + +# [CHANGEME] +# IRCDDIR must be the same as DPATH in include/config.h +# +IRCDDIR=/usr/local/lib/ircd + +# [CHANGEME] +# Some SunOS versions want this. Try it without first. +#RES=res_init.o res_comp.o res_mkquery.o +# BSDI systems want this. +#RES=res_skipname.o +# Recent Linux systems seem to expect this: +RES=res_init.o +# The rest are perfectly content with this. +#RES= + +# [CHANGEME] +# If you get a compile-time error dealing with u_int32_t, comment out +# this line. +# NEED_U_INT32_T= -DNEED_U_INT32_T +NEED_U_INT32_T= + +# [CHANGEME] +# If you get a link-time error dealing with strtoul, comment out +# this line. +# STRTOUL= strtoul.o +STRTOUL= + +# [CHANGEME] +# If you get crashes around a specific number of clients, and that client +# load comes close or a little over the system-defined value of FD_SETSIZE, +# override it here and see what happens. +FD_SETSIZE= + +CFLAGS=-I$(INCLUDEDIR) $(XCFLAGS) $(NEED_U_INT32_T) $(FD_SETSIZE) + +SHELL=/bin/sh +SUBDIRS=src +BINDIR=$(IRCDDIR) +MANDIR=/usr/local/man +INSTALL=/usr/bin/install +RM=rm +CP=cp +TOUCH=touch + +all: build + +MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'IRCDLIBS=${IRCDLIBS}' \ + 'LDFLAGS=${LDFLAGS}' 'IRCDMODE=${IRCDMODE}' \ + 'BINDIR=${BINDIR}' 'INSTALL=${INSTALL}' \ + 'INCLUDEDIR=${INCLUDEDIR}' 'IRCDDIR=${IRCDDIR}' \ + 'MANDIR=${MANDIR}' 'RM=${RM}' 'CP=${CP}' 'TOUCH=${TOUCH}' \ + 'RES=${RES}' 'SHELL=${SHELL}' 'STRTOUL=${STRTOUL}' + +server: + +build: + -@if [ ! -f include/setup.h ] ; then \ + echo "You have not run Config..."; \ + echo "Doing so now.."; \ + sh Config; \ + fi + @for i in $(SUBDIRS); do \ + echo "Building $$i";\ + ( cd $$i; ${MAKE} ${MAKEARGS} build; ) ; \ + done + @echo '' + @echo 'Serene IRCD compiled!' + @echo '' + +clean: + @echo 'Cleaning Serene IRCD' + @for i in $(SUBDIRS); do \ + echo "Cleaning $$i";\ + ( cd $$i; ${MAKE} ${MAKEARGS} clean; ) ; \ + done + @echo '' + @echo 'Cleaning complete.' + @echo '' + +distclean: clean + rm -rf include/setup.h Makefile Options .install + @echo '' + @echo 'Distribution is now fully cleaned.' + @echo '' +depend: + @for i in $(SUBDIRS); do \ + echo "Making dependencies in $$i";\ + ( cd $$i; ${MAKE} ${MAKEARGS} depend; ) ; \ + done + +install: all + @echo "Copying ircd to the right location." + ./.install diff --git a/bsdinstall b/bsdinstall new file mode 100755 index 0000000..12daca1 --- /dev/null +++ b/bsdinstall @@ -0,0 +1,83 @@ +#! /bin/sh + +# @(#)install.sh 4.5 (Berkeley) 10/12/83 +# +cmd=/bin/mv +strip="" +chmod="/bin/chmod 755" +chown="chown -f root" +chgrp="/bin/chgrp -f bin" +while true ; do + case $1 in + -s ) strip="strip" + shift + ;; + -c ) cmd="/bin/cp" + shift + ;; + -m ) chmod="/bin/chmod $2" + shift + shift + ;; + -o ) chown="/etc/chown -f $2" + shift + shift + ;; + -g ) chgrp="/bin/chgrp -f $2" + shift + shift + ;; + -d ) cmd="/bin/mkdir" + shift + ;; + * ) break + ;; + esac +done + +if [ ! ${2-""} ] +then echo "install: no destination specified" + exit 1 +fi +if [ ${3-""} ] +then echo "install: too many files specified -> $*" + exit 1 +fi +if [ $1 = $2 -o $2 = . ] +then echo "install: can't move $1 onto itself" + exit 1 +fi +case $cmd in +/bin/mkdir ) + file=$2/$1 + ;; +* ) + if [ '!' -f $1 ] + then echo "install: can't open $1" + exit 1 + fi + if [ -d $2 ] + then file=$2/$1 + else file=$2 + fi + /bin/rm -f $file + ;; +esac + +case $cmd in +/bin/mkdir ) + if [ ! -d "$file" ] + then $cmd $file + fi + ;; +* ) + $cmd $1 $file + if [ $strip ] + then $strip $file + fi + ;; +esac + +$chown $file +$chgrp $file +$chmod $file diff --git a/doc/CHANGES.old b/doc/CHANGES.old new file mode 100644 index 0000000..affd124 --- /dev/null +++ b/doc/CHANGES.old @@ -0,0 +1,102 @@ +##################################### +# Changes in Star5.18 # +##################################### +Remmy: +o: Leaf servers no longer try to connect to other servers when they are + already connected to some other server. +o: No more Q:Lined nick notices from U lined servers. (for real this + time!) +o: Removed channel mode +p. It led to obscure bugs and no users were using + it for legit reasons anyways. Dinosaur feature. +o: Removed R lines support from the ircd.conf. We have never used them + anyways. +o: Added QUIT messages back to the ircd. +o: Added support for svsjoin and svspart (/os push and /os part) to the ircd. +o: The ircd had an incomplete list of supported channel modes it gave + out to clients upon connecting. Not sure it makes a difference as + it has been like this for over a year, but fixed it anyways. + +Siete: +o: Split up /stats reports for K and Z lines so they no longer should + flood us all off. /stats k for K lines, /stats Z for Z lines, + /stats K for both. Use /stats z for memory usage. + +######################################################################### +# Changes in Star5.19 (see doc/CHANGES.old for older changes) # +######################################################################### +Remmy: +o: Reading in an ircd.conf in DOS file format will no longer result in + strange and unexpected behaviour by the ircd. +o: Removed pre Star5 support +o: Some minor spelling fixes + +Siete: +o: Added support for usermode 'j' (NetFounder) +o: Removed /links and /map notices to IRC Operators + +######################################################################### +# Changes in Star5.20 (see doc/CHANGES.old for older changes) # +######################################################################### +Remmy: +o: Removed many compilation warnings when compiling with -Wall +o: Channel mode +R was not properly transmitted between servers after a + split. Bad! + +######################################################################### +# Changes in Star5.21 (see doc/CHANGES.old for older changes) # +######################################################################### +Remmy: +o: Users could set themselves mode +j (they shouldn't be allowed to). + +######################################################################### +# Changes in Star5.22 (see doc/CHANGES.old for older changes) # +######################################################################### +Remmy: +o: e line support. These can be used to exempt users otherwise caught in + a KLINE. Syntax is the same as that of a K line. Can also be used to + set exemption AKILLs using services. +o: No more throttle notices! Now we can all sleep at night again. + +######################################################################### +# Changes in Star5.23 (see doc/CHANGES.old for older changes) # +######################################################################### +Remmy: +o: Removed e line support ;). They interfere with AKILLs in the new setup + and as such should not be used. +o: Removed socks scan. These served little purpose anymore and caused + significant delays for people behind a NAT network or firewall. +o: Simplified the jinx handling in the ircd. This function is much + smaller now and no longer supports the old hostjinxes (hardly used + anyways). + +######################################################################### +# Changes in Star5.24 (see doc/CHANGES.old for older changes) # +######################################################################### +Remmy: +o: People no longer can take on the nick WebServ when services are down. +o: Introduced usermode 'w'. This one keeps track of who is and who isn't + a valid WebTV user. For use with Services version 0.6.0 and higher. +o: /map, /links and /whois are available to all again and show servers. + +######################################################################### +# Changes in Star5.25 (see doc/CHANGES.old for older changes) # +######################################################################### +o: Introduced channel mode H to require identifaction on certain + hostmasks prior to joining a channel. (Remmy) +o: New and improved hostmasking for usermode +x to better differentiate + between numeric IP's. Also hardens the chance on someone finding the + real hostmask. (InnerFIRE) + +######################################################################### +# Changes in Star5.26 (see doc/CHANGES.old for older changes) # +######################################################################### +o: Removed D,d and L lines support as they weren't being used. (Remmy) +o: Removed identd support. We don't block users based on ident and not + checking may make things faster for firewalled / NAT users. (Remmy) +o: Users can no longer /whois when jinxed. Quit messages can't be sent by + them. (Remmy) +o: Removed support for the /SERVICES command. /IDENTIFY command no longer + forwards to ChanServ. (Remmy) +o: Changed compilation flags and done some minor cleanups. (Remmy) + + diff --git a/doc/INSTALL b/doc/INSTALL new file mode 100644 index 0000000..157a3d9 --- /dev/null +++ b/doc/INSTALL @@ -0,0 +1,962 @@ +/************************************************************************ + * IRC - Internet Relay Chat, doc/INSTALL + * Copyright (C) 1990,1991,1992, Jeff Trim, Mike Bolotski, + * Jarkko Oikarinen and Darren Reed. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 1, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + Installing IRC - The Internet Relay Chat Program + + +Overview of this document: + + 1) The config.h file + 2) Editing the Makefile + 3) Compiling IRC + 4) The ircd.conf file + + +1) Edit the "config.h" file and make changes to the various #DEFINE's: + + a) Copy the config.h.dist file to config.h before editing. + + b) Define what type of UNIX your machine uses. + + Pick the machine type which best describes your machine and change + the #undef to #define (if needed). Some flavours of Unix require no + #define and in such cases all others should be #undef'd. + + c) DEBUGMODE + + Define DEBUGMODE if you want to see the ircd debugging information + as the daemon is running. Normally this function will be undefined + as ircd produces a considerable amount of output. DEBUGMODE must be + defined for either of -t or -x command line options to work. + + d) DPATH, SPATH, CPATH, MPATH, LPATH, PPATH + + DPATH is provided so that the other pathnames (SPATH, CPATH, etc) + may be provided in just filename form. When the server starts, it + chdir's to DPATH before chroot or any other file operation, making + it the "current directory" for the server. This is where core files + will go if it core dumps. + + Define SPATH to be the directory path to ircd. This is usually + /usr/local/bin/ircd, unless you don't have installation permission + there. + + Define CPATH to be the directory path to the "irc.conf" file. + This path is usually /usr/local/lib/irc.conf. The format of this file + will be discussed later. + + The LPATH #define should be set to "/dev/null" unless you plan to + debug the program. Note that the logfile grows very quickly. + + Define MPATH to be the path to the 'motd' (message of the day) file + for the server. Keep in mind this is displayed whenever anyone + signs on to your server. + + The PPATH is optional, but if defined, should point to a file which + either doesn't exist (but is creatable) or a previously used PPATH + file. It is used for storing the server's PID so a ps(1) isn't + necessary. + + e) CHROOTDIR + + To use the CHROOTDIR feature, make sure it is #define'd and that + the server is being run as root. The server will chroot to the + directory name provded by DPATH. + + f) ENABLE_SUMMON, ENABLE_USERS + + For security conscious server admins, they may wish to leave + ENABLE_USERS undefined, disabling the USERS command which can be used + to glean information the same as finger can. ENABLE_SUMMON toggles + whether the server will attempt to summon local users to irc by + writing a message similar to that from talk(1) to a user's tty. + + g) SHOW_INVISIBLE_LUSERS, NO_DEFAULT_INVISIBLE + + On large IRC networks, the number of invisible users is likely to + be large and reporting that number cause no pain. To aid and effect + this, SHOW_INVISIBLE_LUSERS is provided to cause the LUSERS command + to report the number of invisible users to all people and not just + operators. The NO_DEFAULT_INVISIBLE define is used to toggle whether + clients are automatically made invisible when they register. + + h) OPER_KILL, OPER_REHASH, OPER_RESTART, LOCAL_KILL_ONLY + + The three operator only commands, KILL, REHASH and RESTART, may all + be disabled to ensure that an operator who does not have the correct + privilidges does not have the power to cause untoward things to occur. + To further curb the actions of guest operators, LOCAL_KILL_ONLY can + be defined to only allow locally connected clients to be KILLed. + + i) The rest of the user changable #define's should be pretty much self + explanatory in the config.h file. It is *NOT* recommended that any + of the file undef the line with "STOP STOP" in it be changed. + +3) Configure and compile the code. + + Edit the root Makefile for the server, uncomment/comment the correct + CFLAGS/IRCDLIBS lines as appropriate for your system. + Change DESTDIR to be the same as the path for DPATH in config.h. + Type "make". This will compile the server, the client, and the services. + At the end of this step, the server directory will contain 'ircd', + and the client directory will contain 'irc'. To get the server installed, + type "make install" which will build a default m4 file for preprocessing, + copy example.conf and put the server all in DESTDIR. The irc client and + a copy of the server will also be placed in BINDIR and the modes set + accordingly. + +4) The ircd.conf file. + + After installing the ircd and irc programs, edit the irc.conf file + as per the instructions in this section and install it in the + location you specified in the config.h file. There is a sample + conf file called example.conf in the /doc directory. + + Appendix A describes the differences between IP addresses and host + names. If you are unfamiliar with this, you should probably scan + through it before proceeding. + + The irc.conf file contains various records that specify configuration + options. The record types are as follows: + + 1. Server connections (C,N) + 2. Machine information (M) + 3. Client connections (I) + 4. Default local server (U) + 5. Operator priviliges (O) + 6. Administrative info (A) + 7. Excluded accounts (K) + 8. Excluded machines (Q) + 9. Connection Classes (Y) + 10. Leaf connections (L) + 11. Service connections (S) + 12. Port connections (P) + 13. Hub connections (H) + + + 1. SERVER CONNECTIONS: How to connect to other servers + How other servers can connect to you + + WARNING: + The hostnames used as examples are really only examples and + not meant to be used (simply because they don't work) in real life. + + Now you must decide WHICH hosts you want to connect to and WHAT ORDER you + want to connect to them in. For my example let us assume I am on the + machine "rieska.oulu.fi" and I want to connect to irc daemons on 3 other + machines: + + "garfield.mit.edu" - Tertiary Connection + "irc.nada.kth.se" - Secondary Connection + "nic.funet.fi" - Primary Connection + + And I prefer to connect to them in that order, meaning I first want to + try connecting to "nic.funet.fi", then to "irc.nada.kth.edu", and + finally to "garfield.mit.edu". So if "nic.funet.fi" is down or + unreachable, the program will try to connect to "irc.nada.kth.se". + If irc.nada.kth.se is down it will try to connect to garfield and so forth. + PLEASE limit the number of hosts you will attempt to connect to down to 3. + This is because of two main reasons: + a) to save your server from causing extra load and delays + to users + b) to save internet from extra network traffic + (remember the old rwho program with traffic problems when + the number of machines increased). + + The format for the CONNECT entry in the "irc.conf" is: + + C:::: +Field: 1 2 3 4 5 + + for example: + + C:nic.funet.fi:passwd:nic.funet.fi:6667 + + - or - + + C:128.214.6.100:passwd:nic.funet.fi:6667 + + - or - + + C:root@nic.funet.fi:passwd:nic.funet.fi:6667 + + + Explanation: + + Each field is separated with a ":" charcter: + + Field 1: Field 1 tells the IRC program which option is being configured. + "C" corresponds to a server Connect option. + + Field 2: Specifies the host name or IP address of the machine to connect + to. If "user@" prefixes the actual hostname or IP address + the server will require that the remote username returned by + the ident server be the same as the one given before the "@". + + Field 3: The password of the other host. A password must always be + present for the line to be recognized. + + Field 4: The full hostname of the target machine. This is the name that + the TARGET server will identify itself with when you connect + to it. If you were connecting to nic.funet.fi you would receive + "nic.funet.fi" and that is what you should place in + this field. + + Field 5: The INTERNET Port that you want to connect to on the TARGET + machine. Most of the time this will be set to "6667". + If this field is left blank, then no connections will + be attempted to the TARGET host, and your host will accept + connections FROM the TARGET host instead. + + Some examples: + + C:nic.funet.fi::nic.funet.fi:6667 + + This reads: Connect to host "nic.funet.fi", with no password + and expect this server to identify itself to you as + "nic.funet.fi". Your machine will connect to this host to + PORT 6667. + + C:18.72.0.252:Jeff:garfield.mit.edu:6667 + + This reads: Connect to a host at address "18.72.0.252", using a + password of "Jeff". The TARGET server should identify + itself as "garfield.mit.edu". You will connect to Internet + Port 6667 on this host. + + C:irc.nada.kth.se::irc.nada.kth.se + + This reads: do not attempt to connect to "irc.nada.kth.se", + but if "irc.nada.kth.se" requests a connection, + allow it to connect. + + Now back to our original problem, we wanted OUR server CONNECT to 3 + hosts, "nic.funet.fi", "irc.nada.kth.se" and "garfield.mit.edu" in + that order. So as we enter these entries into the file they must be + done in REVERSE order of how we could want to connect to them. + + Here's how it would look if we connected "nic.funet.fi" first: + + C:garfield.mit.edu::garfield.mit.edu:6667 + C:irc.nada.kth.se::irc.nada.kth.se:6667 + C:nic.funet.fi::nic.funet.fi:6667 + + Ircd will attempt to connect to nic.funet.fi first, then to irc.nada + and finally to garfield. + + Reciprocal entries: + + Each "C" entry requires a corresponding 'N' entry that specifies + connection priviliges to other hosts. The 'N' entry contains + the password, if any, that you require other hosts to have before + they can connect to you. These entries are of the same format as + the "C" entries. + + Let us assume that "garfield.mit.edu" connects to your server + and you want to place password authorization authorization on garfield. + The "N" entry would be: + + N:garfield.mit.edu:golden:garfield.mit.edu + + This line says: expect a connection from host "garfield.mit.edu", + and expect a login password of "golden" + and expect the host to identify itself as "garfield.mit.edu". + + N:18.72.0.252::garfield.mit.edu + + This line says: expect a Connection from host "18.72.0.252", and + don't expect login password. The connecting host should identify itself + as "garfield.mit.edu". + + + Wildcards domains: + To reduce the great amount of servers in IRCnet wildcard + DOMAINS were introduced in 2.6. To explain the usage of + wildcard domains we take an example of such: + *.de - a domain name matching all machines + in Germany. + Wildcard domains are useful in that ALL SERVERS in Germany + (or any other domain area) can be shown as one to the + rest of the world. Imagine 100 servers in Germany, it + would be incredible waste of netwotk bandwidth to broadcast + all of them to all servers around the world. + + So wildcard domains are a great help, but how to use them ? + They can be defined in the N-line for a given connection, + in place of port number you write a magic number called + wildcard count. + + Wildcard count tells you HOW MANY PARTS of your server's name + should be replaced by a wildcard. For example, your server's + name is "tolsun.oulu.fi" and you want to represent it as + "*.oulu.fi" to "nic.funet.fi". In this case the wildcard count + is 1, because only one word (tolsun) is replaced by a wildcard. + If the wildcard count would be 2, then the wildcard domain would + be "*.fi". Note that with wildcard name "*.fi" you could NOT + connect to "nic.funet.fi", because that would result in a server + name COLLISION (*.fi matches nic.funet.fi). + + I advice you to not to use wildcard servers before you know + for sure how they are used, they are mostly beneficial for + backbones of countries and other large areas with common domain. + + + 2. MACHINE INFORMATION + + IRC needs to know a few things about your UNIX site, and the "M" command + specifies this information for IRC. The fomat of this command is: + + M::xxx:: + Field: 1 2 3 4 5 + + Explanation: + + Field 1: "M" specifies a Machine description line + + Field 2: The name of YOUR host adding any Internet DOMAINNAME that + might also be present. + + Field 3: -- NOT USED --: Set to Value NULL (No spaces at ALL!). + + Field 4: Geographic Location is used to say WHERE YOUR SEVRER is, + and gives people in other parts of the world a good + idea of where you are! If your server is in the USA, it is + usually best to say: , USA. Like for Denver + I say: "Denver Colorado, USA". Finnish sites (like + tolsun.oulu.fi generally say something like "Oulu, Finland". + + Field 5: The Internet port your server will use. Should be set to + the same value as in the config.h file. + + + Example: + M:tolsun.oulu.fi::Oulu, Finland:6667 + + This line reads: My Host's name is "tolsun.oulu.fi" and + my site is located in "Oulu, Finland". My ircd will use + Internet Port 6667. + + + M:orion.cair.du.edu::Denver Colorado, USA:6667 + + This line reads: My Hosts name is "orion.cair.du.edu" + and my site is located in "Denver Colorado, USA". + I have defined Internet Port number "6667" to be used + as my IRCD Socket Port. + + + 3. CLIENT CONNECTIONS - How to let clients connect to your IRCD. + + A client is a program that connects to the ircd daemon (ircd). Currently + there are clients written in C and in GNU Emacs Lisp. The "irc" + program is the C client. Each person that talks via IRC is running + their own client. + + The irc.conf files contains entries that specify which clients are allowed + to connect to your irc daemon. Obviously you want to allow your cwn + machine's clients to connect. You may want to allow clients from + other sites to connect. These remote clients will use your server + as a connection point. All messages sent by these clients will pass + through your machine. + + The format of this entry in the conf file is: + + I:::: + Field:1 2 3 4 5 + + + For example, if you were installing IRC on tolsun.oulu.fi and you wanted + to allow examples sake let us assume you were making this file for + tolsun and you wanted to let your own clients to connect to your + server, you would add this entry to the file: + + I:128.214.5.6::tolsun.oulu.fi + or + I:tolsun.oulu.fi::tolsun.oulu.fi + + If you wanted to let remote clients connect, you could add the + following lines: + + I:*.du.edu::*.du.edu + + Allow any clients from machines whose names end in "du.edu" to connect + with no password. + + I:128.214.6.100::nic.funet.fi + + Allow clients from a machine with that IP number and the name + nic.funet.fi to connect. + + I:*.tut.fi:secret:*.tut.fi + + Allow clients from machines matching *.tut.fi to connect + with the password 'secret'. + + I:*::* + + Allow anyone from anywhere to connect your server. + This is the easiest way, but it also allows people to for example + dump files to your server, or connect 1000 (or how many open + sockets per process your OS allows) clients to your machine + and take your network ports. Of course the same things can be + done by simply telnetting to your machine's SMTP port (for example). + + NEW!!! + As of the 2.7.2d version of the server, the server is able to accept + connections on multiple ports. I-lines are required for each P-line + to allow connections to be accepted. For unix sockets, this means + either adding I:/path/port::/path/port or some variation (wildcards + are recognised here). For internet ports, there must be an I-line + which allows the host access as normal, but the port field of the + I-line must match that of the port of the socket accepting the + connectiion. A port number of 0 is a wildcard (matches all ports). + + 4. DEFAULT HOSTS (for local clients) + + This defines the default connection for the irc client. If you are + running an ircd server on the same machine, you will want to define + this command to connect to your own host. If your site is not running + a server then this command should contain the TARGET host's connection + information and password (if any). The format for this command is: + + U:::: + Field: 1 2 3 4 5 + + + For example: + + U:tolsun.oulu.fi::tolsun.oulu.fi:6667 + U:128.214.5.6::tolsun.oulu.fi:6667 + U:tolsun.oulu.fi::tolsun.oulu.fi + + If the port number is omitted, irc will default to using 6667. + + 5. OPERATOR Privileges: How to become the IRC administrator on your site + + To become an IRC Administrator, IRC must know who is authorized to become + an operator and what their "Nickname" and "Password" is. To add this + information, EDIT your "irc.conf" file and add the following command + line to it: + + O::::: + Field: 1 2 3 4 5 6 + + Explanation: + + Field 1: Speficies Operator record. If you use capital letter ('O') + in it, it specifies a global operator. Small letter ('o') + specifies a local operator. Local operator has basically the + same rights except global operator with some restrictions. + + Field 2: Tells IRC which host you have the privileges FROM. This + means that you should be logged into this host when you + ask for the priviliges. If you specify "tolsun.oulu.fi" + then IRC will expect your CLIENT to be connected at + "tolsun.oulu.fi" - when you ask for OPERATOR privileges + from "tolsun.oulu.fi". You cannot be logged in at any + other host and be able to use your OPERATOR privileges + at tolsun, only when you are connected at TOLSUN will this + work - this is a safeguard against unauthorized sites. + + + Field 3: If your AUTHORIZATION Password - this is the password that + let's IRC know you are who you say you are! Never tell anyone + your password and always keep the "irc.conf" file protected + from all of the other users. + + Field 4: The Nickname you usually go by - but you can make this what + you want. It is better to make this a NICKNAME that no one + else knows, but anything will do. I usually use my own + loginname. + + Field 5: Unused. + + Field 6: The class field should refer to an existing class (preferably + having a lower number than that for the relevant I-line) and + determines the maximum number of simultaneous uses of the + O-line allowable through the max. links field in the Y-line. + + Example: + O:orion.cair.du.edu:pyunxc:Jeff + + There is an OPERATOR at "orion.cair.du.edu" that can get + Operator priviliges if he specifies a password of "pyunxc" + and uses a NICKNAME of "Jeff". + + + + 6. ADMINISTRATIVE INFORMATION + + The "A" command is used for administrative information about a site. + The e-mail address of the person running the server should be included + here in case problems arise. + + + A::: + Field: 1 2 3 4 + + Explanation: + + Field 1: "A" specifies an Admin record. + + + Field 2: Use this field to say tell your FULL NAME and where in the + world your machine is. Be sure to add your City, + State/Province and Country. + + + Field 3: Use this field to specify your Electronic Mailing Address + preferably your Internet Mailing Address. If you have + a UUCP or ARAPnet address - please add that as well. Be + sure to add any extra DOMAIN information that is needed, + for example "mail jtrim@orion" probably won't work as a + mail address to me if you happen to be in Alaska. But + "mail jtrim@orion.cair.du.edu" would work because you + know that "orion" is part of the DOMAIN "cair.du.edu". + So be sure to add your DOMAINNAMES to your mailing addresses. + + Field 4: Is really an OTHER field - you can add what you want here, + + + Examples (the line is just one line in the confuration file, here it + is cut into two lines to make it clearer to read): + +A:Jeff Trim - Denver Colorado, USA:INET jtrim@orion.cair.du.edu UUCP {hao, +isis}!udenva!jtrim:Terve! Heippa! Have you said hello in Finnish today?;) + + Would look like this when printed out with the /admin command: + + Jeff Trim - Denver Colorado, USA + INET jtrim@orion.cair.du.edu UUCP {hao,isis}!udenva!jtrim + Terve! Hei! Heippa! Have you said hello in Finnish today? ;) + + + Note that the A record cannot be split across multiple lines; it will + typically be longer than 80 characters and will therefore wrap around + the screen. + + + 7. REMOVING A USER FROM IRC Remove an errant user from IRC on your site. + + Obviously it is hoped that you wouldn't have to use this command. + Unfortunately sometimes a user can become unmanageable and this is your + only recourse - the KILL USER command. THIS COMMAND ONLY AFFECTS YOUR + SERVER - If this user can connect to another SERVER somewhere else in + the IRC-Network then you would have to talk to the administrator on that + site to disable his access from that IRCD Server as well. + + The format of this command is: + + K::