diff -uNrd ircd-hybrid-6.2.dist/include/m_commands.h ircd-hybrid-6.2/include/m_commands.h
--- ircd-hybrid-6.2.dist/include/m_commands.h	Fri Nov 23 23:09:29 2001
+++ ircd-hybrid-6.2/include/m_commands.h	Sat Nov 24 14:51:55 2001
@@ -33,6 +33,7 @@
 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_xline(struct Client *,struct Client *,int,char **);
 
 extern int m_gline(struct Client *,struct Client *,int,char **);
 
diff -uNrd ircd-hybrid-6.2.dist/include/msg.h ircd-hybrid-6.2/include/msg.h
--- ircd-hybrid-6.2.dist/include/msg.h	Fri Nov 23 23:09:29 2001
+++ ircd-hybrid-6.2/include/msg.h	Sat Nov 24 14:53:31 2001
@@ -115,6 +115,7 @@
 #define MSG_KLINE    "KLINE"    /* KLINE */
 #define MSG_UNKLINE  "UNKLINE"  /* UNKLINE */
 #define MSG_DLINE    "DLINE"    /* DLINE */
+#define MSG_XLINE    "XLINE"    /* XLINE */
 #define MSG_HTM      "HTM"      /* HTM */
 #define MSG_SET      "SET"      /* SET */
 
@@ -242,6 +243,7 @@
   { 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_XLINE,   m_xline,    0, MAXPARA, 1, 0, 0, 0L },
   { MSG_GLINE,   m_gline,    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 },
diff -uNrd ircd-hybrid-6.2.dist/include/s_conf.h ircd-hybrid-6.2/include/s_conf.h
--- ircd-hybrid-6.2.dist/include/s_conf.h	Fri Nov 23 23:09:31 2001
+++ ircd-hybrid-6.2/include/s_conf.h	Sat Nov 24 14:48:18 2001
@@ -258,7 +258,8 @@
 typedef enum {
   CONF_TYPE,
   KLINE_TYPE,
-  DLINE_TYPE
+  DLINE_TYPE,
+  XLINE_TYPE
 } KlineType;
 
 extern void write_kline_or_dline_to_conf_and_notice_opers(
diff -uNrd ircd-hybrid-6.2.dist/opers.txt ircd-hybrid-6.2/opers.txt
--- ircd-hybrid-6.2.dist/opers.txt	Fri Nov 23 23:09:57 2001
+++ ircd-hybrid-6.2/opers.txt	Sat Nov 24 15:23:00 2001
@@ -189,6 +189,15 @@
                   In order to use <nick> rather than <ip>, <nick> must
                   be on your server.
 
++ XLINE         - XLINE <match> :[reason]
+                  Adds an XLINE to the ircd.conf or klines.conf file
+                  which will deny any connection from users using the
+                  matched gecos field.  The banned client will receive
+                  a message saying he/she is banned because of bad
+                  user info.
+
+                  The match text cannot have a space in it.
+
 + HTM           - HTM [option]
                   When no [option] is given, HTM shows the current 
                   High Traffic Mode rate and whether HTM is on or off.
diff -uNrd ircd-hybrid-6.2.dist/src/m_kline.c ircd-hybrid-6.2/src/m_kline.c
--- ircd-hybrid-6.2.dist/src/m_kline.c	Fri Nov 23 23:09:38 2001
+++ ircd-hybrid-6.2/src/m_kline.c	Sat Nov 24 15:05:54 2001
@@ -75,6 +75,8 @@
                        const char *);
 static void WriteDline(const char *, aClient *,
                        const char *, const char *, const char *);
+static void WriteXline(const char *, aClient *,
+                       const char *, const char *, const char *);
 
 /*
 AddPending()
@@ -1265,3 +1267,194 @@
   nextping = CurrentTime;
   return 0;
 } /* m_dline() */
+
+
+/* XLINE addition patch - Not guaranteed!
+ * -Hwy
+ */
+
+int
+m_xline(aClient *cptr, aClient *sptr, int parc, char *parv[])
+
+{
+  char *host, *reason;
+  aClient *acptr;
+  aConfItem *aconf;
+  char buffer[1024];
+  const char* current_date;
+  const char *dconf;
+
+  if (!MyClient(sptr) || !IsAnOper(sptr))
+    {
+      sendto_one(sptr, form_str(ERR_NOPRIVILEGES), me.name, parv[0]);
+      return 0;
+    }
+
+  if(!IsSetOperK(sptr))
+    {
+      sendto_one(sptr,":%s NOTICE %s :You have no K flag",me.name,parv[0]);
+      return 0;
+    }
+
+  if ( parc < 2 )
+    {
+      sendto_one(sptr, form_str(ERR_NEEDMOREPARAMS),
+                 me.name, parv[0], "XLINE");
+      return 0;
+    }
+
+  host = parv[1];
+
+  if (parc > 2) /* host :reason */
+    {
+      if(strchr(parv[2], ':'))
+        {
+          sendto_one(sptr,
+                     ":%s NOTICE %s :Invalid character ':' in comment",
+                     me.name, parv[0]);
+          return 0;
+        }
+
+      if(strchr(parv[2], '#'))
+        {
+          sendto_one(sptr,
+                     ":%s NOTICE %s :Invalid character '#' in comment",
+                     me.name, parv[0]);
+          return 0;
+        }
+
+      if(*parv[2])
+        reason = parv[2];
+      else
+        reason = "No reason";
+    }
+  else
+    reason = "No reason";
+
+  current_date = smalldate((time_t) 0);
+
+  ircsprintf(buffer, "%s (%s)",reason,current_date);
+
+  aconf = make_conf();
+  aconf->status = CONF_XLINE;
+  aconf->user = NULL;
+  DupString(aconf->name,host);
+  aconf->host = aconf->name;
+  DupString(aconf->passwd,buffer);
+  /* Default to REJECT with NOTIFY */
+  aconf->port = 1;
+  aconf->next = x_conf;
+  x_conf = aconf;
+
+        sendto_realops("%s added X-Line for [%s] [%s]",
+                sptr->name,
+                host,
+                reason);
+
+        log(L_TRACE, "%s added X-Line for [%s] [%s]", 
+            sptr->name, host, reason);
+
+        dconf = get_conf_name(XLINE_TYPE);
+
+        /*
+         * Check if the conf file is locked - if so, add the dline
+         * to our pending dline list, to be written later, if not,
+         * allow this dline to be written, and write out all other
+         * pending lines as well
+         */
+        if (LockedFile(dconf))
+        {
+                aPendingLine *pptr;
+
+                pptr = AddPending();
+
+                /*
+                 * Now fill in the fields
+                 */
+                pptr->type = XLINE_TYPE;
+                pptr->sptr = sptr;
+                pptr->rcptr = (aClient *) NULL;
+                pptr->user = (char *) NULL;
+                pptr->host = strdup(host);
+                pptr->reason = strdup(reason);
+                pptr->when = strdup(current_date);
+
+                sendto_one(sptr,
+                        ":%s NOTICE %s :Added X-Line [%s] (config file write delayed)",
+                        me.name,
+                        sptr->name,
+                        host);
+
+                return 0;
+        }
+        else if (PendingLines)
+                WritePendingLines(dconf);
+
+        sendto_one(sptr,
+                ":%s NOTICE %s :Added X-Line [%s] to %s",
+                me.name,
+                sptr->name,
+                host,
+                dconf ? dconf : "configuration file");
+
+        /*
+         * Write dline to configuration file
+         */
+        WriteXline(dconf,
+                sptr,
+                host,
+                reason,
+                current_date);
+
+  return 0;
+} /* m_xline() */
+
+/*
+WriteXline()
+ Write out an xline to the kline configuration file
+*/
+
+static void
+WriteXline(const char *filename, aClient *sptr,
+           const char *host, const char *reason, const char *when)
+
+{
+  char buffer[1024];
+  int out;
+
+  if (!filename)
+    return;
+
+  if ((out = open(filename, O_RDWR|O_APPEND|O_CREAT, 0644)) == (-1))
+  {
+    sendto_realops("Error opening %s: %s",
+      filename,
+      strerror(errno));
+    return;
+  }
+
+  fchmod(out, 0660);
+
+  ircsprintf(buffer,
+    "#%s!%s@%s X'd: %s:%s (%s)\n",
+    sptr->name,
+    sptr->username,
+    sptr->host,
+    host,
+    reason,
+    when);
+
+  if (safe_write(sptr, filename, out, buffer) == (-1))
+    return;
+
+  ircsprintf(buffer, "X:%s:%s (%s)::1\n",
+    host,
+    reason,
+    when);
+
+  if (safe_write(sptr, filename, out, buffer) == (-1))
+    return;
+
+  (void) close(out);
+} /* WriteXline() */
+
