--- xinit-1.0.4/xinit.c.client-session 2007-07-30 17:28:48.000000000 +0200 +++ xinit-1.0.4/xinit.c 2007-07-30 17:30:04.000000000 +0200 @@ -766,11 +766,21 @@ startClient(char *client[]) { setWindowPath(); if ((clientpid = vfork()) == 0) { + int fd; if (setuid(getuid()) == -1) { Error("cannot change uid: %s\n", strerror(errno)); _exit(ERR_EXIT); } - setpgid(0, getpid()); + fd = open ("/dev/null", O_RDONLY); + + if (fd < 0) { + Error("cannot open /dev/null: %s\n", strerror(errno)); + _exit(ERR_EXIT); + } + close (STDIN_FILENO); + dup2 (fd, STDIN_FILENO); + close (fd); + setsid(); environ = newenviron; #ifdef __UNIXOS2__ #undef environ