updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / xorg-xinit-git / xinit-1.0.2-client-session.patch
blob89381d069e3fa2dd1eaaaa0ecf03c8e2e332d709
1 --- xinit-1.0.2/xinit.c.client-session 2006-11-10 00:24:25.000000000 -0500
2 +++ xinit-1.0.2/xinit.c 2006-11-10 00:30:42.000000000 -0500
3 @@ -692,11 +692,21 @@
4 startClient(char *client[])
6 if ((clientpid = vfork()) == 0) {
7 + int fd;
8 if (setuid(getuid()) == -1) {
9 Error("cannot change uid: %s\n", strerror(errno));
10 _exit(ERR_EXIT);
12 - setpgid(0, getpid());
13 + fd = open ("/dev/null", O_RDONLY);
15 + if (fd < 0) {
16 + Error("cannot open /dev/null: %s\n", strerror(errno));
17 + _exit(ERR_EXIT);
18 + }
19 + close (STDIN_FILENO);
20 + dup2 (fd, STDIN_FILENO);
21 + close (fd);
22 + setsid();
23 environ = newenviron;
24 #ifdef __UNIXOS2__
25 #undef environ