From d922df3902c43fc1d761e0e282fbec9b702b273e Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Sat, 31 Oct 2015 09:17:43 +0100 Subject: [PATCH] make sure the users can access to the logs make sure that a user is able to access to the logs after dropping a privilege. fix #1116 --- gunicorn/glogging.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gunicorn/glogging.py b/gunicorn/glogging.py index 225b8863..3a4ba686 100644 --- a/gunicorn/glogging.py +++ b/gunicorn/glogging.py @@ -336,6 +336,8 @@ class Logger(object): else: util.check_is_writeable(output) h = logging.FileHandler(output) + # make sure the user can reopen the file + os.chown(h.baseFilename, self.cfg.user, self.cfg.group) h.setFormatter(fmt) h._gunicorn = True