summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Bcfg2/Server')
-rw-r--r--src/lib/Bcfg2/Server/BuiltinCore.py4
-rw-r--r--src/lib/Bcfg2/Server/CherryPyCore.py4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Server/BuiltinCore.py b/src/lib/Bcfg2/Server/BuiltinCore.py
index 61edd9cf7..b62312828 100644
--- a/src/lib/Bcfg2/Server/BuiltinCore.py
+++ b/src/lib/Bcfg2/Server/BuiltinCore.py
@@ -30,7 +30,9 @@ class Core(BaseCore):
BaseCore.__init__(self, setup)
self.server = None
self.context = \
- daemon.DaemonContext(pidfile=PidFile(self.setup['daemon']))
+ daemon.DaemonContext(uid=self.setup['daemon_uid'],
+ gid=self.setup['daemon_gid'],
+ pidfile=PidFile(self.setup['daemon']))
def _dispatch(self, method, args, dispatch_dict):
"""Custom XML-RPC dispatcher for components.
diff --git a/src/lib/Bcfg2/Server/CherryPyCore.py b/src/lib/Bcfg2/Server/CherryPyCore.py
index a840d5ae9..79e939344 100644
--- a/src/lib/Bcfg2/Server/CherryPyCore.py
+++ b/src/lib/Bcfg2/Server/CherryPyCore.py
@@ -7,7 +7,7 @@ from Bcfg2.Server.Core import BaseCore
import cherrypy
from cherrypy.lib import xmlrpcutil
from cherrypy._cptools import ErrorTool
-from cherrypy.process.plugins import Daemonizer, PIDFile
+from cherrypy.process.plugins import Daemonizer, DropPrivileges, PIDFile
def on_error(*args, **kwargs): # pylint: disable=W0613
@@ -90,6 +90,8 @@ class Core(BaseCore):
return cherrypy.serving.response.body
def _daemonize(self):
+ DropPrivileges(cherrypy.engine, uid=self.setup['daemon_uid'],
+ gid=self.setup['daemon_gid']).subscribe()
Daemonizer(cherrypy.engine).subscribe()
PIDFile(cherrypy.engine, self.setup['daemon']).subscribe()