Index: Xtranslcl.c
===================================================================
RCS file: /cvs/xorg/lib/xtrans/Xtranslcl.c,v
retrieving revision 1.4
diff -u -r1.4 Xtranslcl.c
--- Xtranslcl.c	8 Nov 2005 06:33:26 -0000	1.4
+++ Xtranslcl.c	19 Jun 2006 21:22:07 -0000
@@ -360,7 +360,10 @@
 	uid_t       saved_euid;
 
 	saved_euid = geteuid();
-	setuid( getuid() ); /** sets the euid to the actual/real uid **/
+	/** sets the euid to the actual/real uid **/
+	if (setuid( getuid() ) == -1) {
+		exit(1);
+	}
 	if( chown( slave, saved_euid, -1 ) < 0 ) {
 		exit( 1 );
 		}
@@ -369,7 +372,13 @@
     }
 
     waitpid(saved_pid, &exitval, 0);
-
+    if (WIFEXITED(exitval) && WEXITSTATUS(exitval) != 0) {
+	close(fd);
+	close(server);
+	PRMSG(1, "PTSOpenClient: cannot set the owner of %s\n",
+	      slave, 0, 0);
+	return(-1);
+    }
     if (chmod(slave, 0666) < 0) {
 	close(fd);
 	close(server);