summaryrefslogtreecommitdiffstats
path: root/src/test/test-capability.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-11-02 11:04:36 +0100
committerLennart Poettering <lennart@poettering.net>2023-11-02 14:09:23 +0100
commite9ccae31355b8d4fd7496b0548470c8c977897d8 (patch)
tree13c5f4246df81fa08c396303b14acf15ccdcc2a5 /src/test/test-capability.c
parentfd-util: add new FORMAT_PROC_PID_FD_PATH() helper (diff)
downloadsystemd-e9ccae31355b8d4fd7496b0548470c8c977897d8.tar.xz
systemd-e9ccae31355b8d4fd7496b0548470c8c977897d8.zip
process-util: add new FORK_DEATHSIG_SIGKILL flag, rename FORK_DEATHSIG → FORK_DEATHSIG_SIGTERM
Sometimes it makes sense to hard kill a client if we die. Let's hence add a third FORK_DEATHSIG flag for this purpose: FORK_DEATHSIG_SIGKILL. To make things less confusing this also renames FORK_DEATHSIG to FORK_DEATHSIG_SIGTERM to make clear it sends SIGTERM. We already had FORK_DEATHSIG_SIGINT, hence this makes things nicely symmetric. A bunch of users are switched over for FORK_DEATHSIG_SIGKILL where we know it's safe to abort things abruptly. This should make some kernel cases more robust, since we cannot get confused by signal masks or such. While we are at it, also fix a bunch of bugs where we didn't take FORK_DEATHSIG_SIGINT into account in safe_fork()
Diffstat (limited to 'src/test/test-capability.c')
-rw-r--r--src/test/test-capability.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/test-capability.c b/src/test/test-capability.c
index 2f93fbeede..e8a0569737 100644
--- a/src/test/test-capability.c
+++ b/src/test/test-capability.c
@@ -254,7 +254,7 @@ static void test_capability_get_ambient(void) {
assert_se(capability_get_ambient(&c) >= 0);
- r = safe_fork("(getambient)", FORK_RESET_SIGNALS|FORK_DEATHSIG|FORK_WAIT|FORK_LOG, NULL);
+ r = safe_fork("(getambient)", FORK_RESET_SIGNALS|FORK_DEATHSIG_SIGTERM|FORK_WAIT|FORK_LOG, NULL);
assert_se(r >= 0);
if (r == 0) {