summaryrefslogtreecommitdiff
path: root/src/core/execute.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-07-14 19:19:49 +0200
committerLennart Poettering <lennart@poettering.net>2016-07-22 15:53:45 +0200
commit409093fe10685ed55915ef256f09cdf144b6528b (patch)
treea1cf99e3f7bece318f7c12e53c2703938d8a8178 /src/core/execute.c
parent6f3e79859d91aecb3a75097b69fb9cba086b2cb1 (diff)
nss: add new "nss-systemd" NSS module for mapping dynamic users
With this NSS module all dynamic service users will be resolvable via NSS like any real user.
Diffstat (limited to 'src/core/execute.c')
-rw-r--r--src/core/execute.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/execute.c b/src/core/execute.c
index c186f2a705..26e9cd5339 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -1670,6 +1670,12 @@ static int exec_child(
if (context->dynamic_user && dcreds) {
+ /* Make sure we bypass our own NSS module for any NSS checks */
+ if (putenv((char*) "SYSTEMD_NSS_DYNAMIC_BYPASS=1") != 0) {
+ *exit_status = EXIT_USER;
+ return -errno;
+ }
+
r = dynamic_creds_realize(dcreds, &uid, &gid);
if (r < 0) {
*exit_status = EXIT_USER;