Use user home as work directory of executor

When we config non-root user as executor.user in zuul.conf,
we should switch to the user's home directory in order to avoid
"Permission deny" error, sometime we may launch zuul-executor
process in /root directory.

Change-Id: I20ddeace5822fa58235915d4629f3acd40e2a4b0
This commit is contained in:
Rui Chen 2017-10-31 14:53:06 +08:00
parent 060352ccf0
commit ec7849d94f
1 changed files with 1 additions and 0 deletions

View File

@ -108,6 +108,7 @@ class Executor(zuul.cmd.ZuulApp):
os.setgroups(groups)
os.setgid(pw.pw_gid)
os.setuid(pw.pw_uid)
os.chdir(pw.pw_dir)
os.umask(0o022)
def main(self, daemon=True):