summary refs log tree commit diff
path: root/ui.c
diff options
context:
space:
mode:
authorKlemens Nanni2021-06-13 02:28:15 +0000
committerC. McEnroe2021-06-13 16:46:34 -0400
commit9c7ceb23bb9ffaa40af2c7bb50130bb66c607593 (patch)
treec7662e2c0bd05bdbcd79d9f6cd1b02143a008222 /ui.c
parent4c0cdae4e5c4b81ca363c9ee48e423df0850fb29 (diff)
/exec without controlling terminal
Otherwise "/exec sh </dev/tty" takes over and catgirl must effectively
be killed to stop the madness;  with this diff:

	catgirl  input| /exec sh </dev/tty
	catgirl output| /bin/sh: cannot open /dev/tty: Device not configured
	catgirl output| Process exits with status 1

Do the same for `-C/Copy', `-N/notify' and `-O/open' alike.
Diffstat (limited to 'ui.c')
-rw-r--r--ui.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ui.c b/ui.c
index 1b21cc5..8f8de1e 100644
--- a/ui.c
+++ b/ui.c
@@ -567,6 +567,7 @@ static void notify(uint id, const char *str) {
 	if (pid < 0) err(EX_OSERR, "fork");
 	if (pid) return;
 
+	setsid();
 	close(STDIN_FILENO);
 	dup2(utilPipe[1], STDOUT_FILENO);
 	dup2(utilPipe[1], STDERR_FILENO);