summaryrefslogtreecommitdiff
path: root/src/daemon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon.cpp')
-rw-r--r--src/daemon.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/daemon.cpp b/src/daemon.cpp
index fbd03d8..f91cd66 100644
--- a/src/daemon.cpp
+++ b/src/daemon.cpp
@@ -27,6 +27,7 @@
#include <sys/un.h>
#include <sys/stat.h>
#include <sys/wait.h>
+#include <sys/prctl.h>
#include <fcntl.h>
#include <pwd.h>
#include <grp.h>
@@ -562,6 +563,9 @@ bool Daemon::check_agent(int &streamfd)
// we are the child here, we return to do the stream work
+ // we don't want to outlive the daemon process
+ prctl(PR_SET_PDEATHSIG, SIGKILL);
+
// TODO handle cases where the child die launching it again
uid_t uid = terminal_info[current_tty].uid;
syslog(LOG_DEBUG, "trace %d uid %d", __LINE__, (int) uid);