diff -BPrU 0 ./include/m_commands.h ../ircd-hybrid-6.2-patched/include/m_commands.h
--- ./include/m_commands.h	Tue Jul 10 14:40:28 2001
+++ ../ircd-hybrid-6.2-patched/include/m_commands.h	Sat Oct 27 01:19:39 2001
@@ -35,0 +36 @@
+extern int m_undline(struct Client *,struct Client *,int,char **);
diff -BPrU 0 ./include/msg.h ../ircd-hybrid-6.2-patched/include/msg.h
--- ./include/msg.h	Tue Jul 10 14:40:28 2001
+++ ../ircd-hybrid-6.2-patched/include/msg.h	Sat Oct 27 01:20:15 2001
@@ -117,0 +118 @@
+#define MSG_UNDLINE  "UNDLINE"  /* UNDLINE */
@@ -244,0 +246 @@
+  { MSG_UNDLINE, m_undline,  0, MAXPARA, 1, 0, 0, 0L },
diff -BPrU 0 ./src/m_unkline.c ../ircd-hybrid-6.2-patched/src/m_unkline.c
--- ./src/m_unkline.c	Sun Aug  5 18:06:00 2001
+++ ../ircd-hybrid-6.2-patched/src/m_unkline.c	Sat Oct 27 01:50:24 2001
@@ -439,0 +440,199 @@
+
+
+/* m_undline written as a slightly modified copy of m_unkline.
+   Oct. 27th 2001
+   --einride
+*/
+   
+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[BUFSIZE];
+
+  const char  *filename;                /* filename to use for unkline */
+
+  char  *p;
+  int   error_on_write = NO;
+  mode_t oldumask;
+
+  ircsprintf(temppath, "%s%s.tmp", ConfigFileEntry.dpath,
+	     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;
+    }
+
+  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 */
+
+/*
+#einride!einride@idle.org D'd: 10.0.0.1/24:No reason (2001/10/26 22.19)
+D:10.0.0.1/24:No reason (2001/10/26 22.19)
+*/
+
+  while(fbgets(buf, sizeof(buf), in)) 
+    {
+      if((buf[1] == ':') && (buf[0] == 'D'))
+        {
+          /* its a D: line */
+          char *found_ip;
+
+          strncpy_irc(buff, buf, BUFSIZE);      /* extra paranoia */
+
+          p = strchr(buff,'\n');
+          if(p)
+            *p = '\0';
+
+          found_ip = buff + 2;        /* point past the D: */
+          p = strchr(found_ip,':');
+          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 ip",
+                         me.name, parv[0]);
+              log(L_ERROR, "D-Line file corrupted (couldn't find ip)");
+              if(!error_on_write)
+                error_on_write = flush_write(sptr, out, buf, temppath);
+              continue;         /* This D line is corrupted ignore */
+            }
+          *p = '\0';
+
+/*
+ * If it doesn't match, write it
+ */
+          if(strcmp(parv[1],found_ip))
+            {
+              if(!error_on_write)
+                error_on_write = flush_write(sptr, out, buf, temppath);
+            }
+          else
+            pairme++;
+
+        }                               
+      else if(buf[0] == '#')
+        {
+          char *found_ip;
+
+          strncpy_irc(buff, buf, BUFSIZE);
+/*
+#einride!einride@idle.org D'd: 10.0.0.1/24:No reason (2001/10/26 22.19)
+D:10.0.0.1/24:No reason (2001/10/26 22.19)
+
+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_ip = p;
+          p = strchr(found_ip,':');
+
+          if(p == (char *)NULL)
+            {
+              if(!error_on_write)
+                error_on_write = flush_write(sptr, out, buf, temppath);
+              continue;
+            }
+          *p = '\0';
+
+          while(*found_ip == ' ')
+            found_ip++;
+
+          if( (irccmp(found_ip,parv[1])))
+            {
+              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);
+
+/* The result of the rename should be checked too... oh well */
+/* If there was an error on a write above, then its been reported
+ * and I am not going to trash the original kline /conf file
+ * -Dianora
+ */
+  if(!error_on_write)
+    {
+      fbclose(out);
+      (void)rename(temppath, filename);
+      rehash(cptr,sptr,0);
+    }
+  else
+    {
+      sendto_one(sptr,":%s NOTICE %s :Couldn't write temp dline 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],parv[1]);
+      return 0;
+    }
+  sendto_one(sptr, ":%s NOTICE %s :D-Line for [%s] is removed", 
+             me.name, parv[0], parv[1]);
+  sendto_realops("%s has removed the D-Line for: [%s]",
+             parv[0], parv[1]);
+
+  log(L_NOTICE, "%s removed D-Line for [%s]", parv[0], parv[1]);
+  return 0; 
+}
