mirror of
https://github.com/openwrt/packages.git
synced 2025-12-21 19:14:30 +04:00
dnsdist: add config options for --uid and --gid
These options allow running dnsdist as a non-root user. Signed-off-by: Sebastian Hamann <code@ares-macrotechnology.com>
This commit is contained in:
committed by
Rosen Penev
parent
fdf3d2e7c1
commit
5aae31b5e4
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=dnsdist
|
PKG_NAME:=dnsdist
|
||||||
PKG_VERSION:=1.9.5
|
PKG_VERSION:=1.9.5
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||||
PKG_SOURCE_URL:=https://downloads.powerdns.com/releases/
|
PKG_SOURCE_URL:=https://downloads.powerdns.com/releases/
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
config 'dnsdist' 'general'
|
config 'dnsdist' 'general'
|
||||||
option enabled '0'
|
option enabled '0'
|
||||||
|
option user 'root'
|
||||||
|
option group 'root'
|
||||||
|
|||||||
@@ -7,13 +7,19 @@ start_service() {
|
|||||||
config_load dnsdist
|
config_load dnsdist
|
||||||
local cfg=general
|
local cfg=general
|
||||||
local enabled
|
local enabled
|
||||||
|
local user
|
||||||
|
local group
|
||||||
|
|
||||||
config_get_bool enabled "$cfg" 'enabled' 1
|
config_get_bool enabled "$cfg" 'enabled' 1
|
||||||
|
config_get user "$cfg" user root
|
||||||
|
config_get group "$cfg" group root
|
||||||
|
|
||||||
[ $enabled -gt 0 ] || return 1
|
[ $enabled -gt 0 ] || return 1
|
||||||
|
|
||||||
procd_open_instance
|
procd_open_instance
|
||||||
procd_set_param command dnsdist --supervised -C /etc/dnsdist.conf
|
procd_set_param command dnsdist --supervised -C /etc/dnsdist.conf
|
||||||
|
[ "$user" != root ] && procd_append_param command -u "$user"
|
||||||
|
[ "$group" != root ] && procd_append_param command -g "$group"
|
||||||
procd_set_param file /etc/dnsdist.conf
|
procd_set_param file /etc/dnsdist.conf
|
||||||
procd_set_param respawn
|
procd_set_param respawn
|
||||||
procd_close_instance
|
procd_close_instance
|
||||||
|
|||||||
Reference in New Issue
Block a user