--- eggdrop-1.6.19.orig/configure +++ eggdrop-1.6.19/configure @@ -10034,7 +10034,6 @@ fi - if test "$egg_cv_var_tcl_threaded" = "yes"; then if test "$enable_tcl_threads" = "no"; then cat << 'EOF' >&2 @@ -10056,7 +10055,6 @@ if test ! "${ac_cv_lib_pthread-x}" = "x"; then LIBS="$ac_cv_lib_pthread $LIBS" fi - fi if test "$EGG_CYGWIN" = "yes"; then --- eggdrop-1.6.19.orig/debian/eggdrop-data.examples +++ eggdrop-1.6.19/debian/eggdrop-data.examples @@ -0,0 +1 @@ +eggdrop.conf --- eggdrop-1.6.19.orig/debian/eggdrop-data.docs +++ eggdrop-1.6.19/debian/eggdrop-data.docs @@ -0,0 +1,21 @@ +NEWS +README +doc/ABOUT +doc/AUTHORS +doc/BANS +doc/BOTNET +doc/BUG-REPORT +doc/CONTENTS +doc/FIRST-SCRIPT +doc/html +doc/KNOWN-PROBLEMS +doc/MODULES +doc/PARTYLINE +doc/PATCH-HOWTO +doc/settings +doc/tcl-commands.doc +doc/TEXT-SUBSTITUTIONS +doc/TRICKS +doc/UPDATES1.6 +doc/USERS +doc/WEIRD-MESSAGES --- eggdrop-1.6.19.orig/debian/eggdrop-data.install +++ eggdrop-1.6.19/debian/eggdrop-data.install @@ -0,0 +1,4 @@ +debian/tmp/usr/help/* usr/share/eggdrop/help/ +debian/tmp/usr/language/* usr/share/eggdrop/language/ +debian/tmp/usr/scripts/* usr/share/eggdrop/scripts/ +debian/tmp/usr/text/* usr/share/eggdrop/text/ --- eggdrop-1.6.19.orig/debian/watch +++ eggdrop-1.6.19/debian/watch @@ -0,0 +1,3 @@ +version=2 +ftp://ftp.eggheads.org/pub/eggdrop/source/1.6/eggdrop(.*)\.tar\.gz debian uupdate + --- eggdrop-1.6.19.orig/debian/control +++ eggdrop-1.6.19/debian/control @@ -0,0 +1,34 @@ +Source: eggdrop +Section: net +Priority: extra +Maintainer: Ubuntu MOTU Developers +XSBC-Original-Maintainer: Guilherme de S. Pastore +Build-Depends: tcl8.5-dev, libz-dev, debhelper (>> 4.1.0), cdbs, libssl-dev +Standards-Version: 3.7.3 +Homepage: http://www.eggheads.org/ + +Package: eggdrop +Architecture: any +Depends: ${shlibs:Depends}, eggdrop-data (= ${source:Version}) +Description: Advanced IRC Robot + Eggdrop is an IRC bot written in C, which sits on channels and takes + protective measures, such as preventing it from being taken over (in + the few ways that anything can), recognizing banned users to reject + them, recognizing privileged users to give them operator status, + punishing users for things like flooding, among innumerable others. + . + All of this is completely configurable, and can be disabled or enabled + as you wish in the configuration file. Also, it's very easy to expand + and customize with Tcl scripts and C modules, making it possible to + adapt Eggdrop to any special need you might have. + +Package: eggdrop-data +Architecture: all +Replaces: eggdrop (>= 1.6.16-2) +Description: Architecture independent files for eggdrop + This package contains all the files that eggdrop places on /usr/share. + These files are not specific to a single processor architecture once + the package is built, so a single package can serve all the archs + Debian supports. + . + This package is not useful at all if eggdrop is not installed. --- eggdrop-1.6.19.orig/debian/copyright +++ eggdrop-1.6.19/debian/copyright @@ -0,0 +1,34 @@ +This package was debianized by Guilherme de S. Pastore on +Fri, 19 Mar 2004 10:11:20 -0300 + +It was downloaded from ftp://ftp.eggheads.org/pub/eggdrop/source/ + +Upstream Author: EggHeads Development Team + +Copyright: + +Copyright (C) 1997 Robey Pointer +Copyright (C) 1999 - 2008 Eggheads Development Team + +src/rfc1459.c: + * Copyright (C) 1990 Jarkko Oikarinen + + +License: + + This program is free software, which means you can redistribute it + and/or modify it under the terms of the GNU General Public License + (GPL) as published by the Free Software Foundation; either version + 2 of the License, 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 + (GPL) along with this program. If not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + + On Debian systems, the complete text of the GNU General Public + License can be found in /usr/share/common-licenses/GPL file. --- eggdrop-1.6.19.orig/debian/README.Debian +++ eggdrop-1.6.19/debian/README.Debian @@ -0,0 +1,23 @@ +eggdrop for Debian +---------------------- + +Quick start: + +1. Create an account for the bot (not strictly necessary, + but recommended). +2. Copy /usr/share/doc/eggdrop-data/examples/eggdrop.conf.gz + to the bot's directory +3. Uncompress and edit the configuration file completely +4. Make the file executable (chmod +x eggdrop.conf) and + run it with -m ('./eggdrop.conf -m') +3. Follow the instructions for identifying yourself as + the bot owner +4. Remember not to use -m next time you run eggdrop + +When converting old eggdrop.conf files, make sure you specify an absolute path +to any scripts or help files it needs to load. You may symlink the scripts and +help directories in the bot's home directory as an alternative, if you wish. + +Eggdrop shouldn't (and won't) ever be run as super-user (root). + + -- Guilherme de S. Pastore , Thu Jun 17 09:29:43 2004 --- eggdrop-1.6.19.orig/debian/eggdrop.install +++ eggdrop-1.6.19/debian/eggdrop.install @@ -0,0 +1,2 @@ +debian/tmp/usr/eggdrop-1.6.19 usr/bin +debian/tmp/usr/modules-1.6.19/* usr/lib/eggdrop/modules/ --- eggdrop-1.6.19.orig/debian/eggdrop.links +++ eggdrop-1.6.19/debian/eggdrop.links @@ -0,0 +1 @@ +usr/share/doc/eggdrop-data usr/share/doc/eggdrop/upstream --- eggdrop-1.6.19.orig/debian/compat +++ eggdrop-1.6.19/debian/compat @@ -0,0 +1 @@ +4 --- eggdrop-1.6.19.orig/debian/changelog +++ eggdrop-1.6.19/debian/changelog @@ -0,0 +1,470 @@ +eggdrop (1.6.19-1.2ubuntu3.1) precise-proposed; urgency=low + + [ Vibhav Pant ] + * debian/patches/01tcl8.5.10.patch (LP: #885329) + - Fixes startup crash caused by unexpected behaviour in Tcl 8.5.10 + + [ Julian Taylor ] + * fix a bug in gcc-format-string-warnings.patch + patch wrongly replaced "..%d" with "%s" + + -- Julian Taylor Sun, 20 May 2012 20:10:09 +0200 + +eggdrop (1.6.19-1.2ubuntu3) precise; urgency=low + + * Add gcc-format-string-warnings.patch. Fixes FTBFS. + + -- Daniel T Chen Thu, 26 Jan 2012 22:17:51 -0500 + +eggdrop (1.6.19-1.2ubuntu2) oneiric; urgency=low + + * No change rebuild for libssl1.0.0 transition. + + -- Angel Abad Sun, 22 May 2011 16:28:55 +0200 + +eggdrop (1.6.19-1.2ubuntu1) karmic; urgency=low + + * Merge from debian unstable, remaining changes: + - debian/{rules,control}, debian/patches/eggdrop-1.6.19-ssl.patch: + Add code and build-dep support for SSL connections. + + -- Kees Cook Sat, 16 May 2009 09:15:25 -0700 + +eggdrop (1.6.19-1.2) unstable; urgency=high + + * Non-maintainer upload by the Security Team. + * Apply upstream patch to fix incomplete patch for CVE-2007-2807, + buffer can still overflow in case of strlen(ctcpbuf) returning + zero (Closes: #427157). + + -- Nico Golde Fri, 15 May 2009 13:43:17 +0200 + +eggdrop (1.6.19-1.1ubuntu1) intrepid; urgency=low + + * Merge from Debian unstable (LP: #272382). Remaining Ubuntu changes: + - debian/patches/eggdrop-1.6.19-ssl.patch. + - debian/rules: Added check for SSL. + - debian/control: Added libssl-dev. + + -- Luca Falavigna Sat, 04 Oct 2008 12:02:58 +0200 + +eggdrop (1.6.19-1.1) unstable; urgency=low + + * Non-maintainer upload. + * Use patch from Julian Mehnle to enforce building + egggrop with Tcl thread support. Thanks for the patch. (Closes: #487541) + + -- Marc 'HE' Brockschmidt Sat, 06 Sep 2008 21:19:08 +0200 + +eggdrop (1.6.19-1ubuntu1) intrepid; urgency=low + + * Merge from debian unstable (LP: #236620), remaining changes: + - debian/rules: Added check for SSL. + - debian/control: Added libssl-dev, updated Maintainer field + * Update SSL patch + - Droped debian/patches/eggdrop-1.6.18-ssl.patch + - Added debian/patches/eggdrop-1.6.19-ssl.patch + (http://www.egghelp.org/files/patches/eggdrop-1.6.19-ssl-rootie.patch.gz) + + -- Andres Rodriguez Mon, 18 Aug 2008 00:26:01 -0500 + +eggdrop (1.6.19-1) unstable; urgency=low + + * New upstream release. + + * debian/control: + - bumped Standards-Version to 3.7.3; + - made "Homepage" a field in the source stanza; + - changed the capitalization of "Tcl" in the package description to make + lintian happy; + - bumped build-dependency on Tcl to 8.5, as per upstream recommendation + (Closes: #473035). + + * debian/copyright: + - added appropriate copyright notices. + + * debian/patches: + - 01version.patch: added; show the correct version number; + - 01_CVE-2007-2807_srvmsg.patch: applied upstream, dropped. + + -- Guilherme de S. Pastore Fri, 30 May 2008 16:20:00 -0300 + +eggdrop (1.6.18-1.1ubuntu1) gutsy; urgency=low + + * Merge from Debian unstable (LP: #132222). Remaining Ubuntu changes: + - Added SSL patch from + http://www.egghelp.org/files/patches/eggdrop-1.6.18-ssl.patch.gz + debian/rules: Added check for SSL. + debian/control: Added libssl-dev, updated Maintainer field + + -- Cesare Tirabassi Mon, 13 Aug 2007 17:34:10 +0200 + +eggdrop (1.6.18-1.1) unstable; urgency=high + + * Non-maintainer upload by secure testing team. + * Fix for CVE-2007-2807 (01_CVE-2007-2807_srvmsg.patch) (Closes: #427157). + + -- Nico Golde Sun, 12 Aug 2007 16:42:31 +0200 + +eggdrop (1.6.18-1ubuntu1) gutsy; urgency=low + + * Added SSL patch from + http://www.egghelp.org/files/patches/eggdrop-1.6.18-ssl.patch.gz + - debian/rules: Added check for SSL. + - debian/control: Added libssl-dev, updated Maintainer field + + -- Kees Cook Wed, 02 May 2007 11:59:09 -0700 + +eggdrop (1.6.18-1) unstable; urgency=low + + * New upstream release (Closes: #369678). + - debian/patches/00conf_paths.patch: updated. + + * debian/control: + - updated maintainer address. + - replace ${Source-Version} with ${source:Version}. Yay binNMUs! + + * debian/copyright: updated FSF's address. + + -- Guilherme de S. Pastore Fri, 1 Sep 2006 18:21:45 -0300 + +eggdrop (1.6.17-3) unstable; urgency=medium + + * Rewrote long description + * 00conf_paths.patch: + - Change file paths in example configuration file + Thanks to Gustavo Noronha Silva + * Fixed mistake in README.Debian, once again due to the split up + Thanks to Martin Braure de Calignon (Closes: #273933) + + -- Guilherme de S. Pastore Tue, 19 Oct 2004 01:57:51 -0200 + +eggdrop (1.6.17-2) unstable; urgency=high + + * Added versioned Replaces: for eggdrop (>= 1.6.16-2). In other words, + for versions earlier to the split up, in order to allow smooth + upgrades (Closes: #271079) + + -- Guilherme de S. Pastore Sun, 12 Sep 2004 10:04:02 -0300 + +eggdrop (1.6.17-1) unstable; urgency=low + + * New upstream release + - debian/patches/eggdrop.1.diff incorporated upstream, removed. + + -- Guilherme de S. Pastore Wed, 25 Aug 2004 10:32:26 -0300 + +eggdrop (1.6.16-5) unstable; urgency=low + + * debian/control: + - Updated to Standards-Version 3.6.1.1 + * debian/copyright: + - Fixed lots of crazy alignment problems + * debian/rules: + - Included simple-patchsys.mk from CDBS + * debian/patches/eggdrop.1.diff: + - Fix error in manpage that prevented a line from being shown + + -- Guilherme de S. Pastore Tue, 27 Jul 2004 11:41:53 -0300 + +eggdrop (1.6.16-4) unstable; urgency=low + + * Fixed location of some files after split up + * Fixed debian/rules so build doesn't fail if -B is passed + to dpkg-buildpackage (Closes: #258418) + + -- Guilherme de S. Pastore Fri, 9 Jul 2004 10:55:48 -0300 + +eggdrop (1.6.16-3) unstable; urgency=low + + * Added Homepage to eggdrop's description + * Split eggdrop into eggdrop and eggdrop-data + * Changed paths on example configuration files + + -- Guilherme de S. Pastore Fri, 18 Jun 2004 09:30:35 -0300 + +eggdrop (1.6.16-2) unstable; urgency=high + + * Fixed typo on README.Debian + * Fixed hyphens in manual page + * Converted debian/rules to CDBS + * Set path to binary on example config file + * Changed LANGDIR on src/eggdrop.h (Closes: #254824) + + -- Guilherme de S. Pastore Thu, 17 Jun 2004 09:15:28 -0300 + +eggdrop (1.6.16-1) unstable; urgency=low + + * New upstream release + * Cleaned up debian/rules and debian/watch + * Compiled with HANDLEN 9 again (Closes: #241285) + + -- Guilherme de S. Pastore Thu, 3 Jun 2004 11:25:44 -0300 + +eggdrop (1.6.15-2) unstable; urgency=high + + * Applied official patch to fix share.mod security bug + + -- Guilherme de S. Pastore Fri, 16 Apr 2004 17:23:37 -0300 + +eggdrop (1.6.15-1) unstable; urgency=low + + * New maintainer + * Acknowledge NMU (Closes: #173371, #202199) + * debian/rules + - No longer exports DH_COMPAT (new policy) + - Changed destination of files (new policy) + - Cleaned up (unnecessary things ripped out) + - Changed binary filename from eggdrop-1.6.15 to eggdrop + - Now moves the files eggdrop's makefile misplaces to the correct + location (no more makefile patches) + * debian/copyright + - Extended copyright (GPL) information + - Updated "Upstream Authors" field, as requested by EggHeads + * debian/control + - Changed package's long description + - Updated Standards-Version to 3.6.1 + - Specified version of build dependency on debhelper + * Compiled eggdrop with HANDLEN 30 (Closes: #213704) + * Removed unused patches + * Updated README.Debian file + * Removed empty directory doc/html/chat + * Upstream changelog is now included in the package + + -- Guilherme de S. Pastore Fri, 19 Mar 2004 10:11:20 -0300 + +eggdrop (1.6.15-0.1) unstable; urgency=medium + + * NMU by Elrond , checked and uploaded + by Joshua Kwan + + * okayed by maintainer, see Bug#173371 + * New upstream release (Closes: #173371, #202199) + + many security related fixes. + + eggdrop.{simple,advanced,complete}.conf replaced by + one eggdrop.conf. + * Move eggdrop.conf.gz into doc/eggdrop/examples/. + Change README.Debian accordingly. + * Drop the whole Makefile patchery and move installed + files in debian/rules:install around. + Fixes: motd and banner should be in /usr/share/eggdrop/text/. (Even + configs from older versions expected those files there.) + * Move (unused) egp.patch into debian/patches/. + * Small other fixes. + * Bump Standards-Version to 3.5.6.0. + more complicated changes are warranted to bump the standards-version + any higher, hence they're not included in NMU + + -- Joshua Kwan Sat, 28 Feb 2004 22:49:28 -0800 + +eggdrop (1.6.10-1) unstable; urgency=low + + * New upstream release (Closes: #142075) + + -- Ian Eure Tue, 16 Apr 2002 13:51:01 -0700 + +eggdrop (1.6.8-2) unstable; urgency=low + + * Don't use utf8 conversion routines, our tcl doesn't have + them. (Closes: #131342) + + -- Ian Eure Mon, 28 Jan 2002 17:00:03 -0800 + +eggdrop (1.6.8-1) unstable; urgency=low + + * New upstream release + * Apply patch from CVS to fix SIGBUS crashes on sparcs. (Closes: #103635) + * Fix speeling error in description. (Closes: #124595) + + -- Ian Eure Mon, 28 Jan 2002 09:55:35 -0800 + +eggdrop (1.6.6-3) unstable; urgency=low + + * don't force use of gcc 3.0, just use the default. + + -- Ian Eure Sat, 15 Dec 2001 15:00:41 -0800 + +eggdrop (1.6.6-2) unstable; urgency=low + + * compile eggdrop with gcc 3.0; 2.95.x seems to have problems on + sparc. (closes: #103635) + + -- Ian Eure Wed, 12 Dec 2001 16:34:56 -0800 + +eggdrop (1.6.6-1) unstable; urgency=low + + * new upstream release + * removed ugly hack from 1.6.4-1 in src/mod/dns.mod/configure.in to get + libresolv linked in, since it seems to work once more. strange. + + -- Ian Eure Mon, 6 Aug 2001 20:25:35 -0700 + +eggdrop (1.6.4-2) unstable; urgency=low + + * applied patch to fix crash with unicode channel names. (closes: #99638) + + -- Ian Eure Sun, 1 Jul 2001 03:50:14 -0700 + +eggdrop (1.6.4-1) unstable; urgency=low + + * New upstream release + * remove broken test for res_init, since it's part of glibc. (closes: #94330) + + -- Ian Eure Sun, 29 Apr 2001 22:24:05 -0700 + +eggdrop (1.6.3-1) unstable; urgency=low + + * New upstream release + * removed dh_suidregister from debian/rules + * `INSTALL' isn't installed with the rest of the upstream docs. + + -- Ian Eure Fri, 9 Mar 2001 16:39:14 -0800 + +eggdrop (1.6.2-2) unstable; urgency=low + + * compiled against tcl8.3. (closes: #81082) + * fixed broken build. + + -- Ian Eure Wed, 14 Feb 2001 10:30:42 -0800 + +eggdrop (1.6.2-1) unstable; urgency=low + + * New upstream release + + -- Ian Eure Tue, 6 Feb 2001 13:38:42 -0800 + +eggdrop (1.6.1-4) unstable; urgency=low + + * fixed botscript path in botchk & autobotchk (closes: #79160) + * fixed misleading error messages in autobotchk (closes: #79161) + + -- Ian Eure Sun, 17 Dec 2000 22:07:44 -0800 + +eggdrop (1.6.1-3) unstable; urgency=low + + * added debhelper to Build-Depends. (closes: #78747) + * updated source url in copyright + + -- Ian Eure Mon, 4 Dec 2000 09:09:09 -0800 + +eggdrop (1.6.1-2) unstable; urgency=low + + * removed versions from Build-Depends, since tcl-dev and libz-dev + are Provide:'d. (closes: #78095) + + -- Ian Eure Mon, 27 Nov 2000 11:39:49 -0800 + +eggdrop (1.6.1-1) unstable; urgency=low + + * New upstream release + * fixed another typo in README.Debian + + -- Ian Eure Sat, 25 Nov 2000 12:23:06 -0800 + +eggdrop (1.6.0-2) unstable; urgency=low + + * fixed README.Debian to point to the correct eggdrop.simple.conf. + (closes: #77919) + * autobotchk looks for /usr/share/eggdrop/help & /usr/bin/eggdrop + instead of $dir/help & $dir/eggdrop. (closes: #77931) + + -- Ian Eure Fri, 24 Nov 2000 19:42:36 -0800 + +eggdrop (1.6.0-1) unstable; urgency=low + + * new upstream version. (closes: #57452) + * added Build-Depends (closes: #70292) + * new maintainer (closes: #76182, #75075, #68067) + * FHS compliance; binary modules are in /usr/lib/eggdrop/modules, + machine-independent data is in /usr/share/eggdrop + + -- Ian Eure Fri, 17 Nov 2000 11:43:49 -0800 + +eggdrop (1.3.28-2) unstable; urgency=low + + * Erm, let's try that again .. should actually work this time. + (Closes: #47779). + * Remove *.rej and *.orig files on clean + * Don't use /usr/doc /and/ /usr/share/doc. (closes: #46562) + + -- Edward Brocklesby Fri, 22 Oct 1999 19:24:11 +0100 + +eggdrop (1.3.28-1) unstable; urgency=low + + * New Upstream Version. + + -- Edward Brocklesby Mon, 27 Sep 1999 18:38:06 +0100 + +eggdrop (1.3.23-2) unstable; urgency=low + + * Eggdrop binary is executable again, closes: #31694, #31781. + * Improved lintianability. + + -- Johnie Ingram Mon, 1 Feb 1999 09:20:43 -0500 + +eggdrop (1.3.23-1) unstable; urgency=low + + * New upstream version. + + -- Johnie Ingram Mon, 4 Jan 1999 02:15:42 -0500 + +eggdrop (1.3.22-1) unstable; urgency=low + + * New upstream version. + * Added patches from Darren (#22930) to eggdrop.conf, which is now a + conffile (#22951). + + -- Johnie Ingram Sat, 14 Nov 1998 19:35:11 -0500 + +eggdrop (1.3.19-2) frozen unstable; urgency=low + + * Linked with the tcl8 which uses libncurses4. + + -- Johnie Ingram Sat, 14 Nov 1998 19:14:35 -0500 + +eggdrop (1.3.19-1) unstable; urgency=low + + * New upstream version. + * Fixed lintian errors. + * Corrected address of FSF in copyright file. + + -- Johnie Ingram Sun, 30 Aug 1998 01:47:39 -0400 + +eggdrop (1.3.18-1) unstable; urgency=low + + * New upstream version. + + -- Johnie Ingram Mon, 20 Jul 1998 13:50:37 -0400 + +eggdrop (1.3.14-2) unstable; urgency=low + + * New upstream version. + + -- Johnie Ingram Thu, 21 May 1998 14:06:10 -0400 + +eggdrop (1.3.13-1) unstable; urgency=low + + * New upstream version. + * Converted from debmake to debhelper packaging technology. + * Updated to Standards-Version 2.4.1.0. + + -- Johnie Ingram Sun, 19 Apr 1998 20:38:55 -0400 + +eggdrop (1.3.0-1) unstable; urgency=low + + * New upstream version (almost released it, but didn't). + + -- Johnie Ingram Wed, 12 Nov 1997 22:55:23 -0500 + +eggdrop (1.2.0-0) local; urgency=low + + * New upstream version (pristine source). + + -- Johnie Ingram Thu, 11 Sep 1997 12:47:44 -0400 + +eggdrop (1.1.5-1) local; urgency=low + + * New package (never uploaded). + + -- Johnie Ingram Wed, 9 Jul 1997 00:29:18 -0400 + --- eggdrop-1.6.19.orig/debian/rules +++ eggdrop-1.6.19/debian/rules @@ -0,0 +1,18 @@ +#!/usr/bin/make -f +# -*- mode: makefile; coding: utf-8 -*- + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/autotools.mk +include /usr/share/cdbs/1/rules/simple-patchsys.mk + +DEB_CONFIGURE_EXTRA_FLAGS := --enable-tcl-threads +DEB_CONFIGURE_SCRIPT_ENV := +DEB_INSTALL_MANPAGES_eggdrop-data := doc/man1/eggdrop.1 +DEB_MAKE_INSTALL_TARGET := install prefix=$(DEB_DESTDIR)/usr +DEB_CONFIGURE_USER_FLAGS := --with-ssl + +configure/eggdrop:: + $(MAKE) config + +binary-post-install/eggdrop:: + cd debian/eggdrop/usr/bin && mv eggdrop-1.6.19 eggdrop --- eggdrop-1.6.19.orig/debian/patches/00conf_paths.patch +++ eggdrop-1.6.19/debian/patches/00conf_paths.patch @@ -0,0 +1,64 @@ +--- eggdrop.conf~ 2005-08-29 00:51:36.000000000 -0300 ++++ eggdrop.conf 2006-09-01 18:20:22.123109750 -0300 +@@ -1,4 +1,4 @@ +-#! /path/to/executable/eggdrop ++#!/usr/bin/eggdrop + # ^- This should contain a fully qualified path to your Eggdrop executable. + # + # $Id: eggdrop.conf,v 1.47 2005-08-29 03:51:36 wcc Exp $ +@@ -185,22 +185,22 @@ + + # Specify here where Eggdrop should look for help files. Don't modify this + # setting unless you know what you're doing! +-set help-path "help/" ++set help-path "/usr/share/eggdrop/help/" + + # Specify here where Eggdrop should look for text files. This is used for + # certain Tcl and DCC commands. +-set text-path "text/" ++set text-path "/usr/share/eggdrop/text/" + + # Set here a place to store temporary files. + set temp-path "/tmp" + + # The MOTD (Message Of The day) is displayed when people dcc chat or telnet + # to the bot. Look at doc/TEXT-SUBSTITUTIONS for options. +-set motd "text/motd" ++set motd "/usr/share/eggdrop/text/motd" + + # This banner will be displayed on telnet connections. Look at + # doc/TEXT-SUBSTITUTIONS for options. +-set telnet-banner "text/banner" ++set telnet-banner "/usr/share/eggdrop/text/banner" + + # This specifies what permissions the user, channel, and notes files should + # be set to. The octal values are the same as for the chmod system command. +@@ -419,7 +419,7 @@ + # If you run the bot from the compilation directory, you will want to set + # this to "". If you use 'make install' (like all good kiddies do ;), this + # is a fine default. Otherwise, use your head :) +-set mod-path "modules/" ++set mod-path "/usr/lib/eggdrop/modules/" + + + #### DNS MODULE #### +@@ -1336,15 +1336,15 @@ + # + # source scripts/script.tcl + +-source scripts/alltools.tcl +-source scripts/action.fix.tcl ++source /usr/share/eggdrop/scripts/alltools.tcl ++source /usr/share/eggdrop/scripts/action.fix.tcl + + # Use this script for Tcl and Eggdrop backwards compatibility. + # NOTE: This can also cause problems with some newer scripts. +-#source scripts/compat.tcl ++#source /usr/share/eggdrop/scripts/compat.tcl + + # This script provides many useful informational functions, like setting + # users' URLs, e-mail address, ICQ numbers, etc. You can modify it to add + # extra entries. +-source scripts/userinfo.tcl ++source /usr/share/eggdrop/scripts/userinfo.tcl + loadhelp userinfo.help --- eggdrop-1.6.19.orig/debian/patches/gcc-format-string-warnings.patch +++ eggdrop-1.6.19/debian/patches/gcc-format-string-warnings.patch @@ -0,0 +1,44 @@ +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19/src/main.c eggdrop-1.6.19.new/src/main.c +--- eggdrop-1.6.19/src/main.c 2012-01-26 22:24:54.000000000 -0500 ++++ eggdrop-1.6.19.new/src/main.c 2012-01-26 22:24:55.000000000 -0500 +@@ -498,7 +498,7 @@ + break; /* this should never be reached */ + case 'h': + printf("\n%s\n\n", version); +- printf(EGG_USAGE); ++ printf("%s", EGG_USAGE); + printf("\n"); + bg_send_quit(BG_ABORT); + exit(0); +@@ -819,7 +819,7 @@ + putlog(LOG_ALL, "*", "--- Loading %s (%s)", ver, s); + chanprog(); + if (!encrypt_pass) { +- printf(MOD_NOCRYPT); ++ printf("%s", MOD_NOCRYPT); + bg_send_quit(BG_ABORT); + exit(1); + } +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19/src/mod/transfer.mod/transfer.c eggdrop-1.6.19.new/src/mod/transfer.mod/transfer.c +--- eggdrop-1.6.19/src/mod/transfer.mod/transfer.c 2008-02-16 16:41:11.000000000 -0500 ++++ eggdrop-1.6.19.new/src/mod/transfer.mod/transfer.c 2012-01-26 22:25:39.000000000 -0500 +@@ -777,7 +777,7 @@ + + static void display_dcc_fork_send(int idx, char *buf) + { +- sprintf(buf, TRANSFER_CONN_SEND); ++ sprintf(buf, "%s", TRANSFER_CONN_SEND); + } + + static int expmem_dcc_xfer(void *x) +--- a/src/misc.c ++++ b/src/misc.c +@@ -601,7 +601,7 @@ + * then reset repeats. We want the current time here, + * so put that in the file first. + */ +- fprintf(logs[i].f, stamp); ++ fprintf(logs[i].f, "%s", stamp); + fprintf(logs[i].f, MISC_LOGREPEAT, logs[i].repeats); + logs[i].repeats = 0; + /* No need to reset logs[i].szlast here --- eggdrop-1.6.19.orig/debian/patches/02_incompCVE-2007-2807.patch +++ eggdrop-1.6.19/debian/patches/02_incompCVE-2007-2807.patch @@ -0,0 +1,12 @@ +diff -Nurad eggdrop-1.6.19.orig/src/mod/server.mod/servmsg.c eggdrop-1.6.19/src/mod/server.mod/servmsg.c +--- eggdrop-1.6.19.orig/src/mod/server.mod/servmsg.c 2009-05-15 13:47:19.000000000 +0200 ++++ eggdrop-1.6.19/src/mod/server.mod/servmsg.c 2009-05-15 13:47:50.000000000 +0200 +@@ -490,7 +490,7 @@ + ctcp = ctcpbuf; + /* copy the part after the second : in front of it after + * the first :, this is temporary copied to ctcpbuf */ +- strncpy(p1 - 1, p + 1, strlen(ctcpbuf) - 1); ++ memmove(p1 - 1, p + 1, strlen(p + 1) + 1); + + if (!ignoring) + detect_flood(nick, uhost, from, --- eggdrop-1.6.19.orig/debian/patches/01version.patch +++ eggdrop-1.6.19/debian/patches/01version.patch @@ -0,0 +1,11 @@ +--- src/main.c 2008-02-16 19:41:03.000000000 -0200 ++++ src/main.c.new 2008-05-30 16:39:19.000000000 -0300 +@@ -91,7 +91,7 @@ + */ + + char egg_version[1024] = "1.6.19"; +-int egg_numver = 1061800; ++int egg_numver = 1061900; + + char notify_new[121] = ""; /* Person to send a note to for new users */ + int default_flags = 0; /* Default user flags */ --- eggdrop-1.6.19.orig/debian/patches/01tcl8.5.10.patch +++ eggdrop-1.6.19/debian/patches/01tcl8.5.10.patch @@ -0,0 +1,24 @@ +Description: fix incompatibilty with tcl + fixes startup crash on i386 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/eggdrop/+bug/885329 +Applied-Upstream: 1.6.21 +--- eggdrop1.6.20/src/tclhash.c 2011/02/08 22:06:01 1.3.2.3 ++++ eggdrop1.6.20/src/tclhash.c 2012/20/05 23:20:10 1.3.2.4 +@@ -1316,7 +1316,7 @@ + for (i = 0; cc[i].name; i++) { + egg_snprintf(p, sizeof p, "*%s:%s", tl->name, + cc[i].funcname ? cc[i].funcname : cc[i].name); +- l = nmalloc(Tcl_ScanElement(p, &k)); ++ l = nmalloc(Tcl_ScanElement(p, &k) + 1); + Tcl_ConvertElement(p, l, k | TCL_DONT_USE_BRACES); + table[0].cdata = (void *) cc[i].func; + add_cd_tcl_cmds(table); +@@ -1334,7 +1334,7 @@ + for (i = 0; cc[i].name; i++) { + egg_snprintf(p, sizeof p, "*%s:%s", table->name, + cc[i].funcname ? cc[i].funcname : cc[i].name); +- l = nmalloc(Tcl_ScanElement(p, &k)); ++ l = nmalloc(Tcl_ScanElement(p, &k) + 1); + Tcl_ConvertElement(p, l, k | TCL_DONT_USE_BRACES); + Tcl_DeleteCommand(interp, p); + unbind_bind_entry(table, cc[i].flags, cc[i].name, l); --- eggdrop-1.6.19.orig/debian/patches/eggdrop-1.6.19-ssl.patch +++ eggdrop-1.6.19/debian/patches/eggdrop-1.6.19-ssl.patch @@ -0,0 +1,1242 @@ +Description: provide SSL support for connections. +Patch: http://www.egghelp.org/files/patches/eggdrop-1.6.19-ssl-rootie.patch.gz + +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19-1ubuntu1/aclocal.m4 eggdrop-1.6.19-1ubuntu1.new/aclocal.m4 +--- eggdrop-1.6.19-1ubuntu1/aclocal.m4 2008-05-31 05:51:33.000000000 -0500 ++++ eggdrop-1.6.19-1ubuntu1.new/aclocal.m4 2008-06-24 17:29:06.000000000 -0500 +@@ -37,6 +37,64 @@ + ]) + + ++dnl EGG_SSL_CRAP() ++dnl ++AC_DEFUN(EGG_SSL_CRAP, [dnl ++#ssl checks ++AC_MSG_CHECKING(whether to include SSL support) ++AC_ARG_WITH(ssl, ++[ --with-ssl[=PATH] Include SSL support (DIR is OpenSSL's install dir).], ++[ ++ case "$withval" in ++ no) ++ AC_MSG_RESULT(no) ;; ++ yes) ++ AC_MSG_RESULT(yes) ++ AC_CHECK_LIB(ssl,SSL_accept,[AC_DEFINE(EGG_SSL_EXT) ++ SSL_LIBS="-lssl -lcrypto"],[AC_MSG_ERROR([You requested SSL support, but OpenSSL was not found. Please supply a pathname to OpenSSL])],-lcrypto) ++ ;; ++ *) ++dnl A whole whack of possible places where this might be ++ test -f $withval/openssl/ssl.h && SSL_INCLUDE="$withval" ++ test -f $withval/include/openssl/ssl.h && SSL_INCLUDE="$withval/include" ++ ++ test -f $withval/lib/libssl.a && SSL_LIB="$withval/lib" ++ test -f $withval/lib/ssl/libssl.a && SSL_LIB="$withval/lib/ssl" ++ test -f $withval/lib/openssl/libssl.a && SSL_LIB="$withval/lib/openssl/ssl" ++ test -f $withval/libssl.a && SSL_LIB="$withval" ++ test -f $withval/ssl/libssl.a && SSL_LIB="$withval/ssl" ++ test -f $withval/openssl/libssl.a && SSL_LIB="$withval/openssl" ++ ++ test -f $withval/lib/libcrypto.a && CRYPTO_LIB="$withval/lib" ++ test -f $withval/lib/ssl/libcrypto.a && CRYPTO_LIB="$withval/lib/ssl" ++ test -f $withval/lib/openssl/libcrypto.a && CRYPTO_LIB="$withval/lib/openssl/ssl" ++ test -f $withval/libcrypto.a && CRYPTO_LIB="$withval" ++ test -f $withval/ssl/libcrypto.a && CRYPTO_LIB="$withval/ssl" ++ test -f $withval/openssl/libcrypto.a && CRYPTO_LIB="$withval/openssl" ++ ++ if test -n "$SSL_INCLUDE" && test -n "$SSL_LIB" && test -n "$CRYPTO_LIB"; then ++ SSL_LIBS="-lssl -lcrypto -L$SSL_LIB -L$CRYPTO_LIB"; ++ AC_DEFINE(EGG_SSL_EXT) ++ AC_MSG_RESULT(yes) ++ else ++ AC_MSG_RESULT(no) ++ AC_MSG_ERROR([You requested SSL support, but OpenSSL was not found. Please supply a pathname to OpenSSL]) ++ fi ;; ++ esac ++],[ ++ AC_MSG_RESULT(will try to find) ++ AC_CHECK_LIB(ssl,SSL_accept,[AC_DEFINE(EGG_SSL_EXT) ++ SSL_LIBS="-lssl -lcrypto"],[AC_MSG_ERROR([OpenSSL was not found. Please supply a pathname to OpenSSL])],-lcrypto) ++ AC_CHECK_HEADERS("openssl/ssl.h",,[AC_MSG_ERROR([OpenSSL was not found. Please supply a pathname to OpenSSL])],) ++ ++ AC_SUBST(SSL_LIBS)dnl ++ AC_SUBST(SSL_INCLUDE)dnl ++]) ++ ++#end of ssl checks ++])dnl ++ ++ + dnl EGG_MSG_CONFIGURE_END() + dnl + AC_DEFUN([EGG_MSG_CONFIGURE_END], +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19-1ubuntu1/config.h.in eggdrop-1.6.19-1ubuntu1.new/config.h.in +--- eggdrop-1.6.19-1ubuntu1/config.h.in 2008-05-31 05:51:33.000000000 -0500 ++++ eggdrop-1.6.19-1ubuntu1.new/config.h.in 2008-06-24 17:29:06.000000000 -0500 +@@ -33,6 +33,9 @@ + /* Define to 1 if you have the `clock' function. */ + #undef HAVE_CLOCK + ++/* Defines ssl mode */ ++#undef EGG_SSL_EXT ++ + /* Define to 1 if you have the header file, and it defines `DIR'. + */ + #undef HAVE_DIRENT_H +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19-1ubuntu1/configure eggdrop-1.6.19-1ubuntu1.new/configure +--- eggdrop-1.6.19-1ubuntu1/configure 2008-05-31 05:51:33.000000000 -0500 ++++ eggdrop-1.6.19-1ubuntu1.new/configure 2008-06-24 17:29:06.000000000 -0500 +@@ -315,7 +315,7 @@ + # include + #endif" + +-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS egg_ac_parameters CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE RANLIB ac_ct_RANLIB LN_S HEAD_1 STRIP AWK BASENAME UNAME DEFAULT_MAKE MOD_EXT MODULE_XLIBS MOD_LD MOD_CC MOD_STRIP SHLIB_LD SHLIB_CC SHLIB_STRIP EGGEXEC TCLLIB TCLLIBFN TCLINC TCLINCFN TCL_REQS TCL_LIBS EGGVERSION DEST MOD_UPDIR LIBOBJS LTLIBOBJS' ++ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS egg_ac_parameters CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE RANLIB ac_ct_RANLIB LN_S HEAD_1 STRIP AWK BASENAME UNAME DEFAULT_MAKE MOD_EXT MODULE_XLIBS MOD_LD MOD_CC MOD_STRIP SHLIB_LD SHLIB_CC SHLIB_STRIP EGGEXEC TCLLIB TCLLIBFN TCLINC TCLINCFN TCL_REQS TCL_LIBS SSL_LIBS SSL_INCLUDE EGGVERSION DEST MOD_UPDIR LIBOBJS LTLIBOBJS' + ac_subst_files='' + + # Initialize some variables set by options. +@@ -856,6 +856,7 @@ + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-tcllib=PATH full path to Tcl library + --with-tclinc=PATH full path to Tcl header ++ --with-ssl=PATH Include SSL support (DIR is OpenSSL's install dir). + + Some influential environment variables: + CC C compiler command +@@ -8471,6 +8472,374 @@ + rm -f conftest* + + ++#ssl checks ++echo "$as_me:$LINENO: checking whether to include SSL support" >&5 ++echo $ECHO_N "checking whether to include SSL support... $ECHO_C" >&6 ++ ++# Check whether --with-ssl or --without-ssl was given. ++if test "${with_ssl+set}" = set; then ++ withval="$with_ssl" ++ ++ case "$withval" in ++ no) ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 ;; ++ yes) ++ echo "$as_me:$LINENO: result: yes" >&5 ++echo "${ECHO_T}yes" >&6 ++ echo "$as_me:$LINENO: checking for SSL_accept in -lssl" >&5 ++echo $ECHO_N "checking for SSL_accept in -lssl... $ECHO_C" >&6 ++if test "${ac_cv_lib_ssl_SSL_accept+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lssl -lcrypto $LIBS" ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++/* Override any gcc2 internal prototype to avoid an error. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char SSL_accept (); ++int ++main () ++{ ++SSL_accept (); ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext conftest$ac_exeext ++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ++ (eval $ac_link) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_lib_ssl_SSL_accept=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_cv_lib_ssl_SSL_accept=no ++fi ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SSL_accept" >&5 ++echo "${ECHO_T}$ac_cv_lib_ssl_SSL_accept" >&6 ++if test $ac_cv_lib_ssl_SSL_accept = yes; then ++ cat >>confdefs.h <<\_ACEOF ++#define EGG_SSL_EXT 1 ++_ACEOF ++ ++ SSL_LIBS="-lssl -lcrypto" ++else ++ { { echo "$as_me:$LINENO: error: You requested SSL support, but OpenSSL was not found. Please supply a pathname to OpenSSL" >&5 ++echo "$as_me: error: You requested SSL support, but OpenSSL was not found. Please supply a pathname to OpenSSL" >&2;} ++ { (exit 1); exit 1; }; } ++fi ++ ++ ;; ++ *) ++ test -f $withval/openssl/ssl.h && SSL_INCLUDE="$withval" ++ test -f $withval/include/openssl/ssl.h && SSL_INCLUDE="$withval/include" ++ ++ test -f $withval/lib/libssl.a && SSL_LIB="$withval/lib" ++ test -f $withval/lib/ssl/libssl.a && SSL_LIB="$withval/lib/ssl" ++ test -f $withval/lib/openssl/libssl.a && SSL_LIB="$withval/lib/openssl/ssl" ++ test -f $withval/libssl.a && SSL_LIB="$withval" ++ test -f $withval/ssl/libssl.a && SSL_LIB="$withval/ssl" ++ test -f $withval/openssl/libssl.a && SSL_LIB="$withval/openssl" ++ ++ test -f $withval/lib/libcrypto.a && CRYPTO_LIB="$withval/lib" ++ test -f $withval/lib/ssl/libcrypto.a && CRYPTO_LIB="$withval/lib/ssl" ++ test -f $withval/lib/openssl/libcrypto.a && CRYPTO_LIB="$withval/lib/openssl/ssl" ++ test -f $withval/libcrypto.a && CRYPTO_LIB="$withval" ++ test -f $withval/ssl/libcrypto.a && CRYPTO_LIB="$withval/ssl" ++ test -f $withval/openssl/libcrypto.a && CRYPTO_LIB="$withval/openssl" ++ ++ if test -n "$SSL_INCLUDE" && test -n "$SSL_LIB" && test -n "$CRYPTO_LIB"; then ++ SSL_LIBS="-lssl -lcrypto -L$SSL_LIB -L$CRYPTO_LIB"; ++ cat >>confdefs.h <<\_ACEOF ++#define EGG_SSL_EXT 1 ++_ACEOF ++ ++ echo "$as_me:$LINENO: result: yes" >&5 ++echo "${ECHO_T}yes" >&6 ++ else ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 ++ { { echo "$as_me:$LINENO: error: You requested SSL support, but OpenSSL was not found. Please supply a pathname to OpenSSL" >&5 ++echo "$as_me: error: You requested SSL support, but OpenSSL was not found. Please supply a pathname to OpenSSL" >&2;} ++ { (exit 1); exit 1; }; } ++ fi ;; ++ esac ++ ++else ++ ++ echo "$as_me:$LINENO: result: will try to find" >&5 ++echo "${ECHO_T}will try to find" >&6 ++ echo "$as_me:$LINENO: checking for SSL_accept in -lssl" >&5 ++echo $ECHO_N "checking for SSL_accept in -lssl... $ECHO_C" >&6 ++if test "${ac_cv_lib_ssl_SSL_accept+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lssl -lcrypto $LIBS" ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++/* Override any gcc2 internal prototype to avoid an error. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char SSL_accept (); ++int ++main () ++{ ++SSL_accept (); ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext conftest$ac_exeext ++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ++ (eval $ac_link) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_lib_ssl_SSL_accept=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_cv_lib_ssl_SSL_accept=no ++fi ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SSL_accept" >&5 ++echo "${ECHO_T}$ac_cv_lib_ssl_SSL_accept" >&6 ++if test $ac_cv_lib_ssl_SSL_accept = yes; then ++ cat >>confdefs.h <<\_ACEOF ++#define EGG_SSL_EXT 1 ++_ACEOF ++ ++ SSL_LIBS="-lssl -lcrypto" ++else ++ { { echo "$as_me:$LINENO: error: OpenSSL was not found. Please supply a pathname to OpenSSL" >&5 ++echo "$as_me: error: OpenSSL was not found. Please supply a pathname to OpenSSL" >&2;} ++ { (exit 1); exit 1; }; } ++fi ++ ++ ++for ac_header in "openssl/ssl.h" ++do ++as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` ++if eval "test \"\${$as_ac_Header+set}\" = set"; then ++ echo "$as_me:$LINENO: checking for $ac_header" >&5 ++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 ++if eval "test \"\${$as_ac_Header+set}\" = set"; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++fi ++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 ++echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 ++else ++ # Is the header compilable? ++echo "$as_me:$LINENO: checking $ac_header usability" >&5 ++echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_includes_default ++#include <$ac_header> ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_header_compiler=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_header_compiler=no ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 ++echo "${ECHO_T}$ac_header_compiler" >&6 ++ ++# Is the header present? ++echo "$as_me:$LINENO: checking $ac_header presence" >&5 ++echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include <$ac_header> ++_ACEOF ++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 ++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null; then ++ if test -s conftest.err; then ++ ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag ++ else ++ ac_cpp_err= ++ fi ++else ++ ac_cpp_err=yes ++fi ++if test -z "$ac_cpp_err"; then ++ ac_header_preproc=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_preproc=no ++fi ++rm -f conftest.err conftest.$ac_ext ++echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 ++echo "${ECHO_T}$ac_header_preproc" >&6 ++ ++# So? What about this header? ++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in ++ yes:no: ) ++ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 ++echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 ++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ++ ac_header_preproc=yes ++ ;; ++ no:yes:* ) ++ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 ++echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 ++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 ++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 ++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 ++echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 ++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ++ ( ++ cat <<\_ASBOX ++## -------------------------------- ## ++## Report this to bugs@eggheads.org ## ++## -------------------------------- ## ++_ASBOX ++ ) | ++ sed "s/^/$as_me: WARNING: /" >&2 ++ ;; ++esac ++echo "$as_me:$LINENO: checking for $ac_header" >&5 ++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 ++if eval "test \"\${$as_ac_Header+set}\" = set"; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ eval "$as_ac_Header=\$ac_header_preproc" ++fi ++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 ++echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 ++ ++fi ++if test `eval echo '${'$as_ac_Header'}'` = yes; then ++ cat >>confdefs.h <<_ACEOF ++#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 ++_ACEOF ++ ++else ++ { { echo "$as_me:$LINENO: error: OpenSSL was not found. Please supply a pathname to OpenSSL" >&5 ++echo "$as_me: error: OpenSSL was not found. Please supply a pathname to OpenSSL" >&2;} ++ { (exit 1); exit 1; }; } ++fi ++ ++done ++ ++ ++ ++fi; ++ ++#end of ssl checks ++ ++ + + for ac_func in vprintf + do +@@ -10827,6 +11196,8 @@ + s,@TCLINCFN@,$TCLINCFN,;t t + s,@TCL_REQS@,$TCL_REQS,;t t + s,@TCL_LIBS@,$TCL_LIBS,;t t ++s,@SSL_LIBS@,$SSL_LIBS,;t t ++s,@SSL_INCLUDE@,$SSL_INCLUDE,;t t + s,@EGGVERSION@,$EGGVERSION,;t t + s,@DEST@,$DEST,;t t + s,@MOD_UPDIR@,$MOD_UPDIR,;t t +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19-1ubuntu1/configure.ac eggdrop-1.6.19-1ubuntu1.new/configure.ac +--- eggdrop-1.6.19-1ubuntu1/configure.ac 2008-05-31 05:51:33.000000000 -0500 ++++ eggdrop-1.6.19-1ubuntu1.new/configure.ac 2008-06-24 17:29:06.000000000 -0500 +@@ -150,6 +150,7 @@ + EGG_TCL_LIB_REQS + EGG_TCL_LUSH + ++EGG_SSL_CRAP + + # Substitute Makefile variables. + EGG_SUBST_EGGVERSION +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19-1ubuntu1/Makefile.in eggdrop-1.6.19-1ubuntu1.new/Makefile.in +--- eggdrop-1.6.19-1ubuntu1/Makefile.in 2008-05-31 05:51:33.000000000 -0500 ++++ eggdrop-1.6.19-1ubuntu1.new/Makefile.in 2008-06-24 17:29:06.000000000 -0500 +@@ -57,6 +57,8 @@ + RANLIB = @RANLIB@ + MOD_EXT = @MOD_EXT@ + XREQS = @TCL_REQS@ ++XSSL_LIBS = @SSL_LIBS@ ++XSSL_INCLUDE = @SSL_INCLUDE@ + TCLLIB = @TCLLIB@ + TCLLIBFN = @TCLLIBFN@ + +@@ -89,7 +91,8 @@ + MAKE_MODEGG = $(MAKE) 'MAKE=$(MAKE)' 'CC=$(MOD_CC)' 'LD=$(MOD_LD)' \ + 'STRIP=$(MOD_STRIP)' 'RANLIB=$(RANLIB)' 'CFLGS=$(CFLGS)' \ + 'TCLLIB=$(TCLLIB)' 'TCLLIBFN=$(TCLLIBFN)' 'XREQS=$(XREQS)' \ +-'XLIBS=$(XLIBS)' 'EGGEXEC=$(EGGEXEC)' 'EGGBUILD=(standard build)' 'MODOBJS=' ++'XSSL_LIBS=$(XSSL_LIBS)' 'XLIBS=$(XLIBS)' 'EGGEXEC=$(EGGEXEC)' \ ++'XSSL_INCLUDE=$(XSSL_INCLUDE)' 'EGGBUILD=' 'MODOBJS=' + + MAKE_MODULES = $(MAKE) 'MAKE=$(MAKE)' 'CC=$(SHLIB_CC)' 'LD=$(SHLIB_LD)' \ + 'STRIP=$(SHLIB_STRIP)' 'CFLGS=$(CFLGS)' 'XLIBS=$(XLIBS)' 'MOD_EXT=$(MOD_EXT)' \ +@@ -99,12 +102,13 @@ + 'STRIP=$(STRIP)' 'RANLIB=$(RANLIB)' 'CFLGS=$(CFLGS) -DSTATIC' \ + 'TCLLIB=$(TCLLIB)' 'TCLLIBFN=$(TCLLIBFN)' 'XREQS=$(XREQS)' \ + 'XLIBS=$(XLIBS)' 'EGGEXEC=$(EGGEXEC)' 'EGGBUILD=(static version)' \ +-'MODOBJS=mod/*.o' ++'XSSL_INCLUDE=$(XSSL_INCLUDE)' 'XSSL_LIBS=$(XSSL_LIBS)' 'MODOBJS=mod/*.o' + + MAKE_DEBEGG = $(MAKE) 'MAKE=$(MAKE)' 'CC=$(MOD_CC)' 'LD=$(MOD_LD) -g' \ + 'STRIP=touch' 'RANLIB=$(RANLIB)' 'CFLGS=-g3 $(DEBCFLAGS) $(CFLGS)' \ + 'TCLLIB=$(TCLLIB)' 'TCLLIBFN=$(TCLLIBFN)' 'XREQS=$(XREQS)' \ +-'XLIBS=$(XLIBS)' 'EGGEXEC=$(EGGEXEC)' 'EGGBUILD=(debug version)' 'MODOBJS=' ++'XSSL_LIBS=$(XSSL_LIBS)' 'XLIBS=$(XLIBS)' 'EGGEXEC=$(EGGEXEC)' \ ++'XSSL_INCLUDE=$(XSSL_INCLUDE)' 'EGGBUILD=(debug version)' 'MODOBJS=' + + MAKE_DEBMODULES = $(MAKE) 'MAKE=$(MAKE)' 'CC=$(SHLIB_CC)' 'LD=$(SHLIB_LD)' \ + 'XLIBS=$(XLIBS)' 'STRIP=touch' 'CFLGS=-g3 $(DEBCFLAGS) $(CFLGS)' \ +@@ -113,7 +117,8 @@ + MAKE_SDEBUG = $(MAKE) 'MAKE=$(MAKE)' 'CC=$(CC)' 'LD=$(LD) -g' \ + 'STRIP=touch' 'RANLIB=$(RANLIB)' 'CFLGS=-g3 $(DEBCFLAGS) -DSTATIC $(CFLGS)' \ + 'TCLLIB=$(TCLLIB)' 'TCLLIBFN=$(TCLLIBFN)' 'XREQS=$(XREQS)' 'XLIBS=$(XLIBS)' \ +-'EGGEXEC=$(EGGEXEC)' 'EGGBUILD=(static debug version)' 'MODOBJS=mod/*.o' ++'XSSL_INCLUDE=$(XSSL_INCLUDE)' 'XSSL_LIBS=$(XSSL_LIBS)' 'EGGEXEC=$(EGGEXEC)' \ ++'EGGBUILD=(static and debug version)' 'MODOBJS=mod/*.o' + + MAKE_DEPEND = $(MAKE) 'MAKE=$(MAKE)' 'CC=$(CC)' + +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19-1ubuntu1/src/dcc.c eggdrop-1.6.19-1ubuntu1.new/src/dcc.c +--- eggdrop-1.6.19-1ubuntu1/src/dcc.c 2008-05-31 05:51:35.000000000 -0500 ++++ eggdrop-1.6.19-1ubuntu1.new/src/dcc.c 2008-06-24 17:29:06.000000000 -0500 +@@ -32,7 +32,11 @@ + #include "tandem.h" + + /* Includes for botnet md5 challenge/response code */ ++#ifndef EGG_SSL_EXT + #include "md5/md5.h" ++#else ++#include "openssl/md5.h" ++#endif + + extern struct userrec *userlist; + extern struct chanset_t *chanset; +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19-1ubuntu1/src/dccutil.c eggdrop-1.6.19-1ubuntu1.new/src/dccutil.c +--- eggdrop-1.6.19-1ubuntu1/src/dccutil.c 2008-05-31 05:51:35.000000000 -0500 ++++ eggdrop-1.6.19-1ubuntu1.new/src/dccutil.c 2008-06-24 17:29:06.000000000 -0500 +@@ -33,6 +33,7 @@ + #include "chan.h" + #include "modules.h" + #include "tandem.h" ++#include "net.h" + + extern struct dcc_t *dcc; + extern int dcc_total, max_dcc, dcc_flood_thr, backgrd, copy_to_tmp, MAXSOCKS; +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19-1ubuntu1/src/eggdrop.h eggdrop-1.6.19-1ubuntu1.new/src/eggdrop.h +--- eggdrop-1.6.19-1ubuntu1/src/eggdrop.h 2008-05-31 05:51:35.000000000 -0500 ++++ eggdrop-1.6.19-1ubuntu1.new/src/eggdrop.h 2008-06-24 17:29:06.000000000 -0500 +@@ -616,17 +616,6 @@ + #define HELP_TEXT 2 + #define HELP_IRC 16 + +-/* This is used by the net module to keep track of sockets and what's +- * queued on them +- */ +-typedef struct { +- int sock; +- short flags; +- char *inbuf; +- char *outbuf; +- unsigned long outbuflen; /* Outbuf could be binary data */ +- unsigned long inbuflen; /* Inbuf could be binary data */ +-} sock_list; + + enum { + EGG_OPTION_SET = 1, /* Set option(s). */ +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19-1ubuntu1/src/main.c eggdrop-1.6.19-1ubuntu1.new/src/main.c +--- eggdrop-1.6.19-1ubuntu1/src/main.c 2008-06-24 17:28:38.000000000 -0500 ++++ eggdrop-1.6.19-1ubuntu1.new/src/main.c 2008-06-24 17:29:06.000000000 -0500 +@@ -161,6 +161,9 @@ + int cx_ptr = 0; + #endif + ++#ifdef EGG_SSL_EXT ++int clean_net(); ++#endif + + void fatal(const char *s, int recoverable) + { +@@ -171,6 +174,9 @@ + for (i = 0; i < dcc_total; i++) + if (dcc[i].sock >= 0) + killsock(dcc[i].sock); ++ #ifdef EGG_SSL_EXT ++ clean_net(); ++ #endif + unlink(pid_file); + if (!recoverable) { + bg_send_quit(BG_ABORT); +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19-1ubuntu1/src/Makefile.in eggdrop-1.6.19-1ubuntu1.new/src/Makefile.in +--- eggdrop-1.6.19-1ubuntu1/src/Makefile.in 2008-05-31 05:51:35.000000000 -0500 ++++ eggdrop-1.6.19-1ubuntu1.new/src/Makefile.in 2008-06-24 17:29:06.000000000 -0500 +@@ -11,6 +11,8 @@ + INSTALL_PROGRAM = @INSTALL_PROGRAM@ + INSTALL_DATA = @INSTALL_DATA@ + INSTALL_SCRIPT = @INSTALL_SCRIPT@ ++XSSL_LIBS = @SSL_LIBS@ ++XSSL_INCLUDE = @SSL_INCLUDE@ + + CC = @CC@ + LD = @CC@ +@@ -37,7 +39,7 @@ + @echo "Linking eggdrop $(EGGBUILD)." + @echo "" + @touch mod/mod.xlibs +- $(LD) -o ../$(EGGEXEC) $(eggdrop_objs) $(MODOBJS) $(XLIBS) md5/md5c.o compat/*.o `cat mod/mod.xlibs` ++ $(LD) -o ../$(EGGEXEC) $(eggdrop_objs) $(MODOBJS) $(XLIBS) md5/md5c.o compat/*.o `cat mod/mod.xlibs` $(XSSL_LIBS) $(XSSL_INCLUDE) + $(STRIP) ../$(EGGEXEC) + @echo "" + @echo "Successful compile: $(EGGEXEC)" +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19-1ubuntu1/src/md5/md5c.c eggdrop-1.6.19-1ubuntu1.new/src/md5/md5c.c +--- eggdrop-1.6.19-1ubuntu1/src/md5/md5c.c 2008-05-31 05:51:36.000000000 -0500 ++++ eggdrop-1.6.19-1ubuntu1.new/src/md5/md5c.c 2008-06-24 17:29:06.000000000 -0500 +@@ -17,9 +17,23 @@ + + #include + ++#ifndef EGG_SSL_EXT + #include "md5.h" ++#else ++#include "openssl/md5.h" ++#endif ++ + #include "compat/compat.h" + ++typedef unsigned long MD5_u32plus; ++ ++typedef struct { ++ MD5_u32plus lo, hi; ++ MD5_u32plus a, b, c, d; ++ unsigned char buffer[64]; ++ MD5_u32plus block[16]; ++} MD5_CTX; ++ + /* + * The basic MD5 functions. + * +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19-1ubuntu1/src/md5/md5.h eggdrop-1.6.19-1ubuntu1.new/src/md5/md5.h +--- eggdrop-1.6.19-1ubuntu1/src/md5/md5.h 2008-05-31 05:51:36.000000000 -0500 ++++ eggdrop-1.6.19-1ubuntu1.new/src/md5/md5.h 2008-06-24 17:29:06.000000000 -0500 +@@ -5,6 +5,9 @@ + * Written by Solar Designer in 2001, and placed in + * the public domain. See md5c.c for more information. + */ ++#include "../config.h" ++#ifndef EGG_SSL_EXT ++ + + #ifndef _MD5_H + #define _MD5_H +@@ -24,3 +27,4 @@ + extern void MD5_Final(unsigned char *result, MD5_CTX *ctx); + + #endif ++#endif +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19-1ubuntu1/src/mod/compress.mod/compress.c eggdrop-1.6.19-1ubuntu1.new/src/mod/compress.mod/compress.c +--- eggdrop-1.6.19-1ubuntu1/src/mod/compress.mod/compress.c 2008-05-31 05:51:37.000000000 -0500 ++++ eggdrop-1.6.19-1ubuntu1.new/src/mod/compress.mod/compress.c 2008-06-24 17:29:06.000000000 -0500 +@@ -36,6 +36,8 @@ + #include "src/mod/module.h" + #include "share.mod/share.h" + ++#include ++ + #ifdef HAVE_MMAP + # undef panic + # include +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19-1ubuntu1/src/mod/irc.mod/chan.c eggdrop-1.6.19-1ubuntu1.new/src/mod/irc.mod/chan.c +--- eggdrop-1.6.19-1ubuntu1/src/mod/irc.mod/chan.c 2008-05-31 05:51:38.000000000 -0500 ++++ eggdrop-1.6.19-1ubuntu1.new/src/mod/irc.mod/chan.c 2008-06-24 17:29:06.000000000 -0500 +@@ -965,10 +965,10 @@ + q = strchr(p, ' '); + if (q != NULL) { + *q = 0; +- set_key(chan, p); ++ set_keyegg(chan, p); + strcpy(p, q + 1); + } else { +- set_key(chan, p); ++ set_keyegg(chan, p); + *p = 0; + } + } +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19-1ubuntu1/src/mod/irc.mod/irc.c eggdrop-1.6.19-1ubuntu1.new/src/mod/irc.mod/irc.c +--- eggdrop-1.6.19-1ubuntu1/src/mod/irc.mod/irc.c 2008-05-31 05:51:38.000000000 -0500 ++++ eggdrop-1.6.19-1ubuntu1.new/src/mod/irc.mod/irc.c 2008-06-24 17:29:06.000000000 -0500 +@@ -256,7 +256,7 @@ + + /* Set the key. + */ +-static void set_key(struct chanset_t *chan, char *k) ++static void set_keyegg(struct chanset_t *chan, char *k) + { + nfree(chan->channel.key); + if (k == NULL) { +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19-1ubuntu1/src/mod/irc.mod/irc.h eggdrop-1.6.19-1ubuntu1.new/src/mod/irc.mod/irc.h +--- eggdrop-1.6.19-1ubuntu1/src/mod/irc.mod/irc.h 2008-05-31 05:51:38.000000000 -0500 ++++ eggdrop-1.6.19-1ubuntu1.new/src/mod/irc.mod/irc.h 2008-06-24 17:29:06.000000000 -0500 +@@ -69,7 +69,7 @@ + + static void reset_chan_info(struct chanset_t *); + static void recheck_channel(struct chanset_t *, int); +-static void set_key(struct chanset_t *, char *); ++static void set_keyegg(struct chanset_t *, char *); + static void maybe_revenge(struct chanset_t *, char *, char *, int); + static int detect_chan_flood(char *, char *, char *, struct chanset_t *, int, + char *); +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19-1ubuntu1/src/mod/irc.mod/mode.c eggdrop-1.6.19-1ubuntu1.new/src/mod/irc.mod/mode.c +--- eggdrop-1.6.19-1ubuntu1/src/mod/irc.mod/mode.c 2008-05-31 05:51:38.000000000 -0500 ++++ eggdrop-1.6.19-1ubuntu1.new/src/mod/irc.mod/mode.c 2008-06-24 17:29:06.000000000 -0500 +@@ -1128,7 +1128,7 @@ + break; + } + if (ms2[0] == '+') { +- set_key(chan, op); ++ set_keyegg(chan, op); + if (channel_active(chan)) + got_key(chan, nick, from, op); + } else { +@@ -1139,7 +1139,7 @@ + !chan_master(user) && !match_my_nick(nick)) + add_mode(chan, '+', 'k', chan->key_prot); + } +- set_key(chan, NULL); ++ set_keyegg(chan, NULL); + } + check_tcl_mode(nick, from, u, chan->dname, ms2, op); + break; +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19-1ubuntu1/src/mod/module.h eggdrop-1.6.19-1ubuntu1.new/src/mod/module.h +--- eggdrop-1.6.19-1ubuntu1/src/mod/module.h 2008-05-31 05:51:36.000000000 -0500 ++++ eggdrop-1.6.19-1ubuntu1.new/src/mod/module.h 2008-06-24 17:29:06.000000000 -0500 +@@ -471,13 +471,23 @@ + /* IPv6 leftovers: 286 */ + /* IPv6 leftovers: 287 */ + /* 288 - 291 */ +-/* IPv6 leftovers: 288 */ ++#ifdef EGG_SSL_EXT ++#define net_switch_to_ssl ((int (*)(int))global[289]) ++#define ssl_use (*(int *)global[290]) /* kyotou */ ++#define strip_mirc_codes ((void (*)(int, char *))global[291]) ++#define check_ansi ((int (*) (char *))global[292]) ++#define oatoi ((int (*) (const char *))global[293]) ++/* 292 - 295 */ ++#define str_isdigit ((int (*) (const char *))global[294]) ++#define remove_crlf ((void (*)(char **))global[295]) ++#else + #define strip_mirc_codes ((void (*)(int, char *))global[289]) + #define check_ansi ((int (*) (char *))global[290]) + #define oatoi ((int (*) (const char *))global[291]) + /* 292 - 295 */ + #define str_isdigit ((int (*) (const char *))global[292]) + #define remove_crlf ((void (*)(char **))global[293]) ++#endif + + /* hostmasking */ + #define maskhost(a,b) _maskhost((a),(b),1) +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19-1ubuntu1/src/mod/server.mod/servmsg.c eggdrop-1.6.19-1ubuntu1.new/src/mod/server.mod/servmsg.c +--- eggdrop-1.6.19-1ubuntu1/src/mod/server.mod/servmsg.c 2008-05-31 05:51:38.000000000 -0500 ++++ eggdrop-1.6.19-1ubuntu1.new/src/mod/server.mod/servmsg.c 2008-06-24 17:29:06.000000000 -0500 +@@ -1293,6 +1293,14 @@ + fatal("NO SERVERS WILL ACCEPT MY CONNECTION.", 0); + } else { + dcc[servidx].sock = serv; ++ #ifdef EGG_SSL_EXT ++ if (ssl_use) { /* kyotou */ ++ if (net_switch_to_ssl(serv)==0) { ++ putlog(LOG_SERV, "*", "SSL %s %s (Error while switching to SSL)", IRC_FAILEDCONNECT, dcc[servidx].host); ++ lostdcc(servidx); ++ } ++ } ++ #endif + /* Queue standard login */ + dcc[servidx].timeval = now; + SERVER_SOCKET.timeout_val = &server_timeout; +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19-1ubuntu1/src/modules.c eggdrop-1.6.19-1ubuntu1.new/src/modules.c +--- eggdrop-1.6.19-1ubuntu1/src/modules.c 2008-05-31 05:51:36.000000000 -0500 ++++ eggdrop-1.6.19-1ubuntu1.new/src/modules.c 2008-06-24 17:29:06.000000000 -0500 +@@ -29,9 +29,17 @@ + #include "main.h" + #include "modules.h" + #include "tandem.h" ++ ++#ifndef EGG_SSL_EXT + #include "md5/md5.h" ++#else ++#include "openssl/md5.h" ++#endif ++ + #include "users.h" + ++#include "net.h" ++ + #ifndef STATIC + # ifdef MOD_USE_SHL + # include +@@ -94,6 +102,10 @@ + password_timeout, force_expire, protect_readonly, reserved_port_min, + reserved_port_max, copy_to_tmp, quiet_reject; + ++#ifdef EGG_SSL_EXT ++extern int ssl_use; /* kyotou */ ++#endif ++ + extern party_t *party; + extern time_t now, online_since; + extern tand_t *tandbot; +@@ -128,6 +140,10 @@ + } + #endif /* STATIC */ + ++#ifdef EGG_SSL_EXT ++int net_switch_to_ssl(int); ++#endif ++ + + /* The null functions */ + void null_func() +@@ -564,7 +580,13 @@ + (Function) 0, /* IPv6 leftovers: 286 */ + (Function) 0, /* IPv6 leftovers: 287 */ + /* 288 - 291 */ ++#ifdef EGG_SSL_EXT + (Function) 0, /* IPv6 leftovers: 288 */ ++ (Function) net_switch_to_ssl, ++ (Function) & ssl_use, /* kyotou */ ++#else ++ (Function) 0, /* IPv6 leftovers: 288 */ ++#endif + (Function) strip_mirc_codes, + (Function) check_ansi, + (Function) oatoi, +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19-1ubuntu1/src/net.c eggdrop-1.6.19-1ubuntu1.new/src/net.c +--- eggdrop-1.6.19-1ubuntu1/src/net.c 2008-05-31 05:51:36.000000000 -0500 ++++ eggdrop-1.6.19-1ubuntu1.new/src/net.c 2008-06-24 17:29:06.000000000 -0500 +@@ -52,6 +52,18 @@ + # endif + #endif + ++#ifdef EGG_SSL_EXT ++# ifndef EGG_SSL_INCS ++# include ++# include ++# include ++# define EGG_SSL_INCS 1 ++# endif ++#endif ++ ++#include "net.h" ++ ++ + extern struct dcc_t *dcc; + extern int backgrd, use_stderr, resolve_timeout, dcc_total; + extern unsigned long otraffic_irc_today, otraffic_bn_today, otraffic_dcc_today, +@@ -64,7 +76,11 @@ + int firewallport = 1080; /* Default port of socks 4/5 firewalls. */ + char botuser[21] = "eggdrop"; /* Username of the user running the bot. */ + int dcc_sanitycheck = 0; /* Do some sanity checking on dcc connections. */ +- ++#ifdef EGG_SSL_EXT ++SSL_CTX *ssl_ctx=NULL; ++char *tls_rand_file = NULL; ++int ssl_use = 0; /* kyotou */ ++#endif + sock_list *socklist = NULL; /* Enough to be safe. */ + int MAXSOCKS = 0; + sigjmp_buf alarmret; /* Env buffer for alarm() returns. */ +@@ -88,6 +104,46 @@ + return ret; + } + ++#ifdef EGG_SSL_EXT ++int seed_PRNG(void) ++{ ++ char stackdata[1024]; ++ static char rand_file[300]; ++ FILE *fh; ++ ++#if OPENSSL_VERSION_NUMBER >= 0x00905100 ++ if (RAND_status()) ++ return 0; /* PRNG already good seeded */ ++#endif ++ /* if the device '/dev/urandom' is present, OpenSSL uses it by default. ++ * check if it's present, else we have to make random data ourselfs. ++ */ ++ if ((fh = fopen("/dev/urandom", "r"))) { ++ fclose(fh); ++ return 0; ++ } ++ if (RAND_file_name(rand_file, sizeof(rand_file))) ++ tls_rand_file = rand_file; ++ else ++ return 1; ++ if (!RAND_load_file(rand_file, 1024)) { ++ /* no .rnd file found, create new seed */ ++ unsigned int c; ++ c = time(NULL); ++ RAND_seed(&c, sizeof(c)); ++ c = getpid(); ++ RAND_seed(&c, sizeof(c)); ++ RAND_seed(stackdata, sizeof(stackdata)); ++ } ++#if OPENSSL_VERSION_NUMBER >= 0x00905100 ++ if (!RAND_status()) ++ return 2; /* PRNG still badly seeded */ ++#endif ++ return 0; ++} ++#endif ++ ++ + /* Initialize the socklist + */ + void init_net() +@@ -96,8 +152,34 @@ + + for (i = 0; i < MAXSOCKS; i++) { + socklist[i].flags = SOCK_UNUSED; ++#ifdef EGG_SSL_EXT ++ socklist[i].ssl=NULL; ++#endif + } ++#ifdef EGG_SSL_EXT ++ /* good place to init ssl stuff */ ++ SSL_load_error_strings(); ++ OpenSSL_add_ssl_algorithms(); ++ ssl_ctx=SSL_CTX_new(SSLv23_client_method()); ++ if (!ssl_ctx) ++ fatal("SSL_CTX_new() failed",0); ++ if (seed_PRNG()) ++ fatal("Wasn't able to properly seed the PRNG!",0); ++#endif ++} ++ ++#ifdef EGG_SSL_EXT ++/* cleanup mess when quiting */ ++int clean_net() { ++ if (ssl_ctx) { ++ SSL_CTX_free(ssl_ctx); ++ ssl_ctx = NULL; ++ } ++ if (tls_rand_file) ++ RAND_write_file(tls_rand_file); ++ return 0; + } ++#endif + + int expmem_net() + { +@@ -307,6 +389,13 @@ + + for (i = 0; i < MAXSOCKS; i++) { + if ((socklist[i].sock == sock) && !(socklist[i].flags & SOCK_UNUSED)) { ++#ifdef EGG_SSL_EXT ++ if (socklist[i].ssl) { ++ SSL_shutdown(socklist[i].ssl); ++ SSL_free(socklist[i].ssl); ++ socklist[i].ssl=NULL; ++ } ++#endif + close(socklist[i].sock); + if (socklist[i].inbuf != NULL) { + nfree(socklist[i].inbuf); +@@ -448,6 +537,63 @@ + return sock; + } + ++#ifdef EGG_SSL_EXT ++int net_switch_to_ssl(int sock) { ++int err; ++int i=0; ++ debug0("net_switch_to_ssl()"); ++ while (i ++# include ++# include ++# define EGG_SSL_INCS 1 ++# endif ++#endif ++ ++/* This is used by the net module to keep track of sockets and what's ++ * queued on them ++ */ ++typedef struct { ++ int sock; ++#ifdef EGG_SSL_EXT ++ SSL *ssl; ++#endif ++ short flags; ++ char *inbuf; ++ char *outbuf; ++ unsigned long outbuflen; /* Outbuf could be binary data */ ++ unsigned long inbuflen; /* Inbuf could be binary data */ ++#ifdef USE_IPV6 ++ unsigned int af; ++#endif /* USE_IPV6 */ ++} sock_list; ++ ++#endif /* _EGG_NET_H */ +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19-1ubuntu1/src/patch.h eggdrop-1.6.19-1ubuntu1.new/src/patch.h +--- eggdrop-1.6.19-1ubuntu1/src/patch.h 2008-05-31 05:51:36.000000000 -0500 ++++ eggdrop-1.6.19-1ubuntu1.new/src/patch.h 2008-06-24 17:29:06.000000000 -0500 +@@ -32,11 +32,9 @@ + */ + #ifndef _EGG_PATCH_H + #define _EGG_PATCH_H +-/* +- * +- * +- */ +-/* PATCH GOES HERE */ ++#ifdef EGG_SSL_EXT ++patch("SSL"); ++#endif + /* + * + * +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19-1ubuntu1/src/tcl.c eggdrop-1.6.19-1ubuntu1.new/src/tcl.c +--- eggdrop-1.6.19-1ubuntu1/src/tcl.c 2008-05-31 05:51:36.000000000 -0500 ++++ eggdrop-1.6.19-1ubuntu1.new/src/tcl.c 2008-06-24 17:29:06.000000000 -0500 +@@ -44,6 +44,9 @@ + + + extern time_t online_since; ++#ifdef EGG_SSL_EXT ++extern int ssl_use; /* kyotou */ ++#endif + + extern char origbotname[], botuser[], motdfile[], admin[], userfile[], + firewall[], helpdir[], notify_new[], hostname[], myip[], moddir[], +@@ -522,6 +525,9 @@ + {"enable-simul", &enable_simul, 0}, /* compat */ + {"debug-output", &debug_output, 0}, /* compat */ + {"use-console-r", &use_console_r, 0}, /* compat */ ++#ifdef EGG_SSL_EXT ++ {"use-ssl", &ssl_use, 0}, /* kyotou */ ++#endif + {NULL, NULL, 0} + }; + +diff -Nur -x '*.orig' -x '*~' eggdrop-1.6.19-1ubuntu1/src/tclmisc.c eggdrop-1.6.19-1ubuntu1.new/src/tclmisc.c +--- eggdrop-1.6.19-1ubuntu1/src/tclmisc.c 2008-05-31 05:51:36.000000000 -0500 ++++ eggdrop-1.6.19-1ubuntu1.new/src/tclmisc.c 2008-06-24 17:29:06.000000000 -0500 +@@ -26,7 +26,12 @@ + #include "main.h" + #include "modules.h" + #include "tandem.h" ++ ++#ifndef EGG_SSL_EXT + #include "md5/md5.h" ++#else ++#include "openssl/md5.h" ++#endif + + #ifdef TIME_WITH_SYS_TIME + # include --- eggdrop-1.6.19.orig/src/eggdrop.h +++ eggdrop-1.6.19/src/eggdrop.h @@ -75,7 +75,7 @@ /* Language stuff */ -#define LANGDIR "./language" /* language file directory */ +#define LANGDIR "/usr/share/eggdrop/language" /* language file directory */ #define BASELANG "english" /* language which always gets loaded before all other languages. You do not want to change this. */ --- eggdrop-1.6.19.orig/src/main.c.new +++ eggdrop-1.6.19/src/main.c.new @@ -0,0 +1,1107 @@ +/* + * main.c -- handles: + * core event handling + * signal handling + * command line arguments + * context and assert debugging + * + * $Id: main.c,v 1.121 2008-02-16 21:41:03 guppy Exp $ + */ +/* + * Copyright (C) 1997 Robey Pointer + * Copyright (C) 1999 - 2008 Eggheads Development Team + * + * 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 + * of the License, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +/* + * The author (Robey Pointer) can be reached at: robey@netcom.com + * NOTE: Robey is no long working on this code, there is a discussion + * list available at eggheads@eggheads.org. + */ + +#include "main.h" + +#include +#include +#include +#include +#include + +#ifdef TIME_WITH_SYS_TIME +# include +# include +#else +# ifdef HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + +#ifdef STOP_UAC /* osf/1 complains a lot */ +# include +# define UAC_NOPRINT 0x00000001 /* Don't report unaligned fixups */ +#endif + +#include "chan.h" +#include "modules.h" +#include "tandem.h" +#include "bg.h" + +#ifndef ENABLE_STRIP +# include +#endif + +#ifdef CYGWIN_HACKS +# include +#endif + +#ifndef _POSIX_SOURCE +# define _POSIX_SOURCE 1 /* Solaris needs this */ +#endif + +extern char origbotname[], userfile[], botnetnick[]; +extern int dcc_total, conmask, cache_hit, cache_miss, max_logs, quick_logs; +extern struct dcc_t *dcc; +extern struct userrec *userlist; +extern struct chanset_t *chanset; +extern log_t *logs; +extern Tcl_Interp *interp; +extern tcl_timer_t *timer, *utimer; +extern sigjmp_buf alarmret; +time_t now; + +/* + * Please use the PATCH macro instead of directly altering the version + * string from now on (it makes it much easier to maintain patches). + * Also please read the README file regarding your rights to distribute + * modified versions of this bot. + */ + +char egg_version[1024] = "1.6.19"; +int egg_numver = 1061900; + +char notify_new[121] = ""; /* Person to send a note to for new users */ +int default_flags = 0; /* Default user flags */ +int default_uflags = 0; /* Default user-definied flags */ + +int backgrd = 1; /* Run in the background? */ +int con_chan = 0; /* Foreground: constantly display channel stats? */ +int term_z = 0; /* Foreground: use the terminal as a partyline? */ +int use_stderr = 1; /* Send stuff to stderr instead of logfiles? */ + +char configfile[121] = "eggdrop.conf"; /* Default config file name */ +char pid_file[120]; /* Name of the pid file */ +char helpdir[121] = "help/"; /* Directory of help files */ +char textdir[121] = "text/"; /* Directory for text files */ + +int keep_all_logs = 0; /* Never erase logfiles? */ +char logfile_suffix[21] = ".%d%b%Y"; /* Format of logfile suffix */ +int switch_logfiles_at = 300; /* When to switch logfiles */ + +time_t online_since; /* time that the bot was started */ + +int make_userfile = 0; /* Using bot in userfile-creation mode? */ +char owner[121] = ""; /* Permanent owner(s) of the bot */ + +int save_users_at = 0; /* Minutes past the hour to save the userfile? */ +int notify_users_at = 0; /* Minutes past the hour to notify users of notes? */ + +char version[81]; /* Version info (long form) */ +char ver[41]; /* Version info (short form) */ +char egg_xtra[2048]; /* Patch info */ + +int do_restart = 0; /* .restart has been called, restart ASAP */ +int die_on_sighup = 0; /* Die if bot receives SIGHUP */ +int die_on_sigterm = 1; /* Die if bot receives SIGTERM */ +int resolve_timeout = 15; /* Hostname/address lookup timeout */ +char quit_msg[1024]; /* Quit message */ + +/* Traffic stats */ +unsigned long otraffic_irc = 0; +unsigned long otraffic_irc_today = 0; +unsigned long otraffic_bn = 0; +unsigned long otraffic_bn_today = 0; +unsigned long otraffic_dcc = 0; +unsigned long otraffic_dcc_today = 0; +unsigned long otraffic_filesys = 0; +unsigned long otraffic_filesys_today = 0; +unsigned long otraffic_trans = 0; +unsigned long otraffic_trans_today = 0; +unsigned long otraffic_unknown = 0; +unsigned long otraffic_unknown_today = 0; +unsigned long itraffic_irc = 0; +unsigned long itraffic_irc_today = 0; +unsigned long itraffic_bn = 0; +unsigned long itraffic_bn_today = 0; +unsigned long itraffic_dcc = 0; +unsigned long itraffic_dcc_today = 0; +unsigned long itraffic_trans = 0; +unsigned long itraffic_trans_today = 0; +unsigned long itraffic_unknown = 0; +unsigned long itraffic_unknown_today = 0; + +#ifdef DEBUG_CONTEXT +/* Context storage for fatal crashes */ +char cx_file[16][30]; +char cx_note[16][256]; +int cx_line[16]; +int cx_ptr = 0; +#endif + + +void fatal(const char *s, int recoverable) +{ + int i; + + putlog(LOG_MISC, "*", "* %s", s); + flushlogs(); + for (i = 0; i < dcc_total; i++) + if (dcc[i].sock >= 0) + killsock(dcc[i].sock); + unlink(pid_file); + if (!recoverable) { + bg_send_quit(BG_ABORT); + exit(1); + } +} + +int expmem_chanprog(); +int expmem_users(); +int expmem_misc(); +int expmem_dccutil(); +int expmem_botnet(); +int expmem_tcl(); +int expmem_tclhash(); +int expmem_net(); +int expmem_modules(int); +int expmem_language(); +int expmem_tcldcc(); +int expmem_tclmisc(); + +/* For mem.c : calculate memory we SHOULD be using + */ +int expected_memory(void) +{ + int tot; + + tot = expmem_chanprog() + expmem_users() + expmem_misc() + expmem_dccutil() + + expmem_botnet() + expmem_tcl() + expmem_tclhash() + expmem_net() + + expmem_modules(0) + expmem_language() + expmem_tcldcc() + + expmem_tclmisc(); + return tot; +} + +static void check_expired_dcc() +{ + int i; + + for (i = 0; i < dcc_total; i++) + if (dcc[i].type && dcc[i].type->timeout_val && + ((now - dcc[i].timeval) > *(dcc[i].type->timeout_val))) { + if (dcc[i].type->timeout) + dcc[i].type->timeout(i); + else if (dcc[i].type->eof) + dcc[i].type->eof(i); + else + continue; + /* Only timeout 1 socket per cycle, too risky for more */ + return; + } +} + +#ifdef DEBUG_CONTEXT +static int nested_debug = 0; + +void write_debug() +{ + int x; + char s[25]; + int y; + + if (nested_debug) { + /* Yoicks, if we have this there's serious trouble! + * All of these are pretty reliable, so we'll try these. + * + * NOTE: dont try and display context-notes in here, it's + * _not_ safe + */ + x = creat("DEBUG.DEBUG", 0644); + setsock(x, SOCK_NONSOCK); + if (x >= 0) { + strncpyz(s, ctime(&now), sizeof s); + dprintf(-x, "Debug (%s) written %s\n", ver, s); + dprintf(-x, "Please report problem to bugs@eggheads.org\n"); + dprintf(-x, "after a visit to http://www.eggheads.org/bugzilla/\n"); + dprintf(-x, "Full Patch List: %s\n", egg_xtra); + dprintf(-x, "Context: "); + cx_ptr = cx_ptr & 15; + for (y = ((cx_ptr + 1) & 15); y != cx_ptr; y = ((y + 1) & 15)) + dprintf(-x, "%s/%d,\n ", cx_file[y], cx_line[y]); + dprintf(-x, "%s/%d\n\n", cx_file[y], cx_line[y]); + killsock(x); + close(x); + } + bg_send_quit(BG_ABORT); + exit(1); /* Dont even try & tell people about, that may + * have caused the fault last time. */ + } else + nested_debug = 1; + putlog(LOG_MISC, "*", "* Last context: %s/%d [%s]", cx_file[cx_ptr], + cx_line[cx_ptr], cx_note[cx_ptr][0] ? cx_note[cx_ptr] : ""); + putlog(LOG_MISC, "*", "* Please REPORT this BUG!"); + putlog(LOG_MISC, "*", "* Check doc/BUG-REPORT on how to do so."); + x = creat("DEBUG", 0644); + setsock(x, SOCK_NONSOCK); + if (x < 0) { + putlog(LOG_MISC, "*", "* Failed to write DEBUG"); + } else { + strncpyz(s, ctime(&now), sizeof s); + dprintf(-x, "Debug (%s) written %s\n", ver, s); + dprintf(-x, "Full Patch List: %s\n", egg_xtra); +#ifdef STATIC + dprintf(-x, "STATICALLY LINKED\n"); +#endif + + /* info library */ + dprintf(-x, "Tcl library: %s\n", + ((interp) && (Tcl_Eval(interp, "info library") == TCL_OK)) ? + interp->result : "*unknown*"); + + /* info tclversion/patchlevel */ + dprintf(-x, "Tcl version: %s (header version %s)\n", + ((interp) && (Tcl_Eval(interp, "info patchlevel") == TCL_OK)) ? + interp->result : (Tcl_Eval(interp, "info tclversion") == TCL_OK) ? + interp->result : "*unknown*", TCL_PATCH_LEVEL ? TCL_PATCH_LEVEL : + "*unknown*"); + +#ifdef HAVE_TCL_THREADS + dprintf(-x, "Tcl is threaded\n"); +#endif + +#ifdef CCFLAGS + dprintf(-x, "Compile flags: %s\n", CCFLAGS); +#endif + +#ifdef LDFLAGS + dprintf(-x, "Link flags: %s\n", LDFLAGS); +#endif + +#ifdef STRIPFLAGS + dprintf(-x, "Strip flags: %s\n", STRIPFLAGS); +#endif + + dprintf(-x, "Context: "); + cx_ptr = cx_ptr & 15; + for (y = ((cx_ptr + 1) & 15); y != cx_ptr; y = ((y + 1) & 15)) + dprintf(-x, "%s/%d, [%s]\n ", cx_file[y], cx_line[y], + (cx_note[y][0]) ? cx_note[y] : ""); + dprintf(-x, "%s/%d [%s]\n\n", cx_file[cx_ptr], cx_line[cx_ptr], + (cx_note[cx_ptr][0]) ? cx_note[cx_ptr] : ""); + tell_dcc(-x); + dprintf(-x, "\n"); + debug_mem_to_dcc(-x); + killsock(x); + close(x); + putlog(LOG_MISC, "*", "* Wrote DEBUG"); + } +} +#endif /* DEBUG_CONTEXT */ + +static void got_bus(int z) +{ +#ifdef DEBUG_CONTEXT + write_debug(); +#endif + fatal("BUS ERROR -- CRASHING!", 1); +#ifdef SA_RESETHAND + kill(getpid(), SIGBUS); +#else + bg_send_quit(BG_ABORT); + exit(1); +#endif +} + +static void got_segv(int z) +{ +#ifdef DEBUG_CONTEXT + write_debug(); +#endif + fatal("SEGMENT VIOLATION -- CRASHING!", 1); +#ifdef SA_RESETHAND + kill(getpid(), SIGSEGV); +#else + bg_send_quit(BG_ABORT); + exit(1); +#endif +} + +static void got_fpe(int z) +{ +#ifdef DEBUG_CONTEXT + write_debug(); +#endif + fatal("FLOATING POINT ERROR -- CRASHING!", 0); +} + +static void got_term(int z) +{ + write_userfile(-1); + check_tcl_event("sigterm"); + if (die_on_sigterm) { + botnet_send_chat(-1, botnetnick, "ACK, I've been terminated!"); + fatal("TERMINATE SIGNAL -- SIGNING OFF", 0); + } else + putlog(LOG_MISC, "*", "RECEIVED TERMINATE SIGNAL (IGNORING)"); +} + +static void got_quit(int z) +{ + check_tcl_event("sigquit"); + putlog(LOG_MISC, "*", "RECEIVED QUIT SIGNAL (IGNORING)"); + return; +} + +static void got_hup(int z) +{ + write_userfile(-1); + check_tcl_event("sighup"); + if (die_on_sighup) { + fatal("HANGUP SIGNAL -- SIGNING OFF", 0); + } else + putlog(LOG_MISC, "*", "Received HUP signal: rehashing..."); + do_restart = -2; + return; +} + +/* A call to resolver (gethostbyname, etc) timed out + */ +static void got_alarm(int z) +{ + siglongjmp(alarmret, 1); + + /* -Never reached- */ +} + +/* Got ILL signal -- log context and continue + */ +static void got_ill(int z) +{ + check_tcl_event("sigill"); +#ifdef DEBUG_CONTEXT + putlog(LOG_MISC, "*", "* Context: %s/%d [%s]", cx_file[cx_ptr], + cx_line[cx_ptr], (cx_note[cx_ptr][0]) ? cx_note[cx_ptr] : ""); +#endif +} + +#ifdef DEBUG_CONTEXT +/* Context */ +void eggContext(const char *file, int line, const char *module) +{ + char x[31], *p; + + p = strrchr(file, '/'); + if (!module) { + strncpyz(x, p ? p + 1 : file, sizeof x); + } else + egg_snprintf(x, 31, "%s:%s", module, p ? p + 1 : file); + cx_ptr = ((cx_ptr + 1) & 15); + strcpy(cx_file[cx_ptr], x); + cx_line[cx_ptr] = line; + cx_note[cx_ptr][0] = 0; +} + +/* Called from the ContextNote macro. + */ +void eggContextNote(const char *file, int line, const char *module, + const char *note) +{ + char x[31], *p; + + p = strrchr(file, '/'); + if (!module) + strncpyz(x, p ? p + 1 : file, sizeof x); + else + egg_snprintf(x, 31, "%s:%s", module, p ? p + 1 : file); + cx_ptr = ((cx_ptr + 1) & 15); + strcpy(cx_file[cx_ptr], x); + cx_line[cx_ptr] = line; + strncpyz(cx_note[cx_ptr], note, sizeof cx_note[cx_ptr]); +} +#endif /* DEBUG_CONTEXT */ + +#ifdef DEBUG_ASSERT +/* Called from the Assert macro. + */ +void eggAssert(const char *file, int line, const char *module) +{ +#ifdef DEBUG_CONTEXT + write_debug(); +#endif + if (!module) + putlog(LOG_MISC, "*", "* In file %s, line %u", file, line); + else + putlog(LOG_MISC, "*", "* In file %s:%s, line %u", module, file, line); + fatal("ASSERT FAILED -- CRASHING!", 1); +} +#endif + +static void do_arg(char *s) +{ + char x[512], *z = x; + int i; + + if (s[0] == '-') + for (i = 1; i < strlen(s); i++) { + switch (s[i]) { + case 'n': + backgrd = 0; + break; + case 'c': + con_chan = 1; + term_z = 0; + break; + case 't': + con_chan = 0; + term_z = 1; + break; + case 'm': + make_userfile = 1; + break; + case 'v': + strncpyz(x, egg_version, sizeof x); + newsplit(&z); + newsplit(&z); + printf("%s\n", version); + if (z[0]) + printf(" (patches: %s)\n", z); + bg_send_quit(BG_ABORT); + exit(0); + break; /* this should never be reached */ + case 'h': + printf("\n%s\n\n", version); + printf(EGG_USAGE); + printf("\n"); + bg_send_quit(BG_ABORT); + exit(0); + break; /* this should never be reached */ + } + } else + strncpyz(configfile, s, sizeof configfile); +} + +void backup_userfile(void) +{ + char s[125]; + + putlog(LOG_MISC, "*", USERF_BACKUP); + egg_snprintf(s, sizeof s, "%s~bak", userfile); + copyfile(userfile, s); +} + +/* Timer info */ +static int lastmin = 99; +static time_t then; +static struct tm nowtm; + +/* Called once a second. + * + * Note: Try to not put any Context lines in here (guppy 21Mar2000). + */ +static void core_secondly() +{ + static int cnt = 0; + int miltime; + + do_check_timers(&utimer); /* Secondly timers */ + cnt++; + if (cnt >= 10) { /* Every 10 seconds */ + cnt = 0; + check_expired_dcc(); + if (con_chan && !backgrd) { + dprintf(DP_STDOUT, "\033[2J\033[1;1H"); + tell_verbose_status(DP_STDOUT); + do_module_report(DP_STDOUT, 0, "server"); + do_module_report(DP_STDOUT, 0, "channels"); + tell_mem_status_dcc(DP_STDOUT); + } + } + egg_memcpy(&nowtm, localtime(&now), sizeof(struct tm)); + if (nowtm.tm_min != lastmin) { + int i = 0; + + /* Once a minute */ + lastmin = (lastmin + 1) % 60; + call_hook(HOOK_MINUTELY); + check_expired_ignores(); + autolink_cycle(NULL); /* Attempt autolinks */ + /* In case for some reason more than 1 min has passed: */ + while (nowtm.tm_min != lastmin) { + /* Timer drift, dammit */ + debug2("timer: drift (lastmin=%d, now=%d)", lastmin, nowtm.tm_min); + i++; + lastmin = (lastmin + 1) % 60; + call_hook(HOOK_MINUTELY); + } + if (i > 1) + putlog(LOG_MISC, "*", "(!) timer drift -- spun %d minutes", i); + miltime = (nowtm.tm_hour * 100) + (nowtm.tm_min); + if (((int) (nowtm.tm_min / 5) * 5) == (nowtm.tm_min)) { /* 5 min */ + call_hook(HOOK_5MINUTELY); + check_botnet_pings(); + if (!quick_logs) { + flushlogs(); + check_logsize(); + } + if (!miltime) { /* At midnight */ + char s[25]; + int j; + + strncpyz(s, ctime(&now), sizeof s); + putlog(LOG_ALL, "*", "--- %.11s%s", s, s + 20); + call_hook(HOOK_BACKUP); + for (j = 0; j < max_logs; j++) { + if (logs[j].filename != NULL && logs[j].f != NULL) { + fclose(logs[j].f); + logs[j].f = NULL; + } + } + } + } + if (nowtm.tm_min == notify_users_at) + call_hook(HOOK_HOURLY); + /* These no longer need checking since they are all check vs minutely + * settings and we only get this far on the minute. + */ + if (miltime == switch_logfiles_at) { + call_hook(HOOK_DAILY); + if (!keep_all_logs) { + putlog(LOG_MISC, "*", MISC_LOGSWITCH); + for (i = 0; i < max_logs; i++) + if (logs[i].filename) { + char s[1024]; + + if (logs[i].f) { + fclose(logs[i].f); + logs[i].f = NULL; + } + egg_snprintf(s, sizeof s, "%s.yesterday", logs[i].filename); + unlink(s); + movefile(logs[i].filename, s); + } + } + } + } +} + +static void core_minutely() +{ + check_tcl_time(&nowtm); + do_check_timers(&timer); + if (quick_logs != 0) { + flushlogs(); + check_logsize(); + } +} + +static void core_hourly() +{ + write_userfile(-1); +} + +static void event_rehash() +{ + check_tcl_event("rehash"); +} + +static void event_prerehash() +{ + check_tcl_event("prerehash"); +} + +static void event_save() +{ + check_tcl_event("save"); +} + +static void event_logfile() +{ + check_tcl_event("logfile"); +} + +static void event_resettraffic() +{ + otraffic_irc += otraffic_irc_today; + itraffic_irc += itraffic_irc_today; + otraffic_bn += otraffic_bn_today; + itraffic_bn += itraffic_bn_today; + otraffic_dcc += otraffic_dcc_today; + itraffic_dcc += itraffic_dcc_today; + otraffic_unknown += otraffic_unknown_today; + itraffic_unknown += itraffic_unknown_today; + otraffic_trans += otraffic_trans_today; + itraffic_trans += itraffic_trans_today; + otraffic_irc_today = otraffic_bn_today = 0; + otraffic_dcc_today = otraffic_unknown_today = 0; + itraffic_irc_today = itraffic_bn_today = 0; + itraffic_dcc_today = itraffic_unknown_today = 0; + itraffic_trans_today = otraffic_trans_today = 0; +} + +static void event_loaded() +{ + check_tcl_event("loaded"); +} + +void kill_tcl(); +extern module_entry *module_list; +void restart_chons(); + +#ifdef STATIC +void check_static(char *, char *(*)()); + +#include "mod/static.h" +#endif +int init_mem(); +int init_dcc_max(); +int init_userent(); +int init_misc(); +int init_bots(); +int init_net(); +int init_modules(); +int init_tcl(int, char **); +int init_language(int); + +void patch(const char *str) +{ + char *p = strchr(egg_version, '+'); + + if (!p) + p = &egg_version[strlen(egg_version)]; + sprintf(p, "+%s", str); + egg_numver++; + sprintf(&egg_xtra[strlen(egg_xtra)], " %s", str); +} + +static inline void garbage_collect(void) +{ + static u_8bit_t run_cnt = 0; + + if (run_cnt == 3) + garbage_collect_tclhash(); + else + run_cnt++; +} + +int main(int argc, char **argv) +{ + int xx, i; + char buf[520], s[25]; + FILE *f; + struct sigaction sv; + struct chanset_t *chan; + +#ifndef ENABLE_STRIP + /* Make sure it can write core, if you make debug. Else it's pretty + * useless (dw) + */ + { + struct rlimit cdlim; + + cdlim.rlim_cur = RLIM_INFINITY; + cdlim.rlim_max = RLIM_INFINITY; + setrlimit(RLIMIT_CORE, &cdlim); + } +#endif + + /* Initialise context list */ + for (i = 0; i < 16; i++) + Context; + +#include "patch.h" + /* Version info! */ + egg_snprintf(ver, sizeof ver, "eggdrop v%s", egg_version); + egg_snprintf(version, sizeof version, + "Eggdrop v%s (C) 1997 Robey Pointer (C) 2008 Eggheads", + egg_version); + /* Now add on the patchlevel (for Tcl) */ + sprintf(&egg_version[strlen(egg_version)], " %u", egg_numver); + strcat(egg_version, egg_xtra); +#ifdef STOP_UAC + { + int nvpair[2]; + + nvpair[0] = SSIN_UACPROC; + nvpair[1] = UAC_NOPRINT; + setsysinfo(SSI_NVPAIRS, (char *) nvpair, 1, NULL, 0); + } +#endif + + /* Set up error traps: */ + sv.sa_handler = got_bus; + sigemptyset(&sv.sa_mask); +#ifdef SA_RESETHAND + sv.sa_flags = SA_RESETHAND; +#else + sv.sa_flags = 0; +#endif + sigaction(SIGBUS, &sv, NULL); + sv.sa_handler = got_segv; + sigaction(SIGSEGV, &sv, NULL); +#ifdef SA_RESETHAND + sv.sa_flags = 0; +#endif + sv.sa_handler = got_fpe; + sigaction(SIGFPE, &sv, NULL); + sv.sa_handler = got_term; + sigaction(SIGTERM, &sv, NULL); + sv.sa_handler = got_hup; + sigaction(SIGHUP, &sv, NULL); + sv.sa_handler = got_quit; + sigaction(SIGQUIT, &sv, NULL); + sv.sa_handler = SIG_IGN; + sigaction(SIGPIPE, &sv, NULL); + sv.sa_handler = got_ill; + sigaction(SIGILL, &sv, NULL); + sv.sa_handler = got_alarm; + sigaction(SIGALRM, &sv, NULL); + + /* Initialize variables and stuff */ + now = time(NULL); + chanset = NULL; + egg_memcpy(&nowtm, localtime(&now), sizeof(struct tm)); + lastmin = nowtm.tm_min; + srandom((unsigned int) (now % (getpid() + getppid()))); + init_mem(); + init_language(1); + if (argc > 1) + for (i = 1; i < argc; i++) + do_arg(argv[i]); + printf("\n%s\n", version); + + /* Don't allow eggdrop to run as root */ + if (((int) getuid() == 0) || ((int) geteuid() == 0)) + fatal("ERROR: Eggdrop will not run as root!", 0); + + init_dcc_max(); + init_userent(); + init_misc(); + init_bots(); + init_net(); + init_modules(); + if (backgrd) + bg_prepare_split(); + init_tcl(argc, argv); + init_language(0); +#ifdef STATIC + link_statics(); +#endif + strncpyz(s, ctime(&now), sizeof s); + strcpy(&s[11], &s[20]); + putlog(LOG_ALL, "*", "--- Loading %s (%s)", ver, s); + chanprog(); + if (!encrypt_pass) { + printf(MOD_NOCRYPT); + bg_send_quit(BG_ABORT); + exit(1); + } + i = 0; + for (chan = chanset; chan; chan = chan->next) + i++; + putlog(LOG_MISC, "*", "=== %s: %d channels, %d users.", + botnetnick, i, count_users(userlist)); + cache_miss = 0; + cache_hit = 0; + if (!pid_file[0]) + egg_snprintf(pid_file, sizeof pid_file, "pid.%s", botnetnick); + + /* Check for pre-existing eggdrop! */ + f = fopen(pid_file, "r"); + if (f != NULL) { + fgets(s, 10, f); + xx = atoi(s); + kill(xx, SIGCHLD); /* Meaningless kill to determine if pid + * is used */ + if (errno != ESRCH) { + printf(EGG_RUNNING1, botnetnick); + printf(EGG_RUNNING2, pid_file); + bg_send_quit(BG_ABORT); + exit(1); + } + } + + /* Move into background? */ + if (backgrd) { +#ifndef CYGWIN_HACKS + bg_do_split(); + } else { /* !backgrd */ +#endif + xx = getpid(); + if (xx != 0) { + FILE *fp; + + /* Write pid to file */ + unlink(pid_file); + fp = fopen(pid_file, "w"); + if (fp != NULL) { + fprintf(fp, "%u\n", xx); + if (fflush(fp)) { + /* Let the bot live since this doesn't appear to be a botchk */ + printf(EGG_NOWRITE, pid_file); + fclose(fp); + unlink(pid_file); + } else + fclose(fp); + } else + printf(EGG_NOWRITE, pid_file); +#ifdef CYGWIN_HACKS + printf("Launched into the background (pid: %d)\n\n", xx); +#endif + } + } + + use_stderr = 0; /* Stop writing to stderr now */ + if (backgrd) { + /* Ok, try to disassociate from controlling terminal (finger cross) */ +#if defined(HAVE_SETPGID) && !defined(CYGWIN_HACKS) + setpgid(0, 0); +#endif + /* Tcl wants the stdin, stdout and stderr file handles kept open. */ + freopen("/dev/null", "r", stdin); + freopen("/dev/null", "w", stdout); + freopen("/dev/null", "w", stderr); +#ifdef CYGWIN_HACKS + FreeConsole(); +#endif + } + + /* Terminal emulating dcc chat */ + if (!backgrd && term_z) { + int n = new_dcc(&DCC_CHAT, sizeof(struct chat_info)); + + dcc[n].addr = iptolong(getmyip()); + dcc[n].sock = STDOUT; + dcc[n].timeval = now; + dcc[n].u.chat->con_flags = conmask; + dcc[n].u.chat->strip_flags = STRIP_ALL; + dcc[n].status = STAT_ECHO; + strcpy(dcc[n].nick, "HQ"); + strcpy(dcc[n].host, "llama@console"); + /* HACK: Workaround not to pass literal "HQ" as a non-const arg */ + dcc[n].user = get_user_by_handle(userlist, dcc[n].nick); + /* Make sure there's an innocuous HQ user if needed */ + if (!dcc[n].user) { + userlist = adduser(userlist, dcc[n].nick, "none", "-", USER_PARTY); + dcc[n].user = get_user_by_handle(userlist, dcc[n].nick); + } + setsock(STDOUT, 0); /* Entry in net table */ + dprintf(n, "\n### ENTERING DCC CHAT SIMULATION ###\n\n"); + dcc_chatter(n); + } + + then = now; + online_since = now; + autolink_cycle(NULL); /* Hurry and connect to tandem bots */ + add_help_reference("cmds1.help"); + add_help_reference("cmds2.help"); + add_help_reference("core.help"); + add_hook(HOOK_SECONDLY, (Function) core_secondly); + add_hook(HOOK_MINUTELY, (Function) core_minutely); + add_hook(HOOK_HOURLY, (Function) core_hourly); + add_hook(HOOK_REHASH, (Function) event_rehash); + add_hook(HOOK_PRE_REHASH, (Function) event_prerehash); + add_hook(HOOK_USERFILE, (Function) event_save); + add_hook(HOOK_BACKUP, (Function) backup_userfile); + add_hook(HOOK_DAILY, (Function) event_logfile); + add_hook(HOOK_DAILY, (Function) event_resettraffic); + add_hook(HOOK_LOADED, (Function) event_loaded); + + call_hook(HOOK_LOADED); + + debug0("main: entering loop"); + while (1) { + int socket_cleanup = 0; + +#ifdef USE_TCL_EVENTS + /* Process a single tcl event */ + Tcl_DoOneEvent(TCL_ALL_EVENTS | TCL_DONT_WAIT); +#endif /* USE_TCL_EVENTS */ + + /* Lets move some of this here, reducing the numer of actual + * calls to periodic_timers + */ + now = time(NULL); + random(); /* Woop, lets really jumble things */ + if (now != then) { /* Once a second */ + call_hook(HOOK_SECONDLY); + then = now; + } + + /* Only do this every so often. */ + if (!socket_cleanup) { + socket_cleanup = 5; + + /* Remove dead dcc entries. */ + dcc_remove_lost(); + + /* Check for server or dcc activity. */ + dequeue_sockets(); + } else + socket_cleanup--; + + /* Free unused structures. */ + garbage_collect(); + + xx = sockgets(buf, &i); + if (xx >= 0) { /* Non-error */ + int idx; + + for (idx = 0; idx < dcc_total; idx++) + if (dcc[idx].sock == xx) { + if (dcc[idx].type && dcc[idx].type->activity) { + /* Traffic stats */ + if (dcc[idx].type->name) { + if (!strncmp(dcc[idx].type->name, "BOT", 3)) + itraffic_bn_today += strlen(buf) + 1; + else if (!strcmp(dcc[idx].type->name, "SERVER")) + itraffic_irc_today += strlen(buf) + 1; + else if (!strncmp(dcc[idx].type->name, "CHAT", 4)) + itraffic_dcc_today += strlen(buf) + 1; + else if (!strncmp(dcc[idx].type->name, "FILES", 5)) + itraffic_dcc_today += strlen(buf) + 1; + else if (!strcmp(dcc[idx].type->name, "SEND")) + itraffic_trans_today += strlen(buf) + 1; + else if (!strncmp(dcc[idx].type->name, "GET", 3)) + itraffic_trans_today += strlen(buf) + 1; + else + itraffic_unknown_today += strlen(buf) + 1; + } + dcc[idx].type->activity(idx, buf, i); + } else + putlog(LOG_MISC, "*", + "!!! untrapped dcc activity: type %s, sock %d", + dcc[idx].type->name, dcc[idx].sock); + break; + } + } else if (xx == -1) { /* EOF from someone */ + int idx; + + if (i == STDOUT && !backgrd) + fatal("END OF FILE ON TERMINAL", 0); + for (idx = 0; idx < dcc_total; idx++) + if (dcc[idx].sock == i) { + if (dcc[idx].type && dcc[idx].type->eof) + dcc[idx].type->eof(idx); + else { + putlog(LOG_MISC, "*", + "*** ATTENTION: DEAD SOCKET (%d) OF TYPE %s UNTRAPPED", + i, dcc[idx].type ? dcc[idx].type->name : "*UNKNOWN*"); + killsock(i); + lostdcc(idx); + } + idx = dcc_total + 1; + } + if (idx == dcc_total) { + putlog(LOG_MISC, "*", + "(@) EOF socket %d, not a dcc socket, not anything.", i); + close(i); + killsock(i); + } + } else if (xx == -2 && errno != EINTR) { /* select() error */ + putlog(LOG_MISC, "*", "* Socket error #%d; recovering.", errno); + for (i = 0; i < dcc_total; i++) { + if ((fcntl(dcc[i].sock, F_GETFD, 0) == -1) && (errno == EBADF)) { + putlog(LOG_MISC, "*", + "DCC socket %d (type %d, name '%s') expired -- pfft", + dcc[i].sock, dcc[i].type, dcc[i].nick); + killsock(dcc[i].sock); + lostdcc(i); + i--; + } + } + } else if (xx == -3) { + call_hook(HOOK_IDLE); + socket_cleanup = 0; /* If we've been idle, cleanup & flush */ + } + + if (do_restart) { + if (do_restart == -2) + rehash(); + else { + /* Unload as many modules as possible */ + int f = 1; + module_entry *p; + Function startfunc; + char name[256]; + + /* oops, I guess we should call this event before tcl is restarted */ + check_tcl_event("prerestart"); + + while (f) { + f = 0; + for (p = module_list; p != NULL; p = p->next) { + dependancy *d = dependancy_list; + int ok = 1; + + while (ok && d) { + if (d->needed == p) + ok = 0; + d = d->next; + } + if (ok) { + strcpy(name, p->name); + if (module_unload(name, botnetnick) == NULL) { + f = 1; + break; + } + } + } + } + + /* Make sure we don't have any modules left hanging around other than + * "eggdrop" and the two that are supposed to be. + */ + for (f = 0, p = module_list; p; p = p->next) { + if (strcmp(p->name, "eggdrop") && strcmp(p->name, "encryption") && + strcmp(p->name, "uptime")) { + f++; + } + } + if (f != 0) { + putlog(LOG_MISC, "*", MOD_STAGNANT); + } + + flushlogs(); + kill_tcl(); + init_tcl(argc, argv); + init_language(0); + + /* this resets our modules which we didn't unload (encryption and uptime) */ + for (p = module_list; p; p = p->next) { + if (p->funcs) { + startfunc = p->funcs[MODCALL_START]; + startfunc(NULL); + } + } + + rehash(); + restart_chons(); + call_hook(HOOK_LOADED); + } + + do_restart = 0; + } + } +}