meson: make nologin path build time configurable

Some distros install nologin as /usr/sbin/nologin, others as
/sbin/nologin.
Since we can't really on merged-usr everywhere (where the path wouldn't
matter), make the path build time configurable via -Dnologin-path=.

Closes #13028
This commit is contained in:
Michael Biebl
2019-07-18 12:46:35 +02:00
parent ea582a0f1b
commit 6db904625d
22 changed files with 61 additions and 52 deletions
+2 -2
View File
@@ -148,7 +148,7 @@ static int synthesize_user_creds(
*home = FLAGS_SET(flags, USER_CREDS_CLEAN) ? NULL : "/";
if (shell)
*shell = FLAGS_SET(flags, USER_CREDS_CLEAN) ? NULL : "/sbin/nologin";
*shell = FLAGS_SET(flags, USER_CREDS_CLEAN) ? NULL : NOLOGIN;
return 0;
}
@@ -538,7 +538,7 @@ int get_shell(char **_s) {
}
if (synthesize_nobody() &&
u == UID_NOBODY) {
s = strdup("/sbin/nologin");
s = strdup(NOLOGIN);
if (!s)
return -ENOMEM;