mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
p910nd: Run as non-root by default
We add the necessary Makefile, hotplug, config, and init bits
so that p910nd daemon runs as user:group p910nd:lp by default.
This eliminates an unnecessary root daemon.
The hotplug script sets the permissions of the USB lp
device(s) to read-write owner and group and no access to
anyone else, and sets owner root, group lp.
This is allows sufficient privileges to p910nd
to do it's job.
(cherry-pick 932c76fa74)
Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
This commit is contained in:
@@ -28,7 +28,7 @@ start_service() {
|
||||
|
||||
|
||||
start_p910nd() {
|
||||
local section="$1"
|
||||
local section="$1" runas_root
|
||||
config_get_bool "enabled" "$section" "enabled" '1'
|
||||
if [ "$enabled" -gt 0 ]; then
|
||||
args="-d "
|
||||
@@ -42,6 +42,9 @@ start_p910nd() {
|
||||
procd_set_param command /usr/sbin/p910nd $args
|
||||
procd_set_param respawn
|
||||
|
||||
config_get_bool runas_root "$section" runas_root 0
|
||||
[ "$runas_root" -ne 1 ] && procd_set_param user p910nd
|
||||
|
||||
config_get_bool "mdns" "$section" "mdns" '0'
|
||||
config_get mdns_note "$section" mdns_note
|
||||
config_get mdns_ty "$section" mdns_ty
|
||||
|
||||
Reference in New Issue
Block a user