From a1427b1a31736f70ff06195ed5f3b106027851ae Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Mon, 12 Feb 2018 15:12:01 -0800 Subject: [PATCH] Set the HOME variable to a directory the uid can access libgit2 will look for $HOME/.gitconfig after dropping root privileges so this needs to be accessible to the user. --- src/sbin/lorax-composer | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sbin/lorax-composer b/src/sbin/lorax-composer index fd6f8b83..87119f3c 100755 --- a/src/sbin/lorax-composer +++ b/src/sbin/lorax-composer @@ -215,6 +215,8 @@ if __name__ == '__main__': os.setgid(gid) os.setuid(uid) log.debug("user is now %s:%s", os.getresuid(), os.getresgid()) + # Switch to a home directory we can access (libgit2 uses this to look for .gitconfig) + os.environ["HOME"] = server.config["COMPOSER_CFG"].get("composer", "lib_dir") # Make sure yumbase directories are created make_yum_dirs(server.config["COMPOSER_CFG"])