summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog2
-rw-r--r--utils/start-stop-daemon.c7
2 files changed, 7 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog
index 1c255036a..1d7ef446f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -53,6 +53,8 @@ dpkg (1.17.14) UNRELEASED; urgency=low
affects error messages from partial or broken .deb packages for example.
Regression introduced in dpkg 1.17.10. Closes: #759498
* Remove lpia architecture support.
+ * Improvements and portability fixes to start-stop-daemon:
+ - Abort if the system or compatibility setsid() fails.
[ Raphaƫl Hertzog ]
* Explain better in deb-triggers(5) why interest/activate-noawait should be
diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c
index 93850e308..d3c5d826d 100644
--- a/utils/start-stop-daemon.c
+++ b/utils/start-stop-daemon.c
@@ -352,7 +352,9 @@ detach_controlling_tty(void)
static pid_t
setsid(void)
{
- setpgid(0, 0);
+ if (setpgid(0, 0) < 0)
+ return -1:
+
detach_controlling_tty();
return 0;
@@ -374,7 +376,8 @@ daemonize(void)
_exit(0);
/* Create a new session. */
- setsid();
+ if (setsid() < 0)
+ fatal("cannot set session ID");
pid = fork();
if (pid < 0)