[cvslog] (2002-10-11 00:49:30 UTC) Module eggdrop1.7: Change committed

cvslog cvs at tsss.org
Thu Oct 10 19:50:01 CST 2002


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.7
Commit time: 2002-10-11 00:49:30 UTC
Commited by: Will Buckner <wcc at techmonkeys.org>

Modified files:
     modules/channels/channels.c modules/channels/tclchan.c
     modules/irc/chan.c modules/irc/cmdsirc.c modules/irc/irc.c
     modules/transfer/transfer.c src/chan.h src/cmds.c src/egg.h
     src/net.c src/patch.h

Added files:
     misc/addpatch

Removed files:
     eggdrop.simple.conf

Log message:

* Completed 1.6<>1.7 patch synch.

---------------------- diff included ----------------------
Index: eggdrop1.7/eggdrop.simple.conf
diff -u eggdrop1.7/eggdrop.simple.conf:1.24 eggdrop1.7/eggdrop.simple.conf:removed
--- eggdrop1.7/eggdrop.simple.conf:1.24	Tue May 21 16:23:01 2002
+++ eggdrop1.7/eggdrop.simple.conf	Thu Oct 10 19:49:30 2002
@@ -1,127 +0,0 @@
-#! /path/to/executable/eggdrop -ptclscript
-# ^- set that to the directory eggdrop is in ie "#! /home/lamest/egg/eggdrop"
-#  Make sure you preload a config parser using the -p<name> parameter.
-#
-# $Id: eggdrop.simple.conf,v 1.24 2002/05/21 21:23:01 stdarg Exp $
-#
-# This is a sample configuration file for your bot.  You will definitely
-# want to edit this, to set up your bot.  Right now it creates a bot called
-# "LamestBot" which sits on channel #lamest.
-#
-# more options can be found in files in doc/settings/
-#
-# IMPORTANT: Remember to make install and cd to the directory it created
-# (~/eggdrop by default) before you continue, running the bot from
-# eggdrop1.6.x/ will not work.
-#
-# PLEASE EDIT THIS FILE COMPLETELY! YOUR BOT WILL NOT FUNCTION PROPERLY IF
-# YOU DO NOT CONFIGURE IT CORRECTLY! WE CAN NOT STRESS THIS ENOUGH!
-
-# don't edit these 12 lines now!!
-set mod_path "modules/"
-set help_path "help/"
-set text_path "text/"
-loadmodule channels
-loadmodule server
-loadmodule ctcp
-loadmodule irc
-loadmodule notes
-loadmodule console
-loadmodule uptime
-loadmodule blowfish
-
-# start configuring here!
-
-##### variables:
-set nick "Lamestbot"
-# the nick of the bot, that which it uses on IRC, and on the botnet
-# unless you specify a sperate botnet-nick
-
-set altnick "Llamab?t"
-# an alternative nick to use if the nick specified by 'set nick' is
-# unavailable. All '?' characters will be replaced by a random number.
-
-set realname "/msg LamestBot hello"
-# what to display in the real-name field for the bot
-
-# tcl code to run (if any) when first connecting to a server
-
-bind event - init-server event:init_server 
-
-proc event:init_server {type} { 
-  global botnick
-  putserv -quick "MODE $botnick +i-ws"
-}
-
-# the server list -- the bot will start at the first server listed, and cycle
-# through them whenever it's disconnected
-# (please note: you need to change these servers to YOUR network's servers)
-
-# server_add <host> [port] [pass] <-- port and pass are optional
-server_add "you.need.to.change.this" 6667
-server_add "and.this.too" 6668
-
-channel add #lamest {
-  chanmode "+nt-likm"
-  idle-kick 0
-  stopnethack-mode 0
-}
-
-channel set #lamest +enforcebans +dynamicbans +userbans +honor-global-bans
-channel set #lamest +dynamicexempts +userexempts +honor-global-exempts
-channel set #lamest +dynamicinvites +userinvites +honor-global-invites
-channel set #lamest -autoop -bitch +protectops +protectfriends +dontkickops
-channel set #lamest +greet +statuslog
-channel set #lamest +revenge +autovoice
-channel set #lamest -secret -shared +cycle
-channel set #lamest -inactive +nodesynch
-
-# Uncomment and edit one pair of the folowing files for network specific
-# features. 
-source nettype/custom.server.conf
-#source nettype/dalnet.server.conf
-#source nettype/efnet.server.conf
-#source nettype/hybridefnet.server.conf
-#source nettype/ircnet.server.conf
-#source nettype/undernet.server.conf
-source nettype/custom.irc.conf
-#source nettype/dalnet.irc.conf
-#source nettype/efnet.irc.conf
-#source nettype/hybridefnet.irc.conf
-#source nettype/ircnet.irc.conf
-#source nettype/undernet.irc.conf
-
-
-# various stuff...
-
-listen 3333 all
-# set here the port where eggdrop should listen von telnet connections
-
-#set owner "MrLame, MrsLame"
-# set here the list of owners of the bot
-
-
-# files & directories
-
-set userfile "LamestBot.user"
-set chanfile "LamestBot.chan"
-set temp_path "/tmp"
-logfile msbxco * "logs/eggdrop.log"
-logfile jpk #lamest "logs/lamest.log"
-
-
-# default console flags
-set console "mkcobxs"
-
-
-# you have to remove this line to make your bot work
-die "you didn't edit your config file! that's a NO NO"
-
-##### SCRIPTS #####
-
-# these are some commonly loaded (and needed) scripts.
-source scripts/alltools.tcl
-source scripts/action.fix.tcl
-source scripts/compat.tcl
-source scripts/userinfo.tcl
-loadhelp userinfo.help
Index: eggdrop1.7/misc/addpatch
diff -u /dev/null eggdrop1.7/misc/addpatch:1.1
--- /dev/null	Thu Oct 10 19:49:30 2002
+++ eggdrop1.7/misc/addpatch	Thu Oct 10 19:49:20 2002
@@ -0,0 +1,51 @@
+#! /bin/sh
+#
+# egg_patchpatch -- Patch src/path.h.
+#
+#                   Copyright (C) 2000  Fabian Knittel <fknittel at gmx.de>
+#                   Released under the terms of the GNU General Public License.
+
+
+show_usage()
+{
+	echo "Usage: $0 <patch-name> [unixtime]"
+	echo ""
+	echo " patch-name - Name of last patch added."
+	echo " unixtime   - Some unixtime number or 'now'. Default is 'now'."
+	exit 1
+}
+
+if test "x$1" = "x"; then
+	show_usage;
+else
+	patch_name=$1
+fi
+if test "x$2" = "x"; then
+	unix_time=`date +%s`
+	echo "Setting unix time to now."
+else
+	unix_time=$2
+fi
+
+if test "${unix_time}" = now; then
+	unix_time=`date +%s`
+	echo "Setting unix time to now."
+fi
+
+if test ! -f src/main.c; then
+	echo "You are not in the eggdrop root directory."
+	exit 1
+fi
+
+echo "Patching src/patch.h:"
+echo "   unix time: ${unix_time}, patch name: ${patch_name}"
+if sed src/patch.h -e "s/^patch.*\")\(.*current unixtime.*\)/patch(\"${unix_time}\")\1/" -e "s/^patch.*);$/patch(\"${patch_name}\");/" > src/patch.h_
+then
+	mv src/patch.h_ src/patch.h
+else
+	echo "Failed to adjust src/patch.h"
+	exit 1
+fi
+
+exit 0
+
Index: eggdrop1.7/modules/channels/channels.c
diff -u eggdrop1.7/modules/channels/channels.c:1.16 eggdrop1.7/modules/channels/channels.c:1.17
--- eggdrop1.7/modules/channels/channels.c:1.16	Thu Oct 10 00:50:11 2002
+++ eggdrop1.7/modules/channels/channels.c	Thu Oct 10 19:49:20 2002
@@ -23,7 +23,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: channels.c,v 1.16 2002/10/10 05:50:11 wcc Exp $";
+static const char rcsid[] = "$Id: channels.c,v 1.17 2002/10/11 00:49:20 wcc Exp $";
 #endif
 
 #define MODULE_NAME "channels"
@@ -383,6 +383,7 @@
     fprintf(f, "channel %s %s%schanmode %s idle-kick %d stopnethack-mode %d \
 revenge-mode %d flood-chan %d:%d flood-ctcp %d:%d flood-join %d:%d \
 flood-kick %d:%d flood-deop %d:%d flood-nick %d:%d aop-delay %d:%d \
+ban-time %d exempt-time %d invite-time %d \
 %cenforcebans %cdynamicbans %cuserbans %cautoop %cbitch \
 %cgreet %cprotectops %cprotectfriends %cdontkickops \
 %cstatuslog %crevenge %crevengebot %cautovoice %csecret \
@@ -403,6 +404,9 @@
 	chan->flood_deop_thr, chan->flood_deop_time,
 	chan->flood_nick_thr, chan->flood_nick_time,
 	chan->aop_min, chan->aop_max,
+	chan->ban_time,
+	chan->exempt_time,
+	chan->invite_time,
 	PLSMNS(channel_enforcebans(chan)),
 	PLSMNS(channel_dynamicbans(chan)),
 	PLSMNS(!channel_nouserbans(chan)),
Index: eggdrop1.7/modules/channels/tclchan.c
diff -u eggdrop1.7/modules/channels/tclchan.c:1.20 eggdrop1.7/modules/channels/tclchan.c:1.21
--- eggdrop1.7/modules/channels/tclchan.c:1.20	Thu Oct 10 00:50:11 2002
+++ eggdrop1.7/modules/channels/tclchan.c	Thu Oct 10 19:49:20 2002
@@ -22,7 +22,7 @@
 
 /* FIXME: #include mess
 #ifndef lint
-static const char rcsid[] = "$Id: tclchan.c,v 1.20 2002/10/10 05:50:11 wcc Exp $";
+static const char rcsid[] = "$Id: tclchan.c,v 1.21 2002/10/11 00:49:20 wcc Exp $";
 #endif
 */
 
@@ -362,6 +362,7 @@
       old_mode_mns_prot = chan->mode_mns_prot,
       old_mode_pls_prot = chan->mode_pls_prot;
   struct udef_struct *ul = udef;
+  char s[121];
   module_entry *me;
 
   for (i = 0; i < items; i++) {
@@ -372,9 +373,9 @@
 	  Tcl_AppendResult(irp, "channel chanmode needs argument", NULL);
 	return TCL_ERROR;
       }
-      if (strlen(item[i]) > 120)
-	item[i][120] = 0;
-      set_mode_protect(chan, item[i]);
+      strncpy(s, item[i], 120);
+      s[120] = 0;
+      set_mode_protect(chan, s);
     } else if (!strcmp(item[i], "idle-kick")) {
       i++;
       if (i >= items) {
Index: eggdrop1.7/modules/irc/chan.c
diff -u eggdrop1.7/modules/irc/chan.c:1.25 eggdrop1.7/modules/irc/chan.c:1.26
--- eggdrop1.7/modules/irc/chan.c:1.25	Thu Oct 10 00:50:12 2002
+++ eggdrop1.7/modules/irc/chan.c	Thu Oct 10 19:49:20 2002
@@ -28,7 +28,7 @@
 
 /* FIXME: #include mess
 #ifndef lint
-static const char rcsid[] = "$Id: chan.c,v 1.25 2002/10/10 05:50:12 wcc Exp $";
+static const char rcsid[] = "$Id: chan.c,v 1.26 2002/10/11 00:49:20 wcc Exp $";
 #endif
 */
 
@@ -710,52 +710,51 @@
   if (!m || match_my_nick(nick) || !me_op(chan))
     return;
 
-  sprintf(s, "%s!%s", m->nick, m->userhost);
-  /* if channel user is current a chanop */
-  if (chan_hasop(m)) {
-  /* if user is channel deop */
-    if (chan_deop(*fr) ||
-	/* OR global deop and NOT channel op */
-	(glob_deop(*fr) && !chan_op(*fr))) {
-      /* de-op! */
-      add_mode(chan, '-', 'o', m->nick);
-      /* if channel mode is bitch */
-    } else if (channel_bitch(chan) &&
-	       /* AND the user isnt a channel op */
-	       (!chan_op(*fr) &&
-		/* AND the user isnt a global op, (or IS a chan deop) */
-		!(glob_op(*fr) && !chan_deop(*fr)))) {
-      /* de-op! mmmbop! */
-      add_mode(chan, '-', 'o', m->nick);
-    }
-  }
-  /* check vs invites */
-  refresh_invite(chan, s);
-  /* don't kickban if permanent exempted */
-  if (!(use_exempts && is_perm_exempted(chan, s))) {
-    /* permanent banned? */
-    refresh_ban_kick(chan, s, m->nick);
-  }
-  /* now lets look at de-op'd ppl */
-  if (!chan_hasop(m) &&
-      /* if they're an op, channel or global (without channel +d) */
-      (chan_op(*fr) || (glob_op(*fr) && !chan_deop(*fr))) &&
-      /* and the channel is op on join, or they are auto-opped */
-      (channel_autoop(chan) || (glob_autoop(*fr) || chan_autoop(*fr)))) {
-    /* op them! */
-    add_mode(chan, '+', 'o', m->nick);
-    /* otherwise, lets check +v stuff if the llamas want it */
-  } else if (!chan_hasvoice(m) && !chan_hasop(m)) {
-    if ((channel_autovoice(chan) && !chan_quiet(*fr) &&
-	 (chan_voice(*fr) || glob_voice(*fr))) ||
-	  (!chan_quiet(*fr) && (glob_gvoice(*fr) || chan_gvoice(*fr)))) {
+  if (chan_hasop(m) && ((chan_deop(*fr) || (glob_deop(*fr) &&
+      !chan_op(*fr))) || (channel_bitch(chan) && (!chan_op(*fr) &&
+      !(glob_op(*fr) && !chan_deop(*fr))))))
+    add_mode(chan, '-', 'o', m->nick);
+  if (!chan_hasop(m) && (chan_op(*fr) || (glob_op(*fr) &&
+      !chan_deop(*fr))) && (channel_autoop(chan) || glob_autoop(*fr) ||
+      chan_autoop(*fr))) {
+    if (!chan->aop_min)
+      add_mode(chan, '+', 'o', m->nick);
+    else {
+      set_delay(chan, m->nick);
+      m->flags |= SENTOP;
+    }
+  }
+
+  if (chan_hasvoice(m) && (chan_quiet(*fr) || (glob_quiet(*fr) &&
+     !chan_voice(*fr))))
+    add_mode(chan, '-', 'v', m->nick);
+  if (!chan_hasvoice(m) && !chan_hasop(m) && (chan_voice(*fr) ||
+      (glob_voice(*fr) && !chan_quiet(*fr))) && (channel_autovoice(chan) ||
+      glob_gvoice(*fr) || chan_gvoice(*fr))) {
+    if (!chan->aop_min)
       add_mode(chan, '+', 'v', m->nick);
+    else {
+      set_delay(chan, m->nick);
+      m->flags |= SENTVOICE;
     }
-    /* do they have a voice on the channel */
-    if (chan_hasvoice(m) &&
-	/* do they have the +q & no +v */
-	(chan_quiet(*fr) || (glob_quiet(*fr) && !chan_voice(*fr)))) {
-      add_mode(chan, '-', 'v', m->nick);
+  }
+
+  sprintf(s, "%s!%s", m->nick, m->userhost);
+  if (use_invites && (u_match_mask(global_invites,s) ||
+      u_match_mask(chan->invites, s)))
+    refresh_invite(chan, s);
+  if (!(use_exempts && (u_match_mask(global_exempts ,s) ||
+      u_match_mask(chan->exempts, s)))) {
+    if (u_match_mask(global_bans, s) || u_match_mask(chan->bans, s))
+      refresh_ban_kick(chan, s, m->nick);
+    if (!chan_sentkick(m) && (chan_kick(*fr) || glob_kick(*fr)) &&
+	me_op(chan)) {
+      check_exemptlist(chan, s);
+      quickban(chan, m->userhost);
+      p = get_user(&USERENTRY_COMMENT, m->user);
+      dprintf(DP_SERVER, "KICK %s %s :%s\n", chan->name, m->nick,
+	      p ? p : IRC_POLITEKICK);
+      m->flags |= SENTKICK;
     }
   }
 }
Index: eggdrop1.7/modules/irc/cmdsirc.c
diff -u eggdrop1.7/modules/irc/cmdsirc.c:1.12 eggdrop1.7/modules/irc/cmdsirc.c:1.13
--- eggdrop1.7/modules/irc/cmdsirc.c:1.12	Thu Oct 10 00:50:12 2002
+++ eggdrop1.7/modules/irc/cmdsirc.c	Thu Oct 10 19:49:20 2002
@@ -24,7 +24,7 @@
 
 /* FIXME: #include mess
 #ifndef lint
-static const char rcsid[] = "$Id: cmdsirc.c,v 1.12 2002/10/10 05:50:12 wcc Exp $";
+static const char rcsid[] = "$Id: cmdsirc.c,v 1.13 2002/10/11 00:49:20 wcc Exp $";
 #endif
 */
 
@@ -269,8 +269,8 @@
 	    chan->dname);
     return;
   }
-  putlog(LOG_CMDS, "*", "#%s# (%s) voice %s %s", dcc[idx].nick,
-	 dcc[idx].u.chat->con_chan, nick, par);
+  putlog(LOG_CMDS, "*", "#%s# (%s) voice %s", dcc[idx].nick,
+	 chan->dname, nick);
   m = ismember(chan, nick);
   if (!m) {
     dprintf(idx, _("%1$s is not on %2$s.\n"), nick, chan->dname);
@@ -304,8 +304,8 @@
 	    chan->dname);
     return;
   }
-  putlog(LOG_CMDS, "*", "#%s# (%s) devoice %s %s", dcc[idx].nick,
-	 dcc[idx].u.chat->con_chan, nick, par);
+  putlog(LOG_CMDS, "*", "#%s# (%s) devoice %s", dcc[idx].nick,
+	 chan->dname, nick);
   m = ismember(chan, nick);
   if (!m) {
     dprintf(idx, _("%1$s is not on %2$s.\n"), nick, chan->dname);
@@ -339,8 +339,8 @@
 	    chan->dname);
     return;
   }
-  putlog(LOG_CMDS, "*", "#%s# (%s) op %s %s", dcc[idx].nick,
-	 dcc[idx].u.chat->con_chan, nick, par);
+  putlog(LOG_CMDS, "*", "#%s# (%s) op %s", dcc[idx].nick,
+	 chan->dname, nick);
   m = ismember(chan, nick);
   if (!m) {
     dprintf(idx, _("%1$s is not on %2$s.\n"), nick, chan->dname);
@@ -385,8 +385,8 @@
 	    chan->dname);
     return;
   }
-  putlog(LOG_CMDS, "*", "#%s# (%s) deop %s %s", dcc[idx].nick,
-	 dcc[idx].u.chat->con_chan, nick, par);
+  putlog(LOG_CMDS, "*", "#%s# (%s) deop %s", dcc[idx].nick,
+	 chan->dname, nick);
   m = ismember(chan, nick);
   if (!m) {
     dprintf(idx, _("%1$s is not on %2$s.\n"), nick, chan->dname);
@@ -523,8 +523,8 @@
   if (!has_op(idx, par))
     return;
   chname = newsplit(&par);
-  putlog(LOG_CMDS, "*", "#%s# (%s) channel %s", dcc[idx].nick,
-	 dcc[idx].u.chat->con_chan, chname);
+  putlog(LOG_CMDS, "*", "#%s# (%s) channel", dcc[idx].nick,
+	 !chname[0] ? dcc[idx].u.chat->con_chan : chname);
   if (!chname[0])
     chan = findchan_by_dname(dcc[idx].u.chat->con_chan);
   else
@@ -917,15 +917,15 @@
   /* Shouldn't allow people to remove permanent owners (guppy 9Jan1999) */
   if ((glob_owner(victim) && strcasecmp(dcc[idx].nick, nick)) ||
       isowner(u->handle)) {
-    dprintf(idx, _("You can't remove the bot owner!\n"));
+    dprintf(idx, _("You can't remove a bot owner!\n"));
   } else if (glob_botmast(victim) && !glob_owner(user)) {
-    dprintf(idx, _("You can't delete a master!\n"));
+    dprintf(idx, _("You can't remove a bot master!\n"));
   } else if (chan_owner(victim) && !glob_owner(user)) {
     dprintf(idx, _("You can't remove a channel owner!\n"));
   } else if (chan_master(victim) && !(glob_owner(user) || chan_owner(user))) {
-    dprintf(idx, _("You can't delete a channel master!\n"));
+    dprintf(idx, _("You can't remove a channel master!\n"));
   } else if (glob_bot(victim) && !glob_owner(user)) {
-    dprintf(idx, _("You can't delete a bot!\n"));
+    dprintf(idx, _("You can't remove a bot!\n"));
   } else {
     char buf[HANDLEN + 1];
 
Index: eggdrop1.7/modules/irc/irc.c
diff -u eggdrop1.7/modules/irc/irc.c:1.23 eggdrop1.7/modules/irc/irc.c:1.24
--- eggdrop1.7/modules/irc/irc.c:1.23	Thu Oct 10 00:50:12 2002
+++ eggdrop1.7/modules/irc/irc.c	Thu Oct 10 19:49:20 2002
@@ -23,7 +23,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: irc.c,v 1.23 2002/10/10 05:50:12 wcc Exp $";
+static const char rcsid[] = "$Id: irc.c,v 1.24 2002/10/11 00:49:20 wcc Exp $";
 #endif
 
 #define MODULE_NAME "irc"
@@ -750,8 +750,8 @@
   struct chanset_t *chan;
   memberlist *m;
 
-  if (modesperline > 6)
-    modesperline = 6;
+  if (modesperline > MODES_PER_LINE_MAX)
+    modesperline = MODES_PER_LINE_MAX; 
   for (chan = chanset; chan; chan = chan->next) {
     for (m = chan->channel.member; m && m->nick[0]; m = m->next) {
       if (m->delay && m->delay <= now) {
@@ -794,7 +794,7 @@
 	  p = _("pending");
         else if (!any_ops(chan))
           p = _("opless");
-	else if (!me_op(chan))
+	else if ((chan->dname[0] != '+') && !me_op(chan))
 	  p = _("want ops!");
       }
       l = simple_sprintf(ch, "%s%s%s%s, ", chan->dname, p ? "(" : "",
Index: eggdrop1.7/modules/transfer/transfer.c
diff -u eggdrop1.7/modules/transfer/transfer.c:1.16 eggdrop1.7/modules/transfer/transfer.c:1.17
--- eggdrop1.7/modules/transfer/transfer.c:1.16	Thu Oct 10 00:50:12 2002
+++ eggdrop1.7/modules/transfer/transfer.c	Thu Oct 10 19:49:20 2002
@@ -25,7 +25,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: transfer.c,v 1.16 2002/10/10 05:50:12 wcc Exp $";
+static const char rcsid[] = "$Id: transfer.c,v 1.17 2002/10/11 00:49:20 wcc Exp $";
 #endif
 
 #define MODULE_NAME "transfer"
@@ -1418,8 +1418,8 @@
     nfn = buf = replace_spaces(nfn);
   dcc[i].u.xfer->origname = calloc(1, strlen(nfn) + 1);
   strcpy(dcc[i].u.xfer->origname, nfn);
-  strcpy(dcc[i].u.xfer->from, from);
-  strcpy(dcc[i].u.xfer->dir, dir);
+  strlcpy(dcc[i].u.xfer->from, from, NICKLEN);
+  strlcpy(dcc[i].u.xfer->dir, dir, DIRLEN);
   dcc[i].u.xfer->length = dccfilesize;
   dcc[i].timeval = now;
   dcc[i].u.xfer->f = f;
Index: eggdrop1.7/src/chan.h
diff -u eggdrop1.7/src/chan.h:1.31 eggdrop1.7/src/chan.h:1.32
--- eggdrop1.7/src/chan.h:1.31	Thu Oct 10 00:50:12 2002
+++ eggdrop1.7/src/chan.h	Thu Oct 10 19:49:20 2002
@@ -23,7 +23,7 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 /*
- * $Id: chan.h,v 1.31 2002/10/10 05:50:12 wcc Exp $
+ * $Id: chan.h,v 1.32 2002/10/11 00:49:20 wcc Exp $
  */
 
 #ifndef _EGG_CHAN_H
@@ -125,6 +125,8 @@
 #define CHANREGON  0x0800	/* +R -- bahamut			*/
 #define CHANMODR   0x1000	/* +M -- bahamut			*/
 
+#define MODES_PER_LINE_MAX 6
+
 /* For every channel i'm supposed to be active on */
 struct chanset_t {
   struct chanset_t *next;
@@ -174,7 +176,7 @@
   struct {
     char *op;
     int type;
-  } cmode[6];			/* parameter-type mode changes -	*/
+  } cmode[MODES_PER_LINE_MAX];  /* parameter-type mode changes -	*/
   /* detect floods */
   char floodwho[FLOOD_CHAN_MAX][81];
   time_t floodtime[FLOOD_CHAN_MAX];
Index: eggdrop1.7/src/cmds.c
diff -u eggdrop1.7/src/cmds.c:1.108 eggdrop1.7/src/cmds.c:1.109
--- eggdrop1.7/src/cmds.c:1.108	Mon Oct  7 17:36:36 2002
+++ eggdrop1.7/src/cmds.c	Thu Oct 10 19:49:20 2002
@@ -24,7 +24,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: cmds.c,v 1.108 2002/10/07 22:36:36 stdarg Exp $";
+static const char rcsid[] = "$Id: cmds.c,v 1.109 2002/10/11 00:49:20 wcc Exp $";
 #endif
 
 #include "main.h"
@@ -1742,7 +1742,8 @@
   user_t *u2;
   struct list_type *q;
   struct flag_record fr = {FR_CHAN | FR_ANYWH, 0, 0, 0, 0, 0};
-  module_entry *me;
+  struct flag_record fr2 = {FR_GLOBAL | FR_CHAN | FR_ANYWH, 0, 0, 0, 0, 0},
+                     fr  = {FR_GLOBAL | FR_CHAN | FR_ANYWH, 0, 0, 0, 0, 0};
 
   if (!par[0]) {
     dprintf(idx, "Usage: +host [handle] <newhostmask>\n");
@@ -1763,34 +1764,35 @@
     dprintf(idx, _("No such user.\n"));
     return(0);
   }
+  get_user_flagrec(u, &fr, NULL);
   if (strcasecmp(handle, dcc[idx].nick)) {
-    get_user_flagrec(u, &fr, NULL);
-    if ((u->flags & USER_BOTMAST) && !(u->flags & USER_MASTER) &&
-	!(u2->flags & USER_BOT) && !chan_master(fr)) {
+    get_user_flagrec(u2, &fr2, NULL);
+    if (!glob_master(fr) && !glob_bot(fr2) && !chan_master(fr)) {
       dprintf(idx, _("You can't add hostmasks to non-bots.\n"));
       return(0);
     }
-    if (!(u->flags & USER_OWNER) && (u2->flags & USER_BOT) &&
-	(bot_flags(u2) & BOT_SHARE)) {
+    if (!glob_owner(fr) && glob_bot(fr2) && (bot_flags(u2) & BOT_SHARE)) {
       dprintf(idx, _("You can't add hostmasks to share bots.\n"));
       return(0);
     }
-    if ((u2->flags & (USER_OWNER|USER_MASTER)) &&
-	!(u->flags & USER_OWNER) && strcasecmp(handle, dcc[idx].nick)) {
+    if ((glob_owner(fr2) || glob_master(fr2)) && !glob_owner(fr)) {
       dprintf(idx, _("You can't add hostmasks to the bot owner/master.\n"));
       return(0);
     }
-    if (!(u->flags & USER_BOTMAST) && !chan_master(fr)) {
-      dprintf(idx, _("Permission denied.\n"));
+    if ((chan_owner(fr2) || chan_master(fr2)) && !glob_master(fr) &&
+        !glob_owner(fr) && !chan_owner(fr)) {
+      dprintf(idx, "You can't add hostmasks to a channel owner/master.\n");
       return(0);
     }
-  }
-  if (!(u->flags & USER_BOTMAST) && !chan_master(fr)) {
-    if (get_user_by_host(host)) {
-      dprintf(idx, _("You cannot add a host matching another user!\n"));
+    if (!glob_botmast(fr) && !glob_master(fr) && !chan_master(fr)) {
+      dprintf(idx, "Permission denied.\n");
       return(0);
     }
   }
+  if (!glob_botmast(fr) && !chan_master(fr) && get_user_by_host(host)) {
+    dprintf(idx, "You cannot add a host matching another user!\n");
+    return(0);
+  }
   for (q = get_user(&USERENTRY_HOSTS, u); q; q = q->next)
     if (!strcasecmp(q->extra, host)) {
       dprintf(idx, _("That hostmask is already there.\n"));
@@ -1810,7 +1812,8 @@
 {
   char *handle, *host;
   user_t *u2;
-  struct flag_record fr = {FR_CHAN | FR_ANYWH, 0, 0, 0, 0, 0};
+  struct flag_record fr2 = {FR_GLOBAL | FR_CHAN | FR_ANYWH, 0, 0, 0, 0, 0},
+                     fr  = {FR_GLOBAL | FR_CHAN | FR_ANYWH, 0, 0, 0, 0, 0};
   module_entry *me;
 
   if (!par[0]) {
@@ -1833,26 +1836,32 @@
   }
 
   get_user_flagrec(u, &fr, NULL);
+  get_user_flagrec(u2, &fr2, NULL);
   /* check to see if user is +d or +k and don't let them remove hosts */
-  if ((u->flags & USER_DEOP) || chan_deop(fr)) {
-    dprintf(idx, "%s\n", _("You can't remove hosts while having the +d flag."));
+  if (glob_deop(fr) || glob_kick(fr) || chan_deop(fr) || chan_kick (fr)) {
+    dprintf(idx, _("You can't remove hostmasks while having the +d or +k "
+            "flag.\n"));
     return(0);
   }
-
   if (strcasecmp(handle, dcc[idx].nick)) {
-    if (!(u2->flags & USER_BOT) && !(u->flags & USER_MASTER) &&
-	!chan_master(fr)) {
+    if (!glob_master(fr) && !glob_bot(fr2) && !chan_master(fr)) {
       dprintf(idx, _("You can't remove hostmasks from non-bots.\n"));
       return(0);
-    } else if ((u2->flags & USER_BOT) && (bot_flags(u2) & BOT_SHARE) &&
-	       !(u->flags & USER_OWNER)) {
+    }
+    if (glob_bot(fr2) && (bot_flags(u2) & BOT_SHARE) && !glob_owner(fr)) {
       dprintf(idx, _("You can't remove hostmasks from a share bot.\n"));
       return(0);
-    } else if ((u2->flags & (USER_OWNER|USER_MASTER)) &&
-	       !(u->flags & USER_OWNER) && (u2 != u)) {
+    }
+    if ((glob_owner(fr2) || glob_master(fr2)) && !glob_owner(fr)) {
       dprintf(idx, _("You can't remove hostmasks from a bot owner/master.\n"));
       return(0);
-    } else if (!(u->flags & USER_BOTMAST) && !chan_master(fr)) {
+    }
+    if ((chan_owner(fr2) || chan_master(fr2)) && !glob_master(fr) &&
+        !glob_owner(fr) && !chan_owner(fr)) {
+      dprintf(idx, "You can't remove hostmasks from a channel owner/master.\n");
+      return(0);
+    }
+    if (!glob_botmast(fr) && !glob_master(fr) && !chan_master(fr)) {
       dprintf(idx, _("Permission denied.\n"));
       return(0);
     }
Index: eggdrop1.7/src/egg.h
diff -u eggdrop1.7/src/egg.h:1.9 eggdrop1.7/src/egg.h:1.10
--- eggdrop1.7/src/egg.h:1.9	Tue Jun 18 01:12:32 2002
+++ eggdrop1.7/src/egg.h	Thu Oct 10 19:49:20 2002
@@ -24,7 +24,7 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 /*
- * $Id: egg.h,v 1.9 2002/06/18 06:12:32 guppy Exp $
+ * $Id: egg.h,v 1.10 2002/10/11 00:49:20 wcc Exp $
  */
 
 #ifndef _EGG_EGG_H
@@ -58,6 +58,7 @@
 
 #define ADDRMAX		 45
 #define UHOSTMAX	160	/* reasonable, i think?			*/
+#define DIRMAX		512
 #define BADHANDCHARS	"-,+*=:!.@#;$%&"
 
 
@@ -68,6 +69,7 @@
 
 #define NICKLEN         NICKMAX + 1
 #define UHOSTLEN        UHOSTMAX + 1
+#define DIRLEN          DIRMAX + 1
 #define NOTENAMELEN     ((HANDLEN * 2) + 1)
 #define BADNICKCHARS	"-,+*=:!.@#;$%&"
 
@@ -247,7 +249,7 @@
 struct xfer_info {
   char *filename;
   char *origname;
-  char dir[121];		/* used when uploads go to the current dir */
+  char dir[DIRLEN];		/* used when uploads go to the current dir */
   unsigned long length;
   unsigned long acked;
   char buf[4];			/* you only need 5 bytes!		   */
Index: eggdrop1.7/src/net.c
diff -u eggdrop1.7/src/net.c:1.64 eggdrop1.7/src/net.c:1.65
--- eggdrop1.7/src/net.c:1.64	Wed Oct  9 23:41:59 2002
+++ eggdrop1.7/src/net.c	Thu Oct 10 19:49:20 2002
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: net.c,v 1.64 2002/10/10 04:41:59 stdarg Exp $";
+static const char rcsid[] = "$Id: net.c,v 1.65 2002/10/11 00:49:20 wcc Exp $";
 #endif
 
 #include <fcntl.h>
@@ -88,7 +88,8 @@
   
   gethostname(s, sizeof s);
   if ((hp = gethostbyname(s)) == NULL)
-    fatal("Hostname self-lookup failed.", 0);
+    fatal("Hostname self-lookup failed. Please set 'my-ip' in the config "
+          "file.", 0);
   localipv4addr = *((IP*) (hp->h_addr_list[0]));
 
   /* init ADNS */
Index: eggdrop1.7/src/patch.h
diff -u eggdrop1.7/src/patch.h:1.589 eggdrop1.7/src/patch.h:1.590
--- eggdrop1.7/src/patch.h:1.589	Sat Aug 10 04:31:20 2002
+++ eggdrop1.7/src/patch.h	Thu Oct 10 19:49:20 2002
@@ -30,7 +30,7 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 /*
- * $Id: patch.h,v 1.589 2002/08/10 09:31:20 poptix Exp $
+ * $Id: patch.h,v 1.590 2002/10/11 00:49:20 wcc Exp $
  */
 
 #ifndef _EGG_PATCH_H
@@ -44,12 +44,12 @@
  *
  *
  */
-patch("1028971346");          /* current unixtime */
+patch("1034297066");          /* current unixtime */
   /*
    *
    *
    */
-patch("ownerfix");
+patch("synch1.6-10-10-2002");
 /*
  *
  *
----------------------- End of diff -----------------------



More information about the Changes mailing list