mirror of
https://github.com/NixOS/nix.git
synced 2025-11-26 20:20:58 +01:00
This commit is contained in:
parent
ec7b0afb08
commit
094c69ad19
9 changed files with 41 additions and 25 deletions
|
|
@ -1829,7 +1829,9 @@ void DerivationGoal::computeClosure()
|
|||
}
|
||||
//If not shared: create the dir and set the rights
|
||||
else{
|
||||
setStatePathRights(statePath, queryCallingUsername(), "nixbld", "700");
|
||||
ensureDirExists(statePath);
|
||||
setChown(statePath, queryCallingUsername(), "nixbld");
|
||||
setChmod(statePath, "700");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -527,6 +527,7 @@ void RemoteStore::revertToRevision(const Path & componentPath, const Path & deri
|
|||
|
||||
void RemoteStore::setSharedState(const Path & fromExisting, const Path & toNew)
|
||||
{
|
||||
writeInt(wopSetSharedState, to);
|
||||
writeString(fromExisting, to);
|
||||
writeString(toNew, to);
|
||||
processStderr();
|
||||
|
|
|
|||
|
|
@ -143,9 +143,11 @@ void checkStatePath(const Derivation & drv)
|
|||
string componentHash = drv.stateOutputs.find("state")->second.componentHash;
|
||||
string suffix = drv.env.find("name")->second;
|
||||
string stateIdentifier = drv.stateOutputs.find("state")->second.stateIdentifier;
|
||||
Path calculatedPath = makeStatePath(componentHash, suffix, stateIdentifier);
|
||||
Path calculatedPath = makeStatePath(componentHash, suffix, stateIdentifier); //TODO INCLUDE USER !!!!!!!!!!!!
|
||||
|
||||
printMsg(lvlError, format("Checking statePath validity: %1% %2%") % drvPath % calculatedPath);
|
||||
//TODO !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! calculatedPath IS NOT CORRECT ANYMORE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
printMsg(lvlError, format("Checking statePath validity: %1% %2%") % drvPath % calculatedPath);
|
||||
|
||||
if(drvPath != calculatedPath)
|
||||
Error(format("The statepath from the Derivation does not match the recalculated statepath, are u trying to spoof the statepath?"));
|
||||
|
|
|
|||
|
|
@ -50,20 +50,23 @@ void createSubStateDirsTxn(const Transaction & txn, const DerivationStateOutputD
|
|||
DerivationStateOutputDir d = i->second;
|
||||
|
||||
string thisdir = d.path;
|
||||
|
||||
//If it is a file: continue
|
||||
if(thisdir.substr(thisdir.length() -1 , thisdir.length()) != "/")
|
||||
continue;
|
||||
|
||||
Path fullstatedir = stateDir + "/" + thisdir;
|
||||
|
||||
setStatePathRights(fullstatedir, queryCallingUsername(), "nixbld");
|
||||
//If it is a file: continue
|
||||
if(thisdir.substr(thisdir.length() -1 , thisdir.length()) != "/"){
|
||||
continue;
|
||||
}
|
||||
|
||||
ensureDirExists(fullstatedir);
|
||||
|
||||
if(d.type == "interval"){
|
||||
intervalPaths.insert(fullstatedir);
|
||||
}
|
||||
}
|
||||
|
||||
setChown(statePath, queryCallingUsername(), "nixbld", true); //Set all dirs in the statePath recursively to their owners
|
||||
printMsg(lvlTalkative, format("Set CHOWN '%1%'") % (statePath + "-" + queryCallingUsername()));
|
||||
|
||||
//Initialize the counters for the statePaths that have an interval to 0
|
||||
IntVector empty;
|
||||
setStatePathsIntervalTxn(txn, intervalPaths, empty, true);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ typedef enum {
|
|||
wopQueryStateReferrers,
|
||||
wopAddToStore,
|
||||
wopAddTextToStore,
|
||||
wopBuildDerivations, //TODO HANGS SOMETIMES !!!!!
|
||||
wopBuildDerivations, //TODO !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! HANGS SOMETIMES !!!!!
|
||||
wopEnsurePath,
|
||||
wopAddTempRoot,
|
||||
wopAddIndirectRoot,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue