2015-01-21 10:42:12 +01:00
|
|
|
Index: xinit-1.3.4/xinit.c
|
|
|
|
===================================================================
|
|
|
|
--- xinit-1.3.4.orig/xinit.c
|
|
|
|
+++ xinit-1.3.4/xinit.c
|
|
|
|
@@ -89,6 +89,7 @@ char xserverrcbuf[256];
|
2012-04-14 11:34:16 +02:00
|
|
|
|
|
|
|
#define TRUE 1
|
|
|
|
#define FALSE 0
|
|
|
|
+#define ERR_EXIT 1
|
|
|
|
|
|
|
|
static char *default_server = "X";
|
|
|
|
static char *default_display = ":0"; /* choose most efficient */
|
2015-01-21 10:42:12 +01:00
|
|
|
@@ -560,6 +561,8 @@ startClient(char *client_argv[])
|
2012-04-14 11:34:16 +02:00
|
|
|
{
|
|
|
|
clientpid = fork();
|
|
|
|
if (clientpid == 0) {
|
|
|
|
+ int fd;
|
|
|
|
+
|
|
|
|
set_environment();
|
|
|
|
setWindowPath();
|
|
|
|
|
2015-01-21 10:42:12 +01:00
|
|
|
@@ -567,7 +570,17 @@ startClient(char *client_argv[])
|
2012-04-14 11:34:16 +02:00
|
|
|
Error("cannot change uid");
|
|
|
|
_exit(EXIT_FAILURE);
|
|
|
|
}
|
|
|
|
- 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();
|
|
|
|
+
|
2015-01-21 10:42:12 +01:00
|
|
|
Execute(client_argv);
|
|
|
|
Error("Unable to run program \"%s\"", client_argv[0]);
|
2012-04-14 11:34:16 +02:00
|
|
|
|