summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-09-08 16:16:29 +0200
committerEvgeny Vereshchagin <evvers@ya.ru>2017-09-08 16:16:29 +0200
commit21022b9dded0baa21f7715625fbc24db9aebebde (patch)
tree5bd9d7f09dba1cbf13e8b67b6ec6ee3541d8e9b3 /src/core
parentmanager: when reexecuting try to connect to bus only when dbus.service is aro... (diff)
downloadsystemd-21022b9dded0baa21f7715625fbc24db9aebebde.tar.xz
systemd-21022b9dded0baa21f7715625fbc24db9aebebde.zip
util-lib: wrap personality() to fix up broken glibc error handling (#6766)
glibc appears to propagate different errors in different ways, let's fix this up, so that our own code doesn't get confused by this. See #6752 + #6737 for details. Fixes: #6755
Diffstat (limited to 'src/core')
-rw-r--r--src/core/execute.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/execute.c b/src/core/execute.c
index e4bf237f1e..21c0149e22 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -2614,11 +2614,13 @@ static int exec_child(
return -errno;
}
- if (context->personality != PERSONALITY_INVALID)
- if (personality(context->personality) < 0) {
+ if (context->personality != PERSONALITY_INVALID) {
+ r = safe_personality(context->personality);
+ if (r < 0) {
*exit_status = EXIT_PERSONALITY;
- return -errno;
+ return r;
}
+ }
if (context->utmp_id)
utmp_put_init_process(context->utmp_id, getpid_cached(), getsid(0),