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[])
|
2006-11-10 15:31:06 +00:00
|
|
|
{
|
2008-08-25 13:58:56 +00:00
|
|
|
setWindowPath();
|
2006-11-10 15:31:06 +00:00
|
|
|
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());
|
2006-11-10 15:31:06 +00:00
|
|
|
+ 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
|