* Remove SwitchToOriginalUser, we're not going to need it anymore.
This commit is contained in:
parent
626f8ee42f
commit
9c9cdb06d0
8 changed files with 4 additions and 63 deletions
|
@ -92,10 +92,7 @@ Path addPermRoot(const Path & _storePath, const Path & _gcRoot,
|
|||
Path realRoot = canonPath((format("%1%/%2%/auto/%3%")
|
||||
% nixStateDir % gcRootsDir % hash).str());
|
||||
|
||||
{
|
||||
SwitchToOriginalUser sw;
|
||||
createSymlink(gcRoot, storePath, true);
|
||||
}
|
||||
createSymlink(gcRoot, storePath, true);
|
||||
createSymlink(realRoot, gcRoot, false);
|
||||
}
|
||||
|
||||
|
|
|
@ -207,10 +207,7 @@ void copyPath(const Path & src, const Path & dst)
|
|||
files. */
|
||||
|
||||
CopySink sink;
|
||||
{
|
||||
SwitchToOriginalUser sw;
|
||||
dumpPath(src, sink);
|
||||
}
|
||||
dumpPath(src, sink);
|
||||
|
||||
CopySource source(sink.s);
|
||||
restorePath(dst, source);
|
||||
|
|
|
@ -96,25 +96,15 @@ Path makeFixedOutputPath(bool recursive,
|
|||
std::pair<Path, Hash> computeStorePathForPath(const Path & srcPath,
|
||||
bool fixed, bool recursive, string hashAlgo)
|
||||
{
|
||||
Hash h(htSHA256);
|
||||
{
|
||||
SwitchToOriginalUser sw;
|
||||
h = hashPath(htSHA256, srcPath);
|
||||
}
|
||||
Hash h = hashPath(htSHA256, srcPath);
|
||||
|
||||
string baseName = baseNameOf(srcPath);
|
||||
|
||||
Path dstPath;
|
||||
|
||||
if (fixed) {
|
||||
|
||||
HashType ht(parseHashType(hashAlgo));
|
||||
Hash h2(ht);
|
||||
{
|
||||
SwitchToOriginalUser sw;
|
||||
h2 = recursive ? hashPath(ht, srcPath) : hashFile(ht, srcPath);
|
||||
}
|
||||
|
||||
Hash h2 = recursive ? hashPath(ht, srcPath) : hashFile(ht, srcPath);
|
||||
dstPath = makeFixedOutputPath(recursive, hashAlgo, h2, baseName);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue