diff -ur ircd-hybrid-6/include/s_conf.h ircd-hybrid-6-tdline/include/s_conf.h
--- ircd-hybrid-6/include/s_conf.h	Fri Apr 12 12:49:32 2002
+++ ircd-hybrid-6-tdline/include/s_conf.h	Fri Apr 12 13:57:56 2002
@@ -189,6 +189,7 @@
 extern int              specific_virtual_host; /* GLOBAL - used in s_bsd.c */
 extern struct ConfItem *temporary_klines;
 extern struct ConfItem *temporary_ip_klines;
+extern struct ConfItem *temporary_dlines;
 extern ConfigFileEntryType ConfigFileEntry;    /* GLOBAL - defined in ircd.c */
 
 extern void clear_ip_hash_table(void);
@@ -244,6 +245,7 @@
 extern struct ConfItem* find_is_klined(const char* host, 
                                        const char* name,
                                        unsigned long ip);
+extern struct ConfItem *find_tdline(unsigned long ip);
 extern char* show_iline_prefix(struct Client *,struct ConfItem *,char *);
 extern void get_printable_conf(struct ConfItem *,
 			       char **, char **, char **, char **, int *);
@@ -271,8 +273,10 @@
 extern const char *get_conf_name(KlineType);
 extern int safe_write(struct Client *, const char *, int ,char *);
 extern void add_temp_kline(struct ConfItem *);
+extern void add_temp_dline(struct ConfItem *);
 extern  void    flush_temp_klines(void);
 extern  void    report_temp_klines(struct Client *);
+extern void report_temp_dlines(struct Client *);
 extern  void    show_temp_klines(struct Client *, struct ConfItem *);
 extern  int     is_address(char *,unsigned long *,unsigned long *); 
 extern  int     rehash (struct Client *, struct Client *, int);
diff -ur ircd-hybrid-6/src/client.c ircd-hybrid-6-tdline/src/client.c
--- ircd-hybrid-6/src/client.c	Fri Apr 12 12:49:32 2002
+++ ircd-hybrid-6-tdline/src/client.c	Fri Apr 12 13:28:40 2002
@@ -364,6 +364,39 @@
 #endif
                   continue;         /* and go examine next fd/cptr */
                 }
+	      else if((aconf = find_tdline(ntohl(cptr->ip.s_addr))))
+	      {
+		  sendto_realops("D-line active for %s", get_client_name(cptr, FALSE));
+
+		  dying_clients[die_index] = cptr;
+
+
+#if defined(KLINE_WITH_CONNECTION_CLOSED) && defined(KLINE_WITH_REASON)
+		  dying_clients_reason[die_index++] = "Connection closed";
+		  reason = aconf->passwd ? aconf->passwd :"D-lined";
+#else
+#ifdef KLINE_WITH_CONNECTION_CLOSED
+		  reason = "Connection closed";
+		  dying_clients_reason[die_index++] = reason;
+#else
+#ifdef KLINE_WITH_REASON
+		  reason = aconf->passwd ? aconf->passwd : "D-lined";
+		  dying_clients_reason[die_index++] = reason;
+#else
+		  reason = "D-lined";
+		  dying_clients_reason[die_index++] = reason;
+#endif
+#endif
+#endif
+		  dying_clients[die_index] = (struct Client *)NULL;
+		  if(IsPerson(cptr))
+		      sendto_one(cptr, form_str(ERR_YOUREBANNEDCREEP),
+				 me.name, cptr->name, reason);
+		  else
+		      sendto_one(cptr, "NOTICE DLINE :*** You have been D-lined");
+
+		  continue;
+	      }
             }
           else
             {
diff -ur ircd-hybrid-6/src/dline_conf.c ircd-hybrid-6-tdline/src/dline_conf.c
--- ircd-hybrid-6/src/dline_conf.c	Fri Apr 12 12:49:32 2002
+++ ircd-hybrid-6-tdline/src/dline_conf.c	Fri Apr 12 15:04:11 2002
@@ -828,9 +828,9 @@
 
       c = 'D';
       if(scan->flags & CONF_FLAGS_E_LINED)
-        c = 'd';
-      /* print Dline */
+        c = 'E';
 
+      /* print Dline */
       get_printable_conf(scan, &name, &host, &pass, &user, &port);
 
       sendto_one(sptr, form_str(RPL_STATSDLINE), me.name,
diff -ur ircd-hybrid-6/src/m_kline.c ircd-hybrid-6-tdline/src/m_kline.c
--- ircd-hybrid-6/src/m_kline.c	Fri Apr 12 12:49:32 2002
+++ ircd-hybrid-6-tdline/src/m_kline.c	Fri Apr 12 14:41:53 2002
@@ -1076,6 +1076,9 @@
   char buffer[1024];
   const char* current_date;
   const char *dconf;
+  char *argv;
+  int temp_dline_time = 0;
+  time_t temporary_dline_time_seconds=0;
 
   if (!MyClient(sptr) || !IsAnOper(sptr))
     {
@@ -1096,7 +1099,27 @@
       return 0;
     }
 
-  host = parv[1];
+  argv = parv[1];
+  
+  if((temp_dline_time = isnumber(argv)))
+  {
+      if(parc < 3)
+      {
+	  sendto_one(sptr, form_str(ERR_NEEDMOREPARAMS),
+		     me.name, parv[0], "DLINE");
+	  return 0;
+      }
+
+      /* maxed at 7 days */
+      if(temp_dline_time > (24*60*7))
+	  temp_dline_time = (24*60*7);
+
+      temporary_dline_time_seconds = (time_t)temp_dline_time * (time_t)60;
+      argv = parv[2];
+      parc--;
+  }
+  
+  host = argv;
   strncpy_irc(cidr_form_host, host, 32);
   cidr_form_host[32] = '\0';
 
@@ -1112,7 +1135,7 @@
 
   if(!is_address(host,&ip_host,&ip_mask))
     {
-      if (!(acptr = find_chasing(sptr, parv[1], NULL)))
+      if (!(acptr = find_chasing(sptr, argv, NULL)))
         return 0;
 
       if(!acptr->user)
@@ -1181,9 +1204,14 @@
     }
 
 
+  if(temp_dline_time)
+      argv = parv[3];
+  else
+      argv = parv[2];
+
   if (parc > 2) /* host :reason */
     {
-      if(strchr(parv[2], ':'))
+      if(strchr(argv, ':'))
         {
           sendto_one(sptr,
                      ":%s NOTICE %s :Invalid character ':' in comment",
@@ -1191,7 +1219,7 @@
           return 0;
         }
 
-      if(strchr(parv[2], '#'))
+      if(strchr(argv, '#'))
         {
           sendto_one(sptr,
                      ":%s NOTICE %s :Invalid character '#' in comment",
@@ -1199,8 +1227,8 @@
           return 0;
         }
 
-      if(*parv[2])
-        reason = parv[2];
+      if(*argv)
+        reason = argv;
       else
         reason = "No reason";
     }
@@ -1245,6 +1273,19 @@
        
      }
 
+  /* allow permanent dlines to overwrite temp dlines.. */
+  if((aconf = find_tdline(ip_host)) && temp_dline_time)
+  {
+      char *nrkreason;
+
+      nrkreason = aconf->passwd ? aconf->passwd : "<No Reason>";
+
+      sendto_one(sptr, ":%s NOTICE %s :[%s] already D-lined by [%s] - %s",
+		 me.name, parv[0], host, aconf->host, nrkreason);
+      
+      return 0;
+  }
+  
   current_date = smalldate((time_t) 0);
 
   ircsprintf(buffer, "%s (%s)",reason,current_date);
@@ -1256,6 +1297,24 @@
 
   aconf->ip = ip_host;
   aconf->ip_mask = ip_mask;
+  
+  if(temp_dline_time)
+  {
+      ircsprintf(buffer, "Temporary D-line %d min - %s (%s)",
+		 temp_dline_time, reason, current_date);
+
+      aconf->hold = CurrentTime + temporary_dline_time_seconds;
+
+      add_temp_dline(aconf);
+      rehashed = YES;
+      dline_in_progress = YES;
+
+      nextping = CurrentTime;
+
+      sendto_realops("%s added temporary %d min. D-Line for [%s] [%s]",
+		     parv[0], temp_dline_time, host, reason);
+      return 0;
+  }
 
   add_Dline(aconf);
 
diff -ur ircd-hybrid-6/src/m_stats.c ircd-hybrid-6-tdline/src/m_stats.c
--- ircd-hybrid-6/src/m_stats.c	Fri Apr 12 12:49:32 2002
+++ ircd-hybrid-6-tdline/src/m_stats.c	Fri Apr 12 13:45:31 2002
@@ -293,6 +293,7 @@
           break;
         }
       report_dlines(sptr);
+      report_temp_dlines(sptr);
       valid_stats++;
       break;
 
diff -ur ircd-hybrid-6/src/m_unkline.c ircd-hybrid-6-tdline/src/m_unkline.c
--- ircd-hybrid-6/src/m_unkline.c	Fri Apr 12 12:49:32 2002
+++ ircd-hybrid-6-tdline/src/m_unkline.c	Fri Apr 12 14:15:38 2002
@@ -51,6 +51,7 @@
 
 static int flush_write(aClient *, FBFILE* , char *, char *);
 static int remove_tkline_match(char *,char *, unsigned long);
+static int remove_tdline(unsigned long);
 
 /*
 ** m_unkline
@@ -442,6 +443,37 @@
   }
 }
 
+/* remove_tdline()
+ *
+ * inputs	- ip of dline to remove
+ * output	-
+ * side effects - dline, if found, is removed
+ */
+static int remove_tdline(unsigned long ip)
+{
+    struct ConfItem *ptr;
+    struct ConfItem *last_ptr = NULL;
+
+    if(!temporary_dlines)
+	return NO;
+
+    for(ptr = temporary_dlines; ptr; ptr = ptr->next)
+    {
+	if((ip & ptr->ip_mask) == ptr->ip)
+	{
+	    if(last_ptr)
+		last_ptr->next = ptr->next;
+	    else
+		temporary_dlines = ptr->next;
+
+	    free_conf(ptr);
+	    return YES;
+	}
+	
+	last_ptr = ptr;
+    }
+}
+
 /*
 ** m_undline
 ** added May 28th 2000 by Toby Verrall <toot@melnet.co.uk>
@@ -505,6 +537,18 @@
       return 0;
     }
 
+  if((remove_tdline(ip_host)))
+  {
+      sendto_one(sptr, ":%s NOTICE %s :Temporary D-line for [%s] is removed",
+		 me.name, parv[0], cidr);
+
+      sendto_ops("%s has removed the temporary D-line for: [%s]", parv[0], cidr);
+      log(L_NOTICE, "%s has removed temporary D-line for [%s]", parv[0], cidr);
+
+      return 0;
+  }
+
+		
   filename = get_conf_name(DLINE_TYPE);
 
   if( (in = fbopen(filename, "r")) == 0)
diff -ur ircd-hybrid-6/src/s_conf.c ircd-hybrid-6-tdline/src/s_conf.c
--- ircd-hybrid-6/src/s_conf.c	Fri Apr 12 12:49:32 2002
+++ ircd-hybrid-6-tdline/src/s_conf.c	Fri Apr 12 14:52:28 2002
@@ -85,9 +85,11 @@
 static void clear_special_conf(struct ConfItem **);
 static struct ConfItem* find_tkline(const char*, const char*, unsigned long);
 static void expire_temp_klines(struct ConfItem **tklines);
+static void expire_temp_dlines(struct ConfItem **tdlines);
 
 struct ConfItem *temporary_klines = NULL;
 struct ConfItem *temporary_ip_klines = NULL;
+struct ConfItem *temporary_dlines = NULL;
 
 static  char *set_conf_flags(struct ConfItem *,char *);
 static  int  oper_privs_from_string(int,char *);
@@ -2695,7 +2697,11 @@
 
   if (aconf && !IsConfElined(aconf))
     return 0;
-  return 1;
+
+  if((aconf = find_tdline(ntohl((unsigned long)addr.s_addr))))
+      return 0;
+  else
+      return 1;
 }
 
 /*
@@ -2753,6 +2759,37 @@
   }
 }
 
+/* expire_temp_dlines()
+ *
+ * inputs	- pointer to dline list
+ * output	-
+ * side effects - dlines that have "expired" are cleared
+ */
+static void expire_temp_dlines(struct ConfItem **tdlines)
+{
+    struct ConfItem *ptr;
+    struct ConfItem *next_ptr;
+    struct ConfItem *last_ptr = NULL;
+
+    for(ptr = *tdlines; ptr; ptr = next_ptr)
+    {
+	next_ptr = ptr->next;
+
+	if(ptr->hold <= CurrentTime)
+	{
+	    if(last_ptr != NULL)
+		last_ptr->next = ptr->next;
+	    else
+		*tdlines = ptr->next;
+
+	    sendto_realops("Temporary D-line for [%s] expired", ptr->host);
+	    free_conf(ptr);
+	}
+	else
+	    last_ptr = ptr;
+    }
+}
+    
 /*
  * find_tkline
  *
@@ -2792,6 +2829,27 @@
   return (NULL);
 }
 
+/* find_tdline()
+ *
+ * inputs	- hostname
+ * outputs	-
+ * side effects - returns matching ConfItem or NULL
+ */
+struct ConfItem *find_tdline(unsigned long ip)
+{
+    struct ConfItem *ptr;
+    
+    expire_temp_dlines(&temporary_dlines);
+
+    for(ptr = temporary_dlines; ptr; ptr = ptr->next)
+    {
+	if(ptr->ip && ((ip & ptr->ip_mask) == ptr->ip))
+	    return ptr;
+    }
+
+    return NULL;
+}
+
 /*
  * find_is_klined()
  *
@@ -2820,6 +2878,8 @@
   found_aconf = find_matching_mtrie_conf(host, name, ntohl(ip));
   if(found_aconf && (found_aconf->status & (CONF_ELINE|CONF_DLINE|CONF_KILL)))
     return(found_aconf);
+  else if((found_aconf = find_tdline(ntohl(ip))))
+      return found_aconf;
   else
     return NULL;
 }
@@ -2873,6 +2933,18 @@
     }
 }
 
+/* add_temp_dline()
+ *
+ * inputs	- pointer to ConfItem
+ * outputs	-
+ * side effects - ConfItem is added to dline list
+ */
+void add_temp_dline(struct ConfItem *aconf)
+{
+    aconf->next = temporary_dlines;
+    temporary_dlines = aconf;
+}
+
 /* flush_temp_klines
  *
  * inputs        - NONE
@@ -2925,6 +2997,28 @@
 
 }
 
+/* report_temp_dlines
+ *
+ * input	- client to report to
+ * output	-
+ * side effects - client is shown temp dline list
+ */
+void report_temp_dlines(struct Client *sptr)
+{
+    struct ConfItem *ptr;
+    char *name, *host, *pass, *user;
+    int port;
+
+    expire_temp_dlines(&temporary_dlines);
+    for(ptr = temporary_dlines; ptr; ptr = ptr->next)
+    {
+	get_printable_conf(ptr, &name, &host, &pass, &user, &port);
+
+        sendto_one(sptr, form_str(RPL_STATSDLINE), me.name,
+		   sptr->name, 'd', host, pass);
+    }
+}
+
 /* show_temp_klines
  *
  * inputs	- aClient pointer, client to report to
@@ -3413,7 +3507,14 @@
                          host,
                          pass);
                 }
-              else
+              else if((aconf = find_tdline(ip)))
+	      {
+		  get_printable_conf(aconf, &name, &host, &pass, &user, &port);
+		  sendto_one(sptr,
+			     ":%s NOTICE %s :Temp D-line host [%s] pass [%s]",
+			     me.name, parv[0], host, pass);
+	      }
+	      else
                 sendto_one(sptr, ":%s NOTICE %s :No aconf found",
                          me.name, parv[0]);
             }
