[cvslog] (2003-04-16 01:03:14 UTC) Module eggdrop1.6: Change committed

cvslog cvs at tsss.org
Tue Apr 15 19:03:14 CST 2003


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2003-04-16 01:03:14 UTC
Commited by: Jeff Fisher <guppy at techmonkeys.org>

Modified files:
     scripts/cmd_resolve.tcl

Log message:

couple of small things in cmd_resolve.tcl

---------------------- diff included ----------------------
Index: eggdrop1.6/scripts/cmd_resolve.tcl
diff -u eggdrop1.6/scripts/cmd_resolve.tcl:1.3 eggdrop1.6/scripts/cmd_resolve.tcl:1.4
--- eggdrop1.6/scripts/cmd_resolve.tcl:1.3	Thu Nov 15 00:28:35 2001
+++ eggdrop1.6/scripts/cmd_resolve.tcl	Tue Apr 15 20:03:04 2003
@@ -2,43 +2,44 @@
 # cmd_resolve.tcl
 #  written by Jeff Fisher (guppy at eggheads.org)
 #
-# This script adds the command '.resolve' which can be used to lookup hostnames
-# or ip addresses in the partyline without causing the bot to block while doing
-# so thanks to the dns module.
+# This script adds the commands '.resolve' and '.dns' which can be used to
+# lookup hostnames or ip addresses in the partyline without causing the bot
+# to block while doing so thanks to the dns module.
 #
 # updates
 # -------
+#  15Apr2003: fixed a logging bug and stop using regexp incorrectly
 #  05Nov2000: fixed a nasty security hole, .resolve [die] <grin>
 #  04Nov2000: first version
 #
-# $Id: cmd_resolve.tcl,v 1.3 2001/11/15 06:28:35 guppy Exp $
+# $Id: cmd_resolve.tcl,v 1.4 2003/04/16 01:03:04 guppy Exp $
 
 bind dcc -|- resolve resolve_cmd
 bind dcc -|- dns resolve_cmd
 
 proc resolve_cmd {hand idx arg} {
+  global lastbind
   if {[scan $arg "%s" hostip] != 1} {
-    global lastbind
     putidx $idx "Usage: $lastbind <host or ip>"
   } else {
     putidx $idx "Looking up $hostip ..."
     set hostip [split $hostip]
-    dnslookup $hostip resolve_callback $idx $hostip
+    dnslookup $hostip resolve_callback $idx $hostip $lastbind
   }
   return 0
 }
 
-proc resolve_callback {ip host status idx hostip} {
+proc resolve_callback {ip host status idx hostip cmd} {
   if {![valididx $idx]} {
     return 0
   } elseif {!$status} {
     putidx $idx "Unable to resolve $hostip"
-  } elseif {[regexp -nocase -- $ip $hostip]} {
+  } elseif {[string tolower $ip] == [string tolower $hostip]} {
     putidx $idx "Resolved $ip to $host"
   } else {
     putidx $idx "Resolved $host to $ip"
   }
-  putcmdlog "#[idx2hand $idx]# resolve $hostip"
+  putcmdlog "#[idx2hand $idx]# $cmd $hostip"
   return 0
 }
 
----------------------- End of diff -----------------------


More information about the Changes mailing list