--- orig/wdm-1.27/include/dm.h	2004-05-28 06:21:29.000000000 +0200
+++ wdm-1.27/include/dm.h	2004-09-20 13:01:54.000000000 +0200
@@ -243,7 +243,7 @@
 #ifdef XDMCP
 
 #define PROTO_TIMEOUT	(30 * 60)   /* 30 minutes should be long enough */
-#define XDM_BROKEN_INTERVAL (120)   /* server crashing more than once within */
+#define XDM_BROKEN_INTERVAL (10)   /* server crashing more than once within */
                                     /* two minutes is assumed to be broken!  */
 struct protoDisplay {
 	struct protoDisplay	*next;
--- wdm-1.27/src/wdm/auth.c.orig	2005-03-17 01:10:18.000000000 +0100
+++ wdm-1.27/src/wdm/auth.c	2005-03-17 01:12:23.000000000 +0100
@@ -316,7 +316,7 @@
     	sprintf (d->authFile, "%s/%s/%s/A%s-XXXXXX",
 		 authDir, authdir1, authdir2, cleanname);
 #ifdef HAVE_MKSTEMP
-    	(void) mkstemp (d->authFile);
+    	(void) close(mkstemp (d->authFile));
 #else
     	(void) mktemp (d->authFile);
 #endif
--- wdm-1.27/src/wdm/dm.c.orig	2005-03-21 13:02:59.000000000 +0100
+++ wdm-1.27/src/wdm/dm.c	2005-03-21 13:03:32.000000000 +0100
@@ -576,6 +576,7 @@
 	    case running:
 		WDMDebug("Server for display %s terminated unexpectedly, status %d %d\n", d->name, waitVal (status), status);
 		WDMError("Server for display %s terminated unexpectedly: %d\n", d->name, waitVal (status));
+		d->status = notRunning;
 		if (d->pid != -1)
 		{
 		    WDMDebug("Terminating session pid %d\n", d->pid);
@@ -665,9 +666,10 @@
     {
     case 0:
 	CleanUpChild ();
-	(void) Signal (SIGPIPE, SIG_IGN);
 	LoadSessionResources (d);
 	SetAuthorization (d);
+	(void) Signal (SIGPIPE, SIG_IGN);
+	(void) Signal (SIGHUP, SIG_IGN);
 	if (!WaitForServer (d))
 	    exit (OPENFAILED_DISPLAY);
 #ifdef XDMCP
