--- gdm-2.6.0.7/daemon/slave.c.stat-home-dir-as-user	2005-02-28 11:47:36.000000000 -0500
+++ gdm-2.6.0.7/daemon/slave.c	2005-02-28 11:53:09.000000000 -0500
@@ -3885,6 +3885,15 @@
 	    /* script failed so just try again */
 	    return;
 		
+
+    }
+
+    if G_UNLIKELY (setegid (pwent->pw_gid) != 0 ||
+		   seteuid (pwent->pw_uid) != 0) {
+	    gdm_error ("Cannot set effective user/group id");
+	    gdm_verify_cleanup (d);
+	    session_started = FALSE;
+	    return;
     }
 
     if G_UNLIKELY (pwent->pw_dir == NULL ||
@@ -3898,6 +3901,9 @@
 		       "you use a failsafe session."),
 		     ve_sure_string (pwent->pw_dir));
 
+            seteuid (0);
+            setegid (GdmGroupId);
+
 	    gdm_error (_("%s: Home directory for %s: '%s' does not exist!"),
 		       "gdm_slave_session_start",
 		       login,
