Fix edge cases when specifying the user to run as.
* check the username fits the format expected by adduser; * don't allow root; * if the user exists, don't try to create it; usually, this is harmless, but it fails if the user exists with a UID outside the normal range for system users. Fixes #24.
This commit is contained in:
parent
f391bf4b22
commit
ab8c4db85b
5 changed files with 34 additions and 6 deletions
5
debian/dump1090-mutability.postinst
vendored
5
debian/dump1090-mutability.postinst
vendored
|
@ -97,7 +97,10 @@ case "$1" in
|
|||
db_get $NAME/auto-start
|
||||
if [ "$RET" = "true" ]; then
|
||||
db_get $NAME/run-as-user
|
||||
adduser --system --home /usr/share/$NAME --no-create-home --quiet "$RET"
|
||||
if ! getent passwd "$RET" >/dev/null
|
||||
then
|
||||
adduser --system --home /usr/share/$NAME --no-create-home --quiet "$RET"
|
||||
fi
|
||||
fi
|
||||
|
||||
# -10 changed the lighttpd config file, but didn't arrange to restart it.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue