xorg-x11-xinit/xinit-1.0.2-client-session.patch

27 lines
741 B
Diff
Raw Normal View History

2008-08-25 13:58:56 +00:00
diff -up xinit-1.0.9/xinit.c.client-session xinit-1.0.9/xinit.c
--- xinit-1.0.9/xinit.c.client-session 2008-05-21 14:09:16.000000000 -0400
+++ xinit-1.0.9/xinit.c 2008-08-25 09:57:56.000000000 -0400
@@ -727,11 +727,21 @@ startClient(char *client[])
{
2008-08-25 13:58:56 +00:00
setWindowPath();
if ((clientpid = vfork()) == 0) {
+ int fd;
if (setuid(getuid()) == -1) {
Error("cannot change uid: %s\n", strerror(errno));
_exit(ERR_EXIT);
}
2007-09-24 18:10:45 +00:00
- 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