projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7b8c70e
)
nspawn: check return of setsid()
author
Lennart Poettering
<lennart@poettering.net>
Wed, 16 Sep 2020 20:11:48 +0000
(22:11 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Thu, 17 Sep 2020 14:38:58 +0000
(16:38 +0200)
Let's verify that everything works the way we expect it to work, hence
check setsid() return code.
src/nspawn/nspawn-stub-pid1.c
patch
|
blob
|
history
diff --git
a/src/nspawn/nspawn-stub-pid1.c
b/src/nspawn/nspawn-stub-pid1.c
index d86dd23185ddf4e8e5988c1379e6858d1fbe7fd0..f785a3b2483f5821ba7a94789fac4bf46419b030 100644
(file)
--- a/
src/nspawn/nspawn-stub-pid1.c
+++ b/
src/nspawn/nspawn-stub-pid1.c
@@
-66,7
+66,10
@@
int stub_pid1(sd_id128_t uuid) {
if (pid == 0) {
/* Return in the child */
assert_se(sigprocmask(SIG_SETMASK, &oldmask, NULL) >= 0);
- setsid();
+
+ if (setsid() < 0)
+ return log_error_errno(errno, "Failed to become session leader in payload process: %m");
+
return 0;
}