From 9c9cdb06d095ea91e10be8dae3a85f06a99c51bf Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 2 Dec 2006 14:34:14 +0000 Subject: * Remove SwitchToOriginalUser, we're not going to need it anymore. --- src/libstore/gc.cc | 5 +---- src/libstore/local-store.cc | 5 +---- src/libstore/store-api.cc | 14 ++------------ 3 files changed, 4 insertions(+), 20 deletions(-) (limited to 'src/libstore') diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index 05966ad4b0..3e4150d898 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -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); } diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 2f2a1b4366..0b8900f250 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -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); diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index a560b3f55b..fb86fc6abb 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -96,25 +96,15 @@ Path makeFixedOutputPath(bool recursive, std::pair 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); } -- cgit 1.4.1