mirror of
https://github.com/bol-van/zapret.git
synced 2024-11-29 21:40:52 +03:00
sysv init: make compatible with absent nogroup
This commit is contained in:
parent
aa6cbfe03c
commit
de7a2f9be9
@ -19,12 +19,14 @@ user_exists()
|
||||
useradd_compat()
|
||||
{
|
||||
# $1 - username
|
||||
|
||||
# skip for readonly systems
|
||||
[ -w "/etc" ] && {
|
||||
if exists useradd ; then
|
||||
useradd --no-create-home --system --shell /bin/false $1
|
||||
elif is_linked_to_busybox adduser ; then
|
||||
# some systems may miss nogroup group in /etc/group
|
||||
# adduser fails if it's absent and no group is specified
|
||||
addgroup nogroup 2>/dev/null
|
||||
# busybox has special adduser syntax
|
||||
adduser -S -H -D $1
|
||||
elif exists adduser; then
|
||||
|
Loading…
Reference in New Issue
Block a user