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
This commit is contained in:
Benoit Chesneau 2015-10-31 09:17:43 +01:00
parent 821123d48f
commit d922df3902

View File

@ -336,6 +336,8 @@ class Logger(object):
else: else:
util.check_is_writeable(output) util.check_is_writeable(output)
h = logging.FileHandler(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.setFormatter(fmt)
h._gunicorn = True h._gunicorn = True