xorg-x11-xinit/xinit-1.0.2-client-session.patch
2007-09-24 18:10:45 +00:00

26 lines
659 B
Diff

--- xinit-1.0.2/xinit.c.client-session 2006-11-10 00:24:25.000000000 -0500
+++ xinit-1.0.2/xinit.c 2006-11-10 00:30:42.000000000 -0500
@@ -692,11 +692,21 @@
startClient(char *client[])
{
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