aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Benedikt Morbach <moben@exherbo.org> 2018-04-09 17:32:30 +0200
committerAvatar Benedikt Morbach <moben@exherbo.org> 2018-04-09 20:49:00 +0200
commit3169132a3231fbbfa0bc118eb8ab315baebc41f3 (patch)
tree1de12feefb00f7c166147b4edf804b365f0491f8
parent917cc160a14ee45801ff227f5678854dc4c0c06e (diff)
downloadpaludis-3169132a3231fbbfa0bc118eb8ab315baebc41f3.tar.gz
paludis-3169132a3231fbbfa0bc118eb8ab315baebc41f3.tar.xz
set USER and LOGNAME when running with userpriv
some builds/tests get confused when running as paludisbuild with USER=root.
-rw-r--r--paludis/repositories/e/ebuild.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 421e277..f44ccc1 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -141,7 +141,10 @@ EbuildCommand::operator() ()
throw ActionFailedError("Need to be able to use non-0 user and group for userpriv for '" +
stringify(*package_id) + "'");
}
- process.setuid_setgid(params.environment()->reduced_uid(), params.environment()->reduced_gid());
+ process
+ .setuid_setgid(params.environment()->reduced_uid(), params.environment()->reduced_gid())
+ .setenv("USER", params.environment()->reduced_username())
+ .setenv("LOGNAME", params.environment()->reduced_username());
}
using namespace std::placeholders;