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.
This commit is contained in:
Lennart Poettering
2016-07-22 15:53:45 +02:00
parent 6f3e79859d
commit 409093fe10
11 changed files with 515 additions and 14 deletions
+6
View File
@@ -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;