summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/httpd/proc.c6
-rw-r--r--usr.sbin/relayd/proc.c6
-rw-r--r--usr.sbin/switchd/proc.c6
-rw-r--r--usr.sbin/vmd/proc.c6
4 files changed, 20 insertions, 4 deletions
diff --git a/usr.sbin/httpd/proc.c b/usr.sbin/httpd/proc.c
index d7f1e015095..ff3f443df87 100644
--- a/usr.sbin/httpd/proc.c
+++ b/usr.sbin/httpd/proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.c,v 1.28 2016/10/05 16:58:19 reyk Exp $ */
+/* $OpenBSD: proc.c,v 1.29 2016/10/05 17:09:59 reyk Exp $ */
/*
* Copyright (c) 2010 - 2016 Reyk Floeter <reyk@openbsd.org>
@@ -130,6 +130,10 @@ proc_exec(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc,
fatal("%s: fork", __func__);
break;
case 0:
+ /* First create a new session */
+ if (setsid() == -1)
+ fatal("setsid");
+
/* Prepare parent socket. */
dup2(fd, PROC_PARENT_SOCK_FILENO);
diff --git a/usr.sbin/relayd/proc.c b/usr.sbin/relayd/proc.c
index 6c5a764126c..78a602f12b2 100644
--- a/usr.sbin/relayd/proc.c
+++ b/usr.sbin/relayd/proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.c,v 1.34 2016/10/05 16:58:19 reyk Exp $ */
+/* $OpenBSD: proc.c,v 1.35 2016/10/05 17:09:59 reyk Exp $ */
/*
* Copyright (c) 2010 - 2016 Reyk Floeter <reyk@openbsd.org>
@@ -130,6 +130,10 @@ proc_exec(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc,
fatal("%s: fork", __func__);
break;
case 0:
+ /* First create a new session */
+ if (setsid() == -1)
+ fatal("setsid");
+
/* Prepare parent socket. */
dup2(fd, PROC_PARENT_SOCK_FILENO);
diff --git a/usr.sbin/switchd/proc.c b/usr.sbin/switchd/proc.c
index c5a786ac48f..839e4696760 100644
--- a/usr.sbin/switchd/proc.c
+++ b/usr.sbin/switchd/proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.c,v 1.5 2016/10/05 16:58:19 reyk Exp $ */
+/* $OpenBSD: proc.c,v 1.6 2016/10/05 17:09:59 reyk Exp $ */
/*
* Copyright (c) 2010 - 2016 Reyk Floeter <reyk@openbsd.org>
@@ -130,6 +130,10 @@ proc_exec(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc,
fatal("%s: fork", __func__);
break;
case 0:
+ /* First create a new session */
+ if (setsid() == -1)
+ fatal("setsid");
+
/* Prepare parent socket. */
dup2(fd, PROC_PARENT_SOCK_FILENO);
diff --git a/usr.sbin/vmd/proc.c b/usr.sbin/vmd/proc.c
index 52ab19c2ef8..cbc014d7fbf 100644
--- a/usr.sbin/vmd/proc.c
+++ b/usr.sbin/vmd/proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.c,v 1.7 2016/10/04 17:17:30 reyk Exp $ */
+/* $OpenBSD: proc.c,v 1.8 2016/10/05 17:10:00 reyk Exp $ */
/*
* Copyright (c) 2010 - 2016 Reyk Floeter <reyk@openbsd.org>
@@ -130,6 +130,10 @@ proc_exec(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc,
fatal("%s: fork", __func__);
break;
case 0:
+ /* First create a new session */
+ if (setsid() == -1)
+ fatal("setsid");
+
/* Prepare parent socket. */
dup2(fd, PROC_PARENT_SOCK_FILENO);