Skip to content

Commit

Permalink
Rebase secure onto master
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathnerd314 committed Jul 26, 2014
1 parent 71a20d4 commit db2dfde
Show file tree
Hide file tree
Showing 23 changed files with 923 additions and 102 deletions.
4 changes: 4 additions & 0 deletions src/libexpr/primops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,10 @@ static void prim_derivationStrict(EvalState & state, const Pos & pos, Value * *
foreach (DerivationOutputs::iterator, i, drv.outputs)
if (i->second.path == "") {
Path outPath = makeOutputPath(i->first, h, drvName);
/* XXX */
Path outPath;
PathHash outPathHash;
makeOutputPath(h, drvName, outPath, outPathHash);
drv.env[i->first] = outPath;
i->second.path = outPath;
}
Expand Down
11 changes: 11 additions & 0 deletions src/libmain/shared.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,17 @@ static void initAndRun(int argc, char * * argv)
gettimeofday(&tv, 0);
srandom(tv.tv_usec);

/* Set the trust ID to the value of the NIX_USER_ID environment variable, or use the current user name. */
currentTrustId = getEnv("NIX_USER_ID"); /* !!! dangerous? */
if (currentTrustId == "") {
SwitchToOriginalUser sw;
uid_t uid = geteuid();
struct passwd * pw = getpwuid(uid);
if (!pw) throw Error(format("unknown user ID %1%, go away") % uid);
currentTrustId = pw->pw_name;
}
printMsg(lvlError, format("trust ID is `%1%'") % currentTrustId);

/* Process the NIX_LOG_TYPE environment variable. */
string lt = getEnv("NIX_LOG_TYPE");
if (lt != "") setLogType(lt);
Expand Down
Loading

0 comments on commit db2dfde

Please sign in to comment.