diff -ruN ircd-hybrid-6.2/include/config.h ircd-hybrid-6.2cj1/include/config.h
--- ircd-hybrid-6.2/include/config.h	Tue Sep 25 20:04:02 2001
+++ ircd-hybrid-6.2cj1/include/config.h	Fri Jun 21 22:05:29 2002
@@ -151,12 +151,12 @@
 /* NETWORK_NAME
  * Displayed in place of the servername when SERVERHIDE is enabled
  */
-#define NETWORK_NAME "EFnet"
+#define NETWORK_NAME "ChatJunkies"
 
 /* NETWORK_DESC
  * Displayed in place of the server info when SERVERHIDE is enabled
  */
-#define NETWORK_DESC "Eris Free Network"
+#define NETWORK_DESC "chatjunkies.org"
 
 
 /* TS_MAX_DELTA and TS_WARN_DELTA -  allowed delta for TS when another
@@ -537,7 +537,7 @@
  * need not be the same for both, as long as the opposite end has the
  * right password in the opposite line.
  */
-#undef  CRYPT_LINK_PASSWORD
+#define  CRYPT_LINK_PASSWORD
 
 /* IDLE_FROM_MSG - Idle-time reset only from privmsg
  * Idle-time reset only from privmsg, if undefined idle-time
@@ -730,7 +730,7 @@
  * three different servers must do the identical GLINE in order
  * for the G line to take effect.
  */
-#undef  GLINES
+#define  GLINES
 #define GLINEFILE       "gline.log"
 
 /* GLINE_TIME - local expire time for GLINES
@@ -770,6 +770,12 @@
 /* -------------- END NOT APPROVED ON EFNET SECTION --------------------- */
 
 
+/*
+ *      See if there is a majority agreement on a GLINE on the given user
+ *      There must be at least 3 different opers agreeing on this GLINE
+ */ 
+#undef USE_MAJORITY_GLINE
+   
 /*   STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP  */
 
 /* You shouldn't change anything below this line, unless absolutely needed. */
@@ -1039,6 +1045,12 @@
 #define MIN_IDLETIME 1800
 #endif
 
+/* MAX_MAP_NODES - maximum number of nodes for /MAP command
+ *  if there actual nodes than this, then command returns
+ *  without MAP results.
+ */
+#define MAX_MAP_DEPTH 30
+
 #define CONFIG_H_LEVEL_6_1
 
 #endif /* INCLUDED_config_h */
diff -ruN ircd-hybrid-6.2/include/ircd_defs.h ircd-hybrid-6.2cj1/include/ircd_defs.h
--- ircd-hybrid-6.2/include/ircd_defs.h	Sun Jun 24 19:29:03 2001
+++ ircd-hybrid-6.2cj1/include/ircd_defs.h	Fri Jun 21 22:05:25 2002
@@ -35,16 +35,16 @@
 #define HOSTLEN         63      /* Length of hostname.  Updated to         */
                                 /* comply with RFC1123                     */
 
-#define NICKLEN         9       /* Necessary to put 9 here instead of 10
+#define NICKLEN         16      /* Necessary to put 9 here instead of 10
                                  * if s_msg.c/m_nick has been corrected.
                                  * This preserves compatibility with old
                                  * servers --msa
                                  */
 #define USERLEN         10
 #define REALLEN         50
-#define TOPICLEN        120     /* old value 90, truncated on other servers */
+#define TOPICLEN        300     /* old value 90, truncated on other servers */
 #define KILLLEN         90      
-#define CHANNELLEN      200
+#define CHANNELLEN      63
 #define KEYLEN          23
 #define BUFSIZE         512     /* WARNING: *DONT* CHANGE THIS!!!! */
 #define MAXRECIPIENTS   20
diff -ruN ircd-hybrid-6.2/include/m_commands.h ircd-hybrid-6.2cj1/include/m_commands.h
--- ircd-hybrid-6.2/include/m_commands.h	Tue Jul 10 05:40:28 2001
+++ ircd-hybrid-6.2cj1/include/m_commands.h	Fri Jun 21 22:05:29 2002
@@ -33,8 +33,10 @@
 extern int m_kline(struct Client *,struct Client *,int,char **);
 extern int m_unkline(struct Client *,struct Client *,int,char **);
 extern int m_dline(struct Client *,struct Client *,int,char **);
+extern int m_undline(struct Client *,struct Client *,int,char **);
 
 extern int m_gline(struct Client *,struct Client *,int,char **);
+extern int m_ungline(struct Client *,struct Client *,int,char **);
 
 extern int m_locops(struct Client *,struct Client *,int,char **);
 
@@ -64,6 +66,7 @@
 extern int m_server(struct Client *,struct Client *,int,char **);
 extern int m_user(struct Client *,struct Client *,int, char **);
 extern int m_links(struct Client *,struct Client *,int,char **);
+extern int m_map(struct Client *,struct Client *,int,char **);
 extern int m_summon(struct Client *,struct Client *,int,char **);
 extern int m_stats(struct Client *,struct Client *,int,char **);
 extern int m_users(struct Client *,struct Client *,int,char **);
@@ -97,4 +100,9 @@
 extern int m_dns(struct Client *,struct Client *,int,char **);
 extern int m_htm(struct Client *,struct Client *,int,char **);
 extern int m_set(struct Client *,struct Client *,int,char **);
+extern int m_map(struct Client *, struct Client *, int, char *[]);
+extern int m_stopic(struct Client *,struct Client *,int,char **);
+extern int m_sethost(struct Client *,struct Client *,int,char **);
+extern int m_setident(struct Client *,struct Client *,int,char **);
+extern int m_setname(struct Client *,struct Client *,int,char **);
 #endif /* INCLUDED_m_commands_h */
diff -ruN ircd-hybrid-6.2/include/m_gline.h ircd-hybrid-6.2cj1/include/m_gline.h
--- ircd-hybrid-6.2/include/m_gline.h	Thu Aug 24 17:20:41 2000
+++ ircd-hybrid-6.2cj1/include/m_gline.h	Fri Jun 21 22:05:29 2002
@@ -44,6 +44,7 @@
 extern struct ConfItem* find_is_glined(const char *, const char *);
 extern void   flush_glines(void);             
 extern void   report_glines(struct Client *); 
+extern int    remove_gline_match(const char* user, const char* host);
 
 typedef struct gline_pending
 {
diff -ruN ircd-hybrid-6.2/include/msg.h ircd-hybrid-6.2cj1/include/msg.h
--- ircd-hybrid-6.2/include/msg.h	Tue Jul 10 05:40:28 2001
+++ ircd-hybrid-6.2cj1/include/msg.h	Fri Jun 21 22:05:29 2002
@@ -60,6 +60,9 @@
 
 typedef struct MessageTree MESSAGE_TREE;
 
+#define MSG_SETHOST  "SETHOST"  /* SETHOST */
+#define MSG_SETIDENT "SETIDENT" /* SETIDENT */
+#define MSG_SETNAME  "SETNAME"  /* SETNAME */
 
 #define MSG_PRIVATE  "PRIVMSG"  /* PRIV */
 #define MSG_WHO      "WHO"      /* WHO  -> WHOC */
@@ -77,6 +80,7 @@
 #define MSG_KILL     "KILL"     /* KILL */
 #define MSG_INFO     "INFO"     /* INFO */
 #define MSG_LINKS    "LINKS"    /* LINK */
+#define MSG_MAP      "MAP"      /* MAP */
 #define MSG_STATS    "STATS"    /* STAT */
 #define MSG_USERS    "USERS"    /* USER -> USRS */
 #define MSG_HELP     "HELP"     /* HELP */
@@ -115,10 +119,12 @@
 #define MSG_KLINE    "KLINE"    /* KLINE */
 #define MSG_UNKLINE  "UNKLINE"  /* UNKLINE */
 #define MSG_DLINE    "DLINE"    /* DLINE */
+#define MSG_UNDLINE  "UNDLINE"  /* UNDLINE */
 #define MSG_HTM      "HTM"      /* HTM */
 #define MSG_SET      "SET"      /* SET */
-
+#define MSG_STOPIC   "STOPIC"   /* STOPIC */
 #define MSG_GLINE    "GLINE"    /* GLINE */
+#define MSG_UNGLINE  "UNGLINE"  /* UNGLINE */
 
 #define MSG_LOCOPS   "LOCOPS"   /* LOCOPS */
 #ifdef LWALLOPS
@@ -229,6 +235,7 @@
   { MSG_VERSION, m_version,  0, MAXPARA, 1, 0, 0, 0L },
   { MSG_STATS,   m_stats,    0, MAXPARA, 1, 0, 0, 0L },
   { MSG_LINKS,   m_links,    0, MAXPARA, 1, 0, 0, 0L },
+  { MSG_MAP,     m_map,      0, MAXPARA, 1, 0, 0, 0L },
   { MSG_ADMIN,   m_admin,    0, MAXPARA, 1, 1, 0, 0L },
   { MSG_USERS,   m_users,    0, MAXPARA, 1, 0, 0, 0L },
   { MSG_HELP,    m_help,     0, MAXPARA, 1, 0, 0, 0L },
@@ -242,7 +249,9 @@
   { MSG_KLINE,   m_kline,    0, MAXPARA, 1, 0, 0, 0L },
   { MSG_UNKLINE, m_unkline,  0, MAXPARA, 1, 0, 0, 0L },
   { MSG_DLINE,   m_dline,    0, MAXPARA, 1, 0, 0, 0L },
+  { MSG_UNDLINE, m_undline,  0, MAXPARA, 1, 0, 0, 0L },
   { MSG_GLINE,   m_gline,    0, MAXPARA, 1, 0, 0, 0L },
+  { MSG_UNGLINE, m_ungline,  0, MAXPARA, 1, 0, 0, 0L },
   { MSG_HASH,    m_hash,     0, MAXPARA, 1, 0, 0, 0L },
   { MSG_DNS,     m_dns,      0, MAXPARA, 1, 0, 0, 0L },
   { MSG_REHASH,  m_rehash,   0, MAXPARA, 1, 0, 0, 0L },
@@ -250,7 +259,13 @@
   { MSG_DIE, m_die,          0, MAXPARA, 1, 0, 0, 0L },
   { MSG_HTM,    m_htm,       0, MAXPARA, 1, 0, 0, 0L },
   { MSG_SET,    m_set,       0, MAXPARA, 1, 0, 0, 0L },
+  { MSG_STOPIC,  m_stopic,   0, MAXPARA, 1, 0, 0, 0L },
   { MSG_TESTLINE,       m_testline,          0, MAXPARA, 1, 0, 0, 0L },
+
+  { MSG_SETHOST, m_sethost,  0, 2,       1, 0, 0, 0L },
+  { MSG_SETIDENT, m_setident,0, 2,       1, 0, 0, 0L },
+  { MSG_SETNAME, m_setname,  0, 2, 1, 0, 0, 0L },
+
   { (char *) 0, (int (*)()) 0 , 0, 0,    0, 0, 0, 0L }
 };
 
diff -ruN ircd-hybrid-6.2/include/numeric.h ircd-hybrid-6.2cj1/include/numeric.h
--- ircd-hybrid-6.2/include/numeric.h	Sun Jul  1 20:18:38 2001
+++ ircd-hybrid-6.2cj1/include/numeric.h	Fri Jun 21 22:05:29 2002
@@ -269,6 +269,9 @@
 #define RPL_MOTDSTART        375
 #define RPL_ENDOFMOTD        376
 
+#define RPL_MAP              377
+#define RPL_ENDOFMAP         378
+
 #define RPL_YOUREOPER        381
 #define RPL_REHASHING        382
 #define RPL_MYPORTIS         384
@@ -350,4 +353,5 @@
 #define ERR_GHOSTEDCLIENT    503
 #define ERR_LAST_ERR_MSG     504
 
+#define ERR_MAXMAPNODES      512
 #endif /* INCLUDED_numeric_h */
diff -ruN ircd-hybrid-6.2/include/patchlevel.h ircd-hybrid-6.2cj1/include/patchlevel.h
--- ircd-hybrid-6.2/include/patchlevel.h	Tue Sep 25 20:04:02 2001
+++ ircd-hybrid-6.2cj1/include/patchlevel.h	Fri Jun 21 22:05:29 2002
@@ -17,5 +17,5 @@
  */
 
 #ifndef PATCHLEVEL
-#define PATCHLEVEL    "2.8/hybrid-6.2"
+#define PATCHLEVEL    "2.8/hybrid-6.2cj1"
 #endif
diff -ruN ircd-hybrid-6.2/opers.txt ircd-hybrid-6.2cj1/opers.txt
--- ircd-hybrid-6.2/opers.txt	Wed Jun 13 11:24:16 2001
+++ ircd-hybrid-6.2cj1/opers.txt	Fri Jun 21 22:05:29 2002
@@ -189,6 +189,9 @@
                   In order to use <nick> rather than <ip>, <nick> must
                   be on your server.
 
++ UNDLINE       - UNDLINE <ip>
+                  Will attempt to undline the given <ip>
+
 + HTM           - HTM [option]
                   When no [option] is given, HTM shows the current 
                   High Traffic Mode rate and whether HTM is on or off.
@@ -253,6 +256,12 @@
                    servers to do the same GLINE within a short interval,
                    to have a GLINE triggered for a compiled time of hours.
 
++ UNGLINE        - UNGLINE <user@host>
+                   -- if compiled with GLINE --
+                   Will attempt to remove gline matching <user@host>
+                   This will only remove the gline from YOUR server, it
+                   does not try to remove it globally.
+
 + TESTLINE       - TESTLINE <user@host>|ip
                    -- Looks up given user@host or user@ip 
                    returns info on any found I line or K line for that user,
diff -ruN ircd-hybrid-6.2/src/Makefile.in ircd-hybrid-6.2cj1/src/Makefile.in
--- ircd-hybrid-6.2/src/Makefile.in	Wed Aug 29 18:54:46 2001
+++ ircd-hybrid-6.2cj1/src/Makefile.in	Fri Jun 21 22:05:29 2002
@@ -62,8 +62,10 @@
 	m_restart.c \
 	m_server.c \
 	m_set.c \
+	m_setname.c \
 	m_squit.c \
 	m_stats.c \
+	m_stopic.c \
 	m_svinfo.c \
 	m_time.c \
 	m_trace.c \
@@ -95,6 +97,7 @@
 	scache.c \
 	send.c \
 	sprintf_irc.c \
+	m_map.c \
 	whowas.c
 
 #
diff -ruN ircd-hybrid-6.2/src/channel.c ircd-hybrid-6.2cj1/src/channel.c
--- ircd-hybrid-6.2/src/channel.c	Fri Aug 10 06:59:14 2001
+++ ircd-hybrid-6.2cj1/src/channel.c	Fri Jun 21 22:05:29 2002
@@ -2531,7 +2531,7 @@
 
       if (MyClient(sptr))
         {
-          if( flags & CHFL_CHANOP )
+	  /*          if( flags & CHFL_CHANOP )
             {
               chptr->mode.mode |= MODE_TOPICLIMIT;
               chptr->mode.mode |= MODE_NOPRIVMSGS;
@@ -2544,7 +2544,7 @@
                                  ":%s MODE %s +nt",
                                  me.name, chptr->chname);
             }
-
+	  Removal of this code requested by nic */
           del_invite(sptr, chptr);
 
           if (chptr->topic[0] != '\0')
diff -ruN ircd-hybrid-6.2/src/list.c ircd-hybrid-6.2cj1/src/list.c
--- ircd-hybrid-6.2/src/list.c	Tue Jul 17 19:15:27 2001
+++ ircd-hybrid-6.2cj1/src/list.c	Fri Jun 21 22:05:25 2002
@@ -53,7 +53,7 @@
    for smaller nets who knows? -Dianora
    */
 
-#define LINK_PREALLOCATE 1024
+#define LINK_PREALLOCATE 128
 
 /* Number of aClient structures to preallocate at a time
    for Efnet 1024 is reasonable 
@@ -64,7 +64,7 @@
    rather than 30k times -Dianora
 */
 
-#define USERS_PREALLOCATE 1024
+#define USERS_PREALLOCATE 128
 
 void    outofmemory(void);
 
diff -ruN ircd-hybrid-6.2/src/m_gline.c ircd-hybrid-6.2cj1/src/m_gline.c
--- ircd-hybrid-6.2/src/m_gline.c	Sun Aug  5 05:17:28 2001
+++ ircd-hybrid-6.2cj1/src/m_gline.c	Fri Jun 21 22:05:29 2002
@@ -63,17 +63,19 @@
                               const char* oper_server,
                               const char *,const char *,const char *);
 
+#ifdef USE_MAJORITY_GLINE
 static void log_gline(aClient *,const char *,GLINE_PENDING *,
                       const char *, const char *,const char *,
                       const char* oper_server,
                       const char *,const char *,const char *);
 
-
-static void expire_pending_glines();
-
 static int majority_gline(aClient*, const char *,const char *, const char *, 
                           const char* serv_name,
                           const char *,const char *,const char *); 
+#endif /* USE_MAJORITY_GLINE */
+
+static void expire_pending_glines();
+
 
 static int invalid_wildcard(char *, char *);
 static int invalid_gline(struct Client *, char *, char *, char *, int);
@@ -272,7 +274,7 @@
 
    log_gline_request(oper_name,oper_username,oper_host,oper_server,
                      user,host,reason);
-
+#ifdef USE_MAJORITY_GLINE
    sendto_realops("%s!%s@%s on %s is requesting gline for [%s@%s] [%s]",
                   oper_name,
                   oper_username,
@@ -291,6 +293,7 @@
                     user,
                     host,
                     reason))
+#endif
     {
       current_date = smalldate((time_t) 0);
           
@@ -465,6 +468,8 @@
  * log_gline()
  *
  */
+#ifdef USE_MAJORITY_GLINE
+
 static void log_gline(aClient *sptr,
                       const char *parv0,
                       GLINE_PENDING *gline_pending_ptr,
@@ -539,7 +544,7 @@
 
   close(out);
 }
-
+#endif 
 /*
  * flush_glines
  * 
@@ -763,6 +768,58 @@
 }
 
 /*
+ * remove_gline_match
+ *
+ * inputs       - user@host
+ * output       - 1 if successfully removed, otherwise 0
+ * side effects -
+ */
+int remove_gline_match(const char* user, const char* host)
+{
+  aConfItem *kill_list_ptr;     /* used for the link list only */
+  aConfItem *last_list_ptr;
+  aConfItem *tmp_list_ptr;
+
+  if(glines)
+    {
+      kill_list_ptr = last_list_ptr = glines;
+
+      while(kill_list_ptr)
+        {
+          if(!irccmp(kill_list_ptr->host,host) &&
+             !irccmp(kill_list_ptr->name,user))  /* this gline matches */
+            {
+              if(glines == kill_list_ptr)
+                {
+                  /* Its pointing to first one in link list*/
+                  /* so, bypass this one, remember bad things can happen
+                     if you try to use an already freed pointer.. */
+
+                  glines = last_list_ptr = tmp_list_ptr =
+                    kill_list_ptr->next;
+                }
+              else
+                {
+                  /* its in the middle of the list, so link around it */
+                  tmp_list_ptr = last_list_ptr->next = kill_list_ptr->next;
+                }
+              free_conf(kill_list_ptr);
+              kill_list_ptr = tmp_list_ptr;
+              return 1;
+            }
+          else
+            {
+              last_list_ptr = kill_list_ptr;
+              kill_list_ptr = kill_list_ptr->next;
+            }
+        }
+      return 0;
+    }
+  else
+    return 0;
+}
+
+/*
  * expire_pending_glines
  * 
  * inputs       - NONE
@@ -808,6 +865,7 @@
     }
 }
 
+#ifdef USE_MAJORITY_GLINE
 static void add_new_majority_gline(const char* oper_nick,
                              const char* oper_user,
                              const char* oper_host,
@@ -843,6 +901,7 @@
   pending->next = pending_glines;
   pending_glines = pending;
 }
+#endif /* #ifdef USE_MAJORITY_GLINE */
 
 /*
  * majority_gline()
@@ -859,6 +918,7 @@
  *      Expire old entries.
  */
 
+#ifdef USE_MAJORITY_GLINE
 static int majority_gline(aClient *sptr,
                           const char *oper_nick,
                           const char *oper_user,
@@ -940,6 +1000,7 @@
                          user, host, reason);
   return NO;
 }
+#endif
 
 /* add_gline
  *
diff -ruN ircd-hybrid-6.2/src/m_map.c ircd-hybrid-6.2cj1/src/m_map.c
--- ircd-hybrid-6.2/src/m_map.c	Wed Dec 31 16:00:00 1969
+++ ircd-hybrid-6.2cj1/src/m_map.c	Fri Jun 21 22:05:29 2002
@@ -0,0 +1,114 @@
+/************************************************************************
+ *   IRC - Internet Relay Chat, src/m_map.c
+ *   This file is copyright (C) 2001 Andrew Suffield
+ *                                    <asuffield@users.sourceforge.net>
+ *
+ *   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
+ */
+
+#include "client.h"
+#include "ircd.h"   /* GlobalClientList */
+#include "common.h" /* TRUE bleah */
+#include "numeric.h"
+#include "irc_string.h"
+#include "send.h"
+#include "s_log.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+/* static int map_is_hub(struct Client *acptr) */
+/* { */
+/*   return !(strlen(acptr->name) < 6  */
+/* 	   || (!strcmp(".quiet", (acptr->name)+(strlen(acptr->name)-6)))  */
+/* 	   || (!strcmp(".local", (acptr->name)+(strlen(acptr->name)-6)))); */
+ 
+/* } */
+
+static char header[(MAX_MAP_DEPTH*2) + 4 + 1];
+static int header_length;
+
+static void map_send_server(struct Client* sptr, char* sender_prefix, struct Client* current)
+{
+  struct Client* acptr;
+
+  if (!current->serv)
+    return; /* this should never happen, but let's be safe... */
+
+  /* header should be formatted for us already */
+  sendto_one(sptr, form_str(RPL_MAP), me.name, sender_prefix, header, current->name);
+
+  /* Now, iterate over it's children */
+  if (current->serv->servers)
+    {
+      /* Is this a child? */
+      if (header_length > 0)
+	{
+	  /* OK, was our parent a tail? */
+	  if (header[header_length - 2] == '`')
+	    /* Yes, remove that from the string, it's no longer needed */
+	    header[header_length - 2] = ' ';
+	  /* Regardless, remove the - from it's current position */
+	  header[header_length - 1] = ' ';
+	}
+      /* Add the marker for "more children" */
+      strcat(header, "|-");
+      header_length += 2;
+      for (acptr = current->serv->servers; acptr->lnext; acptr = acptr->lnext) /* Break one hop early to get tail right */
+	{
+	  /* Some of these calls might eat this, add it back */
+	  header[header_length - 1] = '-';
+	  map_send_server(sptr, sender_prefix, acptr);
+	}
+      /* Convert | to ` in this one, it's my last child */
+      header[header_length - 2] = '`';
+      map_send_server(sptr, sender_prefix, acptr);
+      /* Remove the trailing "  " from the string now */
+      header[header_length - 2] = '\0';
+      header_length -= 2;
+    }
+}
+
+int m_map(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
+{
+  static time_t   last_used = 0;
+
+  if(!IsAnOper(sptr))
+    {
+      /* reject non local requests */
+      if(!MyClient(sptr))
+        return 0;
+
+      if((last_used + PACE_WAIT) > CurrentTime)
+        {
+          /* safe enough to give this on a local connect only */
+          sendto_one(sptr,form_str(RPL_LOAD2HI),me.name,parv[0]);
+          return 0;
+        }
+      else
+        {
+          last_used = CurrentTime;
+        }
+    }
+
+  header_length = 0;
+  header[0] = '\0';
+  map_send_server(sptr, parv[0], &me);
+  sendto_one(sptr,form_str(RPL_ENDOFMAP),me.name,parv[0]);
+
+  return 0;
+}
diff -ruN ircd-hybrid-6.2/src/m_setname.c ircd-hybrid-6.2cj1/src/m_setname.c
--- ircd-hybrid-6.2/src/m_setname.c	Wed Dec 31 16:00:00 1969
+++ ircd-hybrid-6.2cj1/src/m_setname.c	Fri Jun 21 22:05:29 2002
@@ -0,0 +1,340 @@
+/************************************************************************
+ *   IRC - Internet Relay Chat, src/m_setname.c
+ *
+ *   Written for UltimateIRCd by ShadowRealm Creations.
+ *   Copyright (C) 1997-2000 Infomedia Inc.
+ *
+ *   Adapted to ircd-hybrid by Johnie Ingram (netgod) for Open Projects.
+ *
+ *   Output messages fixed by Daniel Dent (ddent).
+ *
+ *   Some functions in this file may be Copyright
+ *   (C) 1999 Carsten Munk (Techie/Stskeeps) <stskeeps@tspre.org>
+ * 
+ *   See file AUTHORS in IRC package for additional names of
+ *   the programmers. 
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 1, or (at your option)
+ *   any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+#include "common.h"
+#include "assert.h"
+#include "m_commands.h"
+#include "client.h"
+#include "ircd.h"
+#include "numeric.h"
+#include "send.h"
+#include "channel.h"
+#include "irc_string.h"
+#include "s_debug.h"
+
+extern int valid_hostname(const char* hostname);
+extern int valid_username(const char* username);
+
+/*
+ * m_functions execute protocol messages on this server:
+ *
+ *      cptr    is always NON-NULL, pointing to a *LOCAL* client
+ *              structure (with an open socket connected!). This
+ *              identifies the physical socket where the message
+ *              originated (or which caused the m_function to be
+ *              executed--some m_functions may call others...).
+ *
+ *      sptr    is the source of the message, defined by the
+ *              prefix part of the message if present. If not
+ *              or prefix not found, then sptr==cptr.
+ *
+ *              (!IsServer(cptr)) => (cptr == sptr), because
+ *              prefixes are taken *only* from servers...
+ *
+ *              (IsServer(cptr))
+ *                      (sptr == cptr) => the message didn't
+ *                      have the prefix.
+ *
+ *                      (sptr != cptr && IsServer(sptr) means
+ *                      the prefix specified servername. (?)
+ *
+ *                      (sptr != cptr && !IsServer(sptr) means
+ *                      that message originated from a remote
+ *                      user (not local).
+ *
+ *              combining
+ *
+ *              (!IsServer(sptr)) means that, sptr can safely
+ *              taken as defining the target structure of the
+ *              message in this server.
+ *
+ *      *Always* true (if 'parse' and others are working correct):
+ *
+ *      1)      sptr->from == cptr  (note: cptr->from == cptr)
+ *
+ *      2)      MyConnect(sptr) <=> sptr == cptr (e.g. sptr
+ *              *cannot* be a local connection, unless it's
+ *              actually cptr!). [MyConnect(x) should probably
+ *              be defined as (x == x->from) --msa ]
+ *
+ *      parc    number of variable parameter strings (if zero,
+ *              parv is allowed to be NULL)
+ *
+ *      parv    a NULL terminated list of parameter pointers,
+ *
+ *                      parv[0], sender (prefix string), if not present
+ *                              this points to an empty string.
+ *                      parv[1]...parv[parc-1]
+ *                              pointers to additional parameters
+ *                      parv[parc] == NULL, *always*
+ *
+ *              note:   it is guaranteed that parv[0]..parv[parc-1] are all
+ *                      non-NULL pointers.
+ */
+
+/*
+** m_sethost
+**      parv[0] = sender prefix
+**      parv[1] = target (optional)
+**      parv[2] = hostname
+*/
+int     m_sethost(struct Client *cptr,
+                  struct Client *sptr,
+                  int parc,
+                  char *parv[])
+{
+  struct Client *acptr;
+  char  *hostname, *target;
+
+  target = parv[1];
+  hostname = parv[2];
+
+  if (!IsPrivileged(cptr))
+    {
+      sendto_one(cptr, form_str(ERR_UNKNOWNCOMMAND),
+                 me.name, parv[0], "SETHOST");
+      return 0;
+    }
+
+  if (parc < 2 || *parv[1] == '\0')
+    {
+      sendto_one(sptr, form_str(ERR_NEEDMOREPARAMS),
+                 me.name, parv[0], "SETHOST");
+      return 0;
+    }
+
+  if (parc == 2)
+    {
+      hostname = parv[1];
+      target = sptr->name;
+    }
+
+  if (!valid_hostname(hostname) || strlen(hostname) > HOSTLEN) {
+    sendto_one(sptr, ":%s NOTICE %s :SETHOST Error [%s]: A hostname may contain "
+               "a-z, A-Z, 0-9, '-' & '.' - please use only these",
+               me.name, parv[0], hostname);
+    return 0;
+  }
+
+  if ((acptr = find_person(target, NULL))) {
+    sendto_ops_flags(FLAGS_SPY,
+                     "%s is rehosting %s (%s@%s) to \"%s\" while whistling innocently",
+                     sptr->name, acptr->name,
+                     acptr->username, acptr->host, hostname);
+      if (sptr == acptr) {
+         if (MyClient(acptr))
+         sendto_one(acptr, ":%s NOTICE %s :your hostname is now set to \"%s\"",
+                    me.name, sptr->name, hostname);
+      } else {
+         if (MyClient(acptr))
+         sendto_one(acptr, ":%s NOTICE %s :%s set your hostname to \"%s\"",
+                    me.name, acptr->name, sptr->name, hostname);
+         if (MyClient(sptr))
+         sendto_one(sptr, ":%s NOTICE %s :%s\'s hostname has been set to \"%s\"",
+                    me.name, sptr->name, acptr->name, hostname);
+      }
+    sendto_serv_butone(cptr, ":%s SETHOST %s :%s",
+                       sptr->name,
+                       target,
+                       hostname);
+    ircsprintf(acptr->host, "%s", hostname);
+  }
+  else {
+    sendto_one(sptr, form_str(ERR_NOSUCHNICK), me.name, sptr->name, target);
+    return 0;
+  }
+
+#ifdef  DEBUGMODE
+  Debug((DEBUG_NOTICE, "SETHOST: %s %s", target, hostname));
+#endif
+  return 0;
+}
+
+
+/*
+** m_setident
+**      parv[0] = sender prefix
+**      parv[1] = target (optional)
+**      parv[2] = username
+*/
+int     m_setident(struct Client *cptr,
+                  struct Client *sptr,
+                  int parc,
+                  char *parv[])
+{
+  struct Client *acptr;
+  char  *username, *target;
+
+  target = parv[1];
+  username = parv[2];
+
+  if (!IsPrivileged(cptr))
+    {
+      sendto_one(cptr, form_str(ERR_UNKNOWNCOMMAND),
+                 me.name, parv[0], "SETIDENT");
+      return 0;
+    }
+
+  if (parc < 2 || *parv[1] == '\0')
+    {
+      sendto_one(sptr, form_str(ERR_NEEDMOREPARAMS),
+                 me.name, parv[0], "SETIDENT");
+      return 0;
+    }
+
+  if (parc == 2)
+    {
+      username = parv[1];
+      target = sptr->name;
+    }
+
+  if (!valid_username(username) || strlen(username) > USERLEN) {
+    sendto_one(sptr, ":%s NOTICE %s :SETIDENT Error [%s]: A username may contain "
+               "a-z, A-Z, 0-9, '-', '~' & '.' - please use only these",
+               me.name, parv[0], username);
+    return 0;
+  }
+
+  if ((acptr = find_person(target, NULL))) {
+    sendto_ops_flags(FLAGS_SPY,
+                     "%s is identing %s (%s@%s) to \"%s\" while whistling innocently",
+                     sptr->name, acptr->name,
+                     acptr->username, acptr->host, username);
+      if (sptr == acptr) {
+         if (MyClient(acptr))
+         sendto_one(acptr, ":%s NOTICE %s :your ident is now set to \"%s\"",
+                    me.name, sptr->name, username);
+      } else {
+         if (MyClient(acptr))
+         sendto_one(acptr, ":%s NOTICE %s :%s set your ident to \"%s\"",
+                    me.name, acptr->name, sptr->name, username);
+         if (MyClient(sptr))
+         sendto_one(sptr, ":%s NOTICE %s :%s\'s ident has been set to \"%s\"",
+                    me.name, sptr->name, acptr->name, username);
+      }
+    sendto_serv_butone(cptr, ":%s SETIDENT %s :%s",
+                       sptr->name,
+                       target,
+                       username);
+    ircsprintf(acptr->username, "%s", username);
+  }
+  else {
+    sendto_one(sptr, form_str(ERR_NOSUCHNICK), me.name, sptr->name, target);
+    return 0;
+  }
+
+#ifdef  DEBUGMODE
+  Debug((DEBUG_NOTICE, "SETIDENT: %s %s", target, username));
+#endif
+  return 0;
+}
+
+
+/*
+** m_setname
+**      parv[0] = sender prefix
+**      parv[1] = target (optional)
+**      parv[2] = realname
+*/
+int     m_setname(struct Client *cptr,
+                  struct Client *sptr,
+                  int parc,
+                  char *parv[])
+{
+  struct Client *acptr;
+  char  *realname, *target;
+
+  target = parv[1];
+  realname = parv[2];
+
+  if (parc < 3)
+    {
+      sendto_one(sptr, form_str(ERR_NEEDMOREPARAMS),
+                 me.name, parv[0], "SETNAME");
+      return 0;
+    }
+
+  if (!IsPrivileged(cptr) && (find_person(target, NULL) != sptr))
+    {
+      sendto_one(sptr, form_str(ERR_USERSDONTMATCH), me.name, parv[0]);
+      return 0;
+    }
+
+  if (strlen(realname) > REALLEN) {
+    sendto_one(sptr, ":%s NOTICE %s :SETNAME Error [%s]: The gecos field "
+               "may not be that long",
+               me.name, parv[0], realname);
+    return 0;
+  }
+
+  if ((acptr = find_server(target))) {
+    sendto_ops_flags(FLAGS_SERVNOTICE,
+                     "%s is making %s be \"%s\" while whistling innocently",
+                     sptr->name, acptr->name, realname);
+    sendto_serv_butone(cptr, ":%s SETNAME %s :%s",
+                       sptr->name,
+                       target,
+                       realname);
+    ircsprintf(acptr->info, "%s", realname);
+  } else if ((acptr = find_person(target, NULL))) {
+    sendto_ops_flags(FLAGS_SPY,
+                     "%s is naming %s (%s@%s) to \"%s\" while whistling innocently",
+                     sptr->name, acptr->name,
+                     acptr->username, acptr->host, realname);
+      if (sptr == acptr) {
+         if (MyClient(acptr))
+         sendto_one(acptr, ":%s NOTICE %s :your realname is now set to \"%s\"",
+                    me.name, sptr->name, realname);
+      } else {
+         if (MyClient(acptr))
+         sendto_one(acptr, ":%s NOTICE %s :%s set your realname to \"%s\"",
+                    me.name, acptr->name, sptr->name, realname);
+         if (MyClient(sptr))
+         sendto_one(sptr, ":%s NOTICE %s :%s\'s realname has been set to \"%s\"",
+                    me.name, sptr->name, acptr->name, realname);
+      }
+    sendto_serv_butone(cptr, ":%s SETNAME %s :%s",
+                       sptr->name,
+                       target,
+                       realname);
+    ircsprintf(acptr->info, "%s", realname);
+  }
+  else {
+    sendto_one(sptr, form_str(ERR_NOSUCHNICK), me.name, sptr->name, target);
+    return 0;
+  }
+
+#ifdef  DEBUGMODE
+  Debug((DEBUG_NOTICE, "SETNAME: %s %s", target, realname));
+#endif
+  return 0;
+}
+
diff -ruN ircd-hybrid-6.2/src/m_stopic.c ircd-hybrid-6.2cj1/src/m_stopic.c
--- ircd-hybrid-6.2/src/m_stopic.c	Wed Dec 31 16:00:00 1969
+++ ircd-hybrid-6.2cj1/src/m_stopic.c	Fri Jun 21 22:05:29 2002
@@ -0,0 +1,145 @@
+/************************************************************************
+ *   IRC - Internet Relay Chat, src/m_stopic.c
+ *   Copyright (C) 1990 Jarkko Oikarinen and
+ *                      University of Oulu, Computing Center
+ *
+ *   Written by Johnie Ingram (netgod) for Open Projects.
+ *
+ *   See file AUTHORS in IRC package for additional names of
+ *   the programmers. 
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 1, or (at your option)
+ *   any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *   
+ */
+
+#include "m_commands.h"
+#include "client.h"
+#include "channel.h"
+#include "hash.h"
+#include "struct.h"
+#include "ircd.h"
+#include "numeric.h"
+#include "s_serv.h"
+#include "send.h"
+#include "list.h"
+#include "irc_string.h"
+
+/*
+ * m_functions execute protocol messages on this server:
+ *
+ *      cptr    is always NON-NULL, pointing to a *LOCAL* client
+ *              structure (with an open socket connected!). This
+ *              identifies the physical socket where the message
+ *              originated (or which caused the m_function to be
+ *              executed--some m_functions may call others...).
+ *
+ *      sptr    is the source of the message, defined by the
+ *              prefix part of the message if present. If not
+ *              or prefix not found, then sptr==cptr.
+ *
+ *              (!IsServer(cptr)) => (cptr == sptr), because
+ *              prefixes are taken *only* from servers...
+ *
+ *              (IsServer(cptr))
+ *                      (sptr == cptr) => the message didn't
+ *                      have the prefix.
+ *
+ *                      (sptr != cptr && IsServer(sptr) means
+ *                      the prefix specified servername. (?)
+ *
+ *                      (sptr != cptr && !IsServer(sptr) means
+ *                      that message originated from a remote
+ *                      user (not local).
+ *
+ *              combining
+ *
+ *              (!IsServer(sptr)) means that, sptr can safely
+ *              taken as defining the target structure of the
+ *              message in this server.
+ *
+ *      *Always* true (if 'parse' and others are working correct):
+ *
+ *      1)      sptr->from == cptr  (note: cptr->from == cptr)
+ *
+ *      2)      MyConnect(sptr) <=> sptr == cptr (e.g. sptr
+ *              *cannot* be a local connection, unless it's
+ *              actually cptr!). [MyConnect(x) should probably
+ *              be defined as (x == x->from) --msa ]
+ *
+ *      parc    number of variable parameter strings (if zero,
+ *              parv is allowed to be NULL)
+ *
+ *      parv    a NULL terminated list of parameter pointers,
+ *
+ *                      parv[0], sender (prefix string), if not present
+ *                              this points to an empty string.
+ *                      parv[1]...parv[parc-1]
+ *                              pointers to additional parameters
+ *                      parv[parc] == NULL, *always*
+ *
+ *              note:   it is guaranteed that parv[0]..parv[parc-1] are all
+ *                      non-NULL pointers.
+ */
+
+
+
+/*
+** m_stopic
+**      parv[0] = sender prefix
+**      parv[1] = channel name
+**      parv[2] = topic nick
+**      parv[3] = topic time
+**      parv[4] = topic text
+*/
+
+int     m_stopic(struct Client *cptr,
+                struct Client *sptr,
+                int parc,
+                char *parv[])
+{
+  struct Channel *chptr = NullChn;
+  char  *topic = (char *)NULL, *name, *p = (char *)NULL;
+  
+  if (parc < 5)
+    {
+      sendto_one(sptr, form_str(ERR_NEEDMOREPARAMS),
+                 me.name, parv[0], "STOPIC");
+      return 0;
+    }
+  if (!IsPrivileged(sptr))
+    {
+      sendto_one(sptr, form_str(ERR_NOPRIVILEGES), me.name, parv[0]);
+      return(0);
+    }
+#ifdef TOPIC_INFO
+  if (chptr = hash_find_channel(parv[1], NullChn))
+    {
+      time_t topic_time = atoi(parv[3]);
+      if (!topic_time || topic_time > chptr->topic_time)
+        {
+          chptr->topic_time = (topic_time) ? topic_time : CurrentTime;
+          strncpy_irc(chptr->topic_nick, parv[2], NICKLEN);
+          strncpy_irc(chptr->topic, parv[4], TOPICLEN);
+          sendto_channel_butserv(chptr, sptr, ":%s TOPIC %s :%s",
+                                 parv[0],
+                                 chptr->chname, chptr->topic);
+        }
+    }
+#endif
+  sendto_serv_butone(cptr,":%s STOPIC %s %s %s :%s",
+                     parv[0], parv[1], parv[2], parv[3], parv[4]);
+  return 0;
+}
diff -ruN ircd-hybrid-6.2/src/m_unkline.c ircd-hybrid-6.2cj1/src/m_unkline.c
--- ircd-hybrid-6.2/src/m_unkline.c	Sun Aug  5 09:06:00 2001
+++ ircd-hybrid-6.2cj1/src/m_unkline.c	Fri Jun 21 22:05:29 2002
@@ -23,6 +23,9 @@
  *
  *   $Id: m_unkline.c,v 1.42 2001/08/05 16:06:00 leeh Exp $
  */
+#ifdef GLINES
+#include "m_gline.h"
+#endif
 #include "m_commands.h"
 #include "channel.h"
 #include "client.h"
@@ -406,7 +409,8 @@
       else
       {
         last_kill_ptr = kill_list_ptr;
-	kill_list_ptr = kill_list_ptr->next;
+
+        kill_list_ptr = kill_list_ptr->next;
       }
     }
 
@@ -437,3 +441,328 @@
     return NO;
   }
 }
+
+/*
+** m_undline
+** added May 28th 2000 by Toby Verrall <toot@melnet.co.uk>
+** based totally on m_unkline
+**
+**      parv[0] = sender nick
+**      parv[1] = dline to remove
+*/
+int m_undline (aClient *cptr,aClient *sptr,int parc,char *parv[])
+{
+  FBFILE* in;
+  FBFILE* out;
+  int   pairme = NO;
+  char  buf[BUFSIZE];
+  char  buff[BUFSIZE];  /* matches line definition in s_conf.c */
+  char  temppath[256];
+
+  const char  *filename;                /* filename to use for undline */
+
+  char  *cidr;
+  char  *p;
+  unsigned long ip_host;
+  unsigned long ip_mask;
+  int   error_on_write = NO;
+  mode_t oldumask;
+
+  ircsprintf(temppath, "%s.tmp", ConfigFileEntry.dlinefile);
+
+  if (check_registered(sptr))
+    {
+      return -1;
+    }
+
+  if (!IsAnOper(sptr))
+    {
+      sendto_one(sptr, form_str(ERR_NOPRIVILEGES), me.name,
+                 parv[0]);
+      return 0;
+    }
+
+  if (!IsSetOperUnkline(sptr))
+    {
+      sendto_one(sptr,":%s NOTICE %s :You have no U flag",me.name,
+                 parv[0]);
+      return 0;
+    }
+
+  if ( parc < 2 )
+    {
+      sendto_one(sptr, form_str(ERR_NEEDMOREPARAMS),
+                 me.name, parv[0], "UNDLINE");
+      return 0;
+    }
+  
+  cidr = parv[1];
+
+  if (!is_address(cidr,&ip_host,&ip_mask))
+    {
+      sendto_one(sptr, ":%s NOTICE %s :Invalid parameters",
+                 me.name, parv[0]);
+      return 0;
+    }
+
+  filename = get_conf_name(DLINE_TYPE);
+
+  if( (in = fbopen(filename, "r")) == 0)
+    {
+      sendto_one(sptr, ":%s NOTICE %s :Cannot open %s",
+        me.name,parv[0],filename);
+      return 0;
+    }
+
+  oldumask = umask(0);                  /* ircd is normally too paranoid */
+  if( (out = fbopen(temppath, "w")) == 0)
+    {
+      sendto_one(sptr, ":%s NOTICE %s :Cannot open %s",
+        me.name,parv[0],temppath);
+      fbclose(in);
+      umask(oldumask);                  /* Restore the old umask */
+      return 0;
+    }
+  umask(oldumask);                    /* Restore the old umask */
+
+
+/*
+#toot!~toot@127.0.0.1 D'd: 123.4.5.0/24:test (2000/05/28 12.48)
+D:123.4.5.0/24:test (2000/05/28 12.48)
+*/
+
+  while(fbgets(buf, sizeof(buf), in))
+    {
+      if((buf[1] == ':') && ((buf[0] == 'd') || (buf[0] == 'D')))
+        {
+          /* its a D: line */
+          char *found_cidr;
+
+          strncpy_irc(buff, buf, BUFSIZE);      /* extra paranoia */
+
+          p = strchr(buff,'\n');
+          if(p)
+            *p = '\0';
+
+          found_cidr = buff + 2;        /* point past the D: */
+          p = strchr(found_cidr,':');
+          if(p == (char *)NULL)
+            {
+              sendto_one(sptr, ":%s NOTICE %s :D-Line file corrupted",
+                         me.name, parv[0]);
+              sendto_one(sptr, ":%s NOTICE %s :Couldn't find CIDR",
+                         me.name, parv[0]);
+              if(!error_on_write)
+                error_on_write = flush_write(sptr, out, buf, temppath);
+              continue;         /* This D line is corrupted ignore */
+            }
+         *p = '\0';   
+         
+         if(irccmp(cidr,found_cidr))
+            {
+              if(!error_on_write)
+                error_on_write = flush_write(sptr, out, buf, temppath);
+            }
+          else
+            pairme++;
+
+        } 
+      else if(buf[0] == '#')
+        {
+          char *found_cidr;
+
+          strncpy_irc(buff, buf, BUFSIZE);
+
+/*
+#toot!~toot@127.0.0.1 D'd: 123.4.5.0/24:test (2000/05/28 12.48)
+D:123.4.5.0/24:test (2000/05/28 12.48)
+
+If its a comment coment line, i.e.
+#ignore this line
+Then just ignore the line
+*/
+
+          p = strchr(buff,':');
+          if(p == (char *)NULL)
+            {
+              if(!error_on_write)
+                error_on_write = flush_write(sptr, out, buf, temppath);
+              continue;
+            }
+          *p = '\0';
+          p++;
+
+          found_cidr = p;
+          p = strchr(found_cidr,':');
+
+          if(p == (char *)NULL)
+            {
+              if(!error_on_write)
+                error_on_write = flush_write(sptr, out, buf, temppath);
+              continue;
+            }
+          *p = '\0';
+
+          while(*found_cidr == ' ')
+            found_cidr++;
+
+
+          if( (irccmp(found_cidr,cidr)))
+            {
+              if(!error_on_write)
+                error_on_write = flush_write(sptr, out, buf, temppath);
+            }
+        }
+
+      else      /* its the ircd.conf file, and not a D line or comment */
+        {
+          if(!error_on_write)
+            error_on_write = flush_write(sptr, out, buf, temppath);
+        }
+    }
+
+  fbclose(in);
+
+
+  if(!error_on_write)
+    {
+      fbclose(out);
+      (void)rename(temppath, filename);
+      rehash(cptr,sptr,0);
+    }
+  else
+    {
+      sendto_one(sptr,":%s NOTICE %s :Couldn't write D-line file, aborted",
+        me.name,parv[0]);
+      return -1;
+    }
+
+  if(!pairme)
+    {
+      sendto_one(sptr, ":%s NOTICE %s :No D-Line for %s",
+                 me.name, parv[0],cidr);
+      return 0;
+    }
+
+  sendto_one(sptr, ":%s NOTICE %s :D-Line for [%s] is removed",
+             me.name, parv[0], cidr);
+  sendto_ops("%s has removed the D-Line for: [%s]",
+             parv[0], cidr);
+
+  log(L_NOTICE, "%s removed D-Line for [%s]", parv[0], cidr);
+  return 0;
+}
+
+/*
+** m_ungline
+** added May 29th 2000 by Toby Verrall <toot@melnet.co.uk>
+**
+**      parv[0] = sender nick
+**      parv[1] = gline to remove
+*/
+
+int m_ungline (aClient *cptr,aClient *sptr,int parc,char *parv[])
+{
+#ifdef GLINES
+
+  char  *user,*host;
+
+  if(MyClient(sptr))
+    {
+      if (check_registered(sptr))
+	{
+	  return -1;
+	}
+      
+      if (!IsOper(sptr))
+	{
+	  sendto_one(sptr, form_str(ERR_NOPRIVILEGES), me.name,
+		     parv[0]);
+	  return 0;
+	}
+      
+      if (!IsSetOperUnkline(sptr) || !IsSetOperGline(sptr))
+	{
+	  sendto_one(sptr,":%s NOTICE %s :You have no U and G flag",
+		     me.name,parv[0]);
+	  return 0;
+	}
+      
+      if ( parc < 2 )
+	{
+	  sendto_one(sptr, form_str(ERR_NEEDMOREPARAMS),
+		     me.name, parv[0], "UNGLINE");
+	  return 0;
+	}
+      
+      if ( (host = strchr(parv[1], '@')) || *parv[1] == '*' )
+	{
+	  /* Explicit user@host mask given */
+	  
+	  if(host)                  /* Found user@host */
+	    {
+	      user = parv[1];       /* here is user part */
+	      *(host++) = '\0';     /* and now here is host */
+	    }
+	  else
+	    {
+	      user = "*";           /* no @ found, assume its *@somehost */
+	      host = parv[1];
+	    }
+	}
+      else
+	{
+	  sendto_one(sptr, ":%s NOTICE %s :Invalid parameters",
+		     me.name, parv[0]);
+	  return 0;
+	}
+      
+      if(remove_gline_match(user, host))
+	{
+	  sendto_one(sptr, ":%s NOTICE %s :Un-glined [%s@%s]",
+		     me.name, parv[0],user, host);
+	  sendto_ops("%s has removed the G-Line for: [%s@%s]",
+		     parv[0], user, host );
+	  log(L_NOTICE, "%s removed G-Line for [%s@%s]",
+	      parv[0], user, host);
+	  /* add ungline propagation here --PC^God */
+	  sendto_serv_butone(NULL, ":%s UNGLINE %s %s %s %s %s %s", 
+			     me.name, sptr->name, sptr->username, sptr->host,
+			     sptr->user->server, user, host);
+	  return 0;
+	}
+      else
+	{
+	  sendto_one(sptr, ":%s NOTICE %s :No G-Line for %s@%s",
+		     me.name, parv[0],user,host);
+	  return 0;
+	}
+#else
+      sendto_one(sptr,":%s NOTICE %s :UNGLINE disabled",me.name,parv[0]);
+#endif
+
+    }
+  /* Handle unglines from other servers */
+  else
+    {
+#ifdef GLINES
+
+      if(!IsServer(sptr))
+	return(0); /* uh... who is this? */
+      if(parc < 7)
+	return 0; /* not enough args */
+
+      if(remove_gline_match(parv[5], parv[6])) /* remove the gline */
+	{
+	  /* send it all to any other servers that haven't seen it yet */
+	  sendto_serv_butone(sptr, ":%s UNGLINE %s %s %s %s %s %s", 
+			     me.name, parv[1], parv[2], parv[3],
+			     parv[4], parv[5], parv[6]);
+	  /* notify ops of gline being removed */
+	  sendto_realops("%s!%s@%s on %s has removed gline for [%s@%s]",
+			 parv[1], parv[2], parv[3], parv[4], parv[5], parv[6]);
+	}
+
+#endif GLINES
+    }
+}
diff -ruN ircd-hybrid-6.2/src/messages.tab ircd-hybrid-6.2cj1/src/messages.tab
--- ircd-hybrid-6.2/src/messages.tab	Mon Jul  2 02:19:45 2001
+++ ircd-hybrid-6.2cj1/src/messages.tab	Fri Jun 21 22:05:29 2002
@@ -416,8 +416,8 @@
 /* 374 RPL_ENDOFINFO, */        ":%s 374 %s :End of /INFO list.",
 /* 375 RPL_MOTDSTART, */        ":%s 375 %s :- %s Message of the Day - ",
 /* 376 RPL_ENDOFMOTD, */        ":%s 376 %s :End of /MOTD command.",
-/* 377 */       (char *)NULL,
-/* 378 */       (char *)NULL,
+/* 377 RPL_MAP, */              ":%s 377 %s %s%s",
+/* 378 RPL_ENDOFMAP */          ":%s 378 %s :End of /MAP list.",
 /* 379 */       (char *)NULL,
 /* 380 */       (char *)NULL,
 /* 381 RPL_YOUREOPER, */        ":%s 381 %s :You have entered... the Twilight Zone!.",
@@ -547,6 +547,7 @@
 /* 502 ERR_USERSDONTMATCH, */   ":%s 502 %s :Can't change mode for other users",
 /* 503 ERR_GHOSTEDCLIENT, */    ":%s 503 %s :Message could not be delivered to %s",
 /* 504 LAST ERR_LAST_ERR_MSG, */        ":%s 504 %s :Last Error Message",
+/* 512 ERR_MAXMAPNODES */  ":%s 512 %s :Maximum nodes for /MAP",
                 (char *)NULL
 };
 
diff -ruN ircd-hybrid-6.2/src/messages_cust.tab ircd-hybrid-6.2cj1/src/messages_cust.tab
--- ircd-hybrid-6.2/src/messages_cust.tab	Mon Jul  2 02:19:46 2001
+++ ircd-hybrid-6.2cj1/src/messages_cust.tab	Fri Jun 21 22:05:29 2002
@@ -417,8 +417,8 @@
 /* 374 RPL_ENDOFINFO, */        ":%s 374 %s :End of /INFO list.",
 /* 375 RPL_MOTDSTART, */        ":%s 375 %s :- %s Message of the Day - ",
 /* 376 RPL_ENDOFMOTD, */        ":%s 376 %s :End of /MOTD command.",
-/* 377 */       (char *)NULL,
-/* 378 */       (char *)NULL,
+/* 377 RPL_MAP, */              ":%s 377 %s %s%s",
+/* 378 RPL_ENDOFMAP */          ":%s 378 %s :End of /MAP list.",
 /* 379 */       (char *)NULL,
 /* 380 */       (char *)NULL,
 /* 381 RPL_YOUREOPER, */        ":%s 381 %s :You are now one bad motherfucker - Go /kill someone.",
@@ -548,6 +548,7 @@
 /* 502 ERR_USERSDONTMATCH, */   ":%s 502 %s :Can't change mode for other users",
 /* 503 ERR_GHOSTEDCLIENT, */    ":%s 503 %s :Message could not be delivered to %s",
 /* 504 LAST ERR_LAST_ERR_MSG, */        ":%s 504 %s :Last Error Message",
+/* 512 ERR_MAXMAPNODES */  ":%s 512 %s :Maximum nodes for /MAP",
                 (char *)NULL
 };
 
diff -ruN ircd-hybrid-6.2/src/s_serv.c ircd-hybrid-6.2cj1/src/s_serv.c
--- ircd-hybrid-6.2/src/s_serv.c	Fri Jul 27 16:20:24 2001
+++ ircd-hybrid-6.2cj1/src/s_serv.c	Fri Jun 21 22:05:29 2002
@@ -840,6 +840,12 @@
               }
           }
 	send_channel_modes(cptr, chptr);
+ #ifdef TOPIC_INFO
+         if (chptr->topic_time)
+           sendto_one(cptr,":%s STOPIC %s %s %i :%s",
+                      me.name, chptr->chname, chptr->topic_nick,
+                      chptr->topic_time, chptr->topic);
+ #endif
       }
     /*
     ** also send out those that are not on any channel
diff -ruN ircd-hybrid-6.2/src/s_user.c ircd-hybrid-6.2cj1/src/s_user.c
--- ircd-hybrid-6.2/src/s_user.c	Tue Jul 17 18:37:18 2001
+++ ircd-hybrid-6.2cj1/src/s_user.c	Fri Jun 21 22:05:29 2002
@@ -70,8 +70,8 @@
                      char *);
 
 static int nickkilldone(aClient *, aClient *, int, char **, time_t, char *);
-static int valid_hostname(const char* hostname);
-static int valid_username(const char* username);
+int valid_hostname(const char* hostname);
+int valid_username(const char* username);
 static void report_and_set_user_flags( aClient *, aConfItem * );
 static int tell_user_off(aClient *,char **);
 
@@ -962,7 +962,7 @@
  * NOTE: this doesn't allow a hostname to begin with a dot and
  * will not allow more dots than chars.
  */
-static int valid_hostname(const char* hostname)
+int valid_hostname(const char* hostname)
 {
   int         dots  = 0;
   int         chars = 0;
@@ -994,7 +994,7 @@
  * Absolutely always reject any '*' '!' '?' '@' '.' in an user name
  * reject any odd control characters names.
  */
-static int valid_username(const char* username)
+int valid_username(const char* username)
 {
   const char *p = username;
   assert(0 != p);
diff -ruN ircd-hybrid-6.2/src/version.c ircd-hybrid-6.2cj1/src/version.c
--- ircd-hybrid-6.2/src/version.c	Wed Dec 31 16:00:00 1969
+++ ircd-hybrid-6.2cj1/src/version.c	Fri Jun 21 22:05:29 2002
@@ -0,0 +1,131 @@
+/*
+ *   IRC - Internet Relay Chat, src/version.c
+ *   Copyright (C) 1990 Chelsea Ashley Dyerman
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 1, or (at your option)
+ *   any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/*
+ * This file is generated by version.c.SH. Any changes made will go away.
+ */
+
+#include "struct.h"
+#include "patchlevel.h"
+#include "serno.h"
+
+char *generation = "2";
+char *creation = "Fri Jun 21 2002 at 11:30:40 PDT";
+char *version = PATCHLEVEL;
+char *serno = SERIALNUM;
+char *platform = "Linux pcgod 2.4.17-r5 #2 SMP Thu Apr 4 00:23:42 PST 2002 i686 GenuineIntel";
+
+char *infotext[] =
+{
+  "IRC --",
+  "Based on the original code written by Jarkko Oikarinen",
+  "Copyright 1988, 1989, 1990, 1991 University of Oulu, Computing Center",
+  "",
+  "This program is free software; you can redistribute it and/or",
+  "modify it under the terms of the GNU General Public License as",
+  "published by the Free Software Foundation; either version 1, or",
+  "(at your option) any later version.",
+  "",
+  "  The hybrid team is a group of ircd coders who were frustrated",
+  "with the instability and all-out dirtiness of the EFnet ircd's",
+  "available. hybrid is the name for the collective efforts of a group",
+  "of people, all of us.",
+  " ",
+  "Anyone is welcome to contribute to this effort. We are serious about this.",
+  " ",
+  "  We have run the code through purify, a commercial program designed",
+  "to find memory leaks. It continues to be checked with malloc tools today.",
+  "The code has been prototyped. Profiling has also been done to catch",
+  "slow portions of the code. crufty code has been re-written, obsolete",
+  "code has been ripped out. We have also looked at making the code as easy",
+  "to setup up and run as possible using configure, et cetera.",
+  "Finally speed enhancements and other enhancements have been made to this",
+  "ircd, and continue to be made to this ircd.",
+  " ",
+  "  That is not to say that there are still not bugs; there are always bugs.",
+  "But we review each other's work on this project, and are open to publicly",
+  "submittable bug reports.",
+  " ",
+  "The core team as, of this major release:",
+  " ",
+  "cosine        Patrick Alken      <wnder@uwns.underworld.net>",
+  "Dianora       Diane Bruce        <db@db.net>",
+  "larne         Edward Brocklesby  <ejb@leguin.org.uk>",
+  "Neph|l|m      Adel Mezibra       <adel@cybercable.fr>",
+  "pro           Bill Jonus         <proggy@earthling.net>",
+  "Rodder        Jon Lusky          <lusky@blown.net>",
+  "toot          Toby Verrall       <to7@antipope.fsnet.co.uk>",
+  "Wohali        Joan Touzet        <joant@ieee.org>",
+  "xyst          Greg Prosser       <gnp@arrogant.org>",
+  " ",
+  "The following people have contributed blood, sweat, and/or code to",
+  "this release of hybrid, in nick alphabetical order:",
+  " ",
+  "ArielIL       Ariel Biener       <ariel@fireball.tau.ac.il>",
+  "A1kmm         Andrew Miller      <a1kmm@mware.virtualave.net>",
+  "Bleep         Thomas Helvey      <tomh@inxpress.net>",
+  "CBongo        Chris Bongaarts    <cab@tc.umn.edu>",
+  "comstud       Chris Behrens      <cbehrens@concentric.net>",
+  "David-T       David Taylor       <davidt@yadt.co.uk>",
+  "echo          Adam J. Durana     <adam@caca.com>",
+  "fl_           Lee Hardy          <leeh@shagged.org>",
+  "FlashMan      Craig A. Huegen    <chuegen@quadrunner.com>",
+  "Hwy101        Walter Campbell    <wcampbel@botbay.net>",
+  "jailbird      Dustin Marquess    <jailbird@alcatraz.fdf.net>",
+  "johan         Johannes Erdfelt   <jerdfelt@eng.mindspring.net>",
+  "koitsu/k9     Jeremy Chadwick    <jdc@best.net>",
+  "kre           Dinko Korunic      <kreator@fly.srk.fer.hr>",
+  "LarZ          Matthew Ramsey     <mjr@blackened.com>",
+  "orabidoo      Roger Espel LLima  <espel@unix.bigots.org>",
+  "Riedel        Dennis Vink        <vink@vuurwerk.nl>",
+  "Seaner        Sean McVeigh       <sdlmcvei@uwaterloo.ca>",
+  "Shadowfax     Michael Pearce     <mpearce@varner.com>",
+  "Slowaris      Ryan Parker        <rjp@wpmedia.com>",
+  "Taner         Taner Halicioglu   <taner@cerf.net>",
+  "ThemBones     Brian Kraemer      <kraemer@u.washington.edu>",
+  "White_Dragon  Chip Norkus        <wd@dal.net>",
+  "WintrHawk     Jake Khuon         <khuon@GCtr.Net>",
+  "              Piotr Kucharski    <chopin@sgh.waw.pl>",
+  " ",
+  "Developers and Contributors for previous versions:",
+  " ",
+  "Chris Portman       Keith Fralick       Jon Mischo",
+  "Sam Noble           Paul Graham         Darren Reed",
+  "Markku Savela       Greg Lindahl        Jarkko Oikarinen",
+  "Armin Gruner        Matthew Green       Chuck Kane",
+  "Matt Lyle           Vesa Ruokonen       Nicolas Pioch",
+  "Stellan Klebom      Dan Goodwin         Mike Bolotski",
+  "Ian Frechette       Markku Jarvinen     Kimmo Suominen",
+  "Jeff Trim           Vijay Subramaniam   Karl Kleinpaste",
+  "Bill Wisner         Tom Davis           Hugo Calendar",
+  "Bo Adler            Michael Sandrof     Jon Solomon",
+  "Jan Peterson        Helen Rose          Tom Hopkins",
+  "Stephen van den Berg",
+  " ",
+  "Others are welcome. Always.",
+  " ",
+  "Thanks also goes to those persons not mentioned here who have added",
+  "their advice, opinions, and code to IRC.",
+  "Thanks also to those who provide the kind sysadmins who let me and",
+  "others continue to develop IRC.",
+  " ",
+  "Email fixes/complaints/rotten tomatoes to ircd-hybrid@the-project.org.",
+  "",
+  0,
+};
