mirror of
https://github.com/bol-van/zapret.git
synced 2024-11-14 18:48:33 +05:00
init.d: sysv adduser_compat check readonly /etc
This commit is contained in:
parent
0970254a86
commit
9df16b8578
@ -31,14 +31,18 @@ user_exists()
|
|||||||
useradd_compat()
|
useradd_compat()
|
||||||
{
|
{
|
||||||
# $1 - username
|
# $1 - username
|
||||||
if exists useradd ; then
|
|
||||||
useradd --no-create-home --system --shell /bin/false $1
|
# skip for readonly systems
|
||||||
elif is_linked_to_busybox adduser ; then
|
[ -w "/etc" ] && {
|
||||||
# busybox has special adduser syntax
|
if exists useradd ; then
|
||||||
adduser -S -H -D $1
|
useradd --no-create-home --system --shell /bin/false $1
|
||||||
elif exists adduser; then
|
elif is_linked_to_busybox adduser ; then
|
||||||
adduser --no-create-home --system --disabled-login $1
|
# busybox has special adduser syntax
|
||||||
fi
|
adduser -S -H -D $1
|
||||||
|
elif exists adduser; then
|
||||||
|
adduser --no-create-home --system --disabled-login $1
|
||||||
|
fi
|
||||||
|
}
|
||||||
user_exists $1
|
user_exists $1
|
||||||
}
|
}
|
||||||
prepare_user()
|
prepare_user()
|
||||||
|
Loading…
Reference in New Issue
Block a user