mirror of
https://github.com/rd235/cado
synced 2025-02-18 04:10:46 +01:00
[CMake] nologin no longer tied to /sbin
It seems that the distributions places nologin in different places (e.g. deb based distribution in /usr/sbin, rpm based and gentoo in /sbin). This patch fixes this behaviour searching for nologin in the PATH environment variable.
This commit is contained in:
parent
f2cc3c9724
commit
333a4c2c63
@ -1,17 +1,20 @@
|
||||
execute_process(COMMAND bash -c "\
|
||||
execute_process(COMMAND bash -euc "\
|
||||
if ! getent group _cado >/dev/null 2>&1; then
|
||||
groupadd \
|
||||
--system \
|
||||
_cado;
|
||||
fi"
|
||||
ERROR_QUIET OUTPUT_QUIET)
|
||||
execute_process(COMMAND bash -c "\
|
||||
execute_process(COMMAND bash -euc "\
|
||||
# get nologin path
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
NOLOGIN=\"\$(which nologin)\"
|
||||
if ! getent passwd _cado >/dev/null 2>&1; then
|
||||
useradd \
|
||||
--no-create-home \
|
||||
--home-dir /nonexistent \
|
||||
--system \
|
||||
--shell /sbin/nologin \
|
||||
--shell \"\$NOLOGIN\" \
|
||||
-g _cado \
|
||||
_cado;
|
||||
fi"
|
||||
|
Loading…
x
Reference in New Issue
Block a user