Преглед изворни кода

celery.platforms: Do actually set effective uid/gid

Ask Solem пре 14 година
родитељ
комит
a2809e865a
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      celery/platforms.py

+ 4 - 1
celery/platforms.py

@@ -167,7 +167,8 @@ class DaemonContext(object):
             self._is_open = False
 
 
-def create_daemon_context(logfile=None, pidfile=None, **options):
+def create_daemon_context(logfile=None, pidfile=None, uid=None, gid=None,
+        **options):
     if not CAN_DETACH:
         raise RuntimeError(
                 "This platform does not support detach.")
@@ -175,6 +176,8 @@ def create_daemon_context(logfile=None, pidfile=None, **options):
     # Make sure SIGCLD is using the default handler.
     reset_signal("SIGCLD")
 
+    set_effective_user(uid=uid, gid=gid)
+
     # Since without stderr any errors will be silently suppressed,
     # we need to know that we have access to the logfile.
     if logfile: