mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-30 01:26:15 +02:00
* Switch to the calling user context for some more operations in a
setuid installation.
This commit is contained in:
parent
88273f9574
commit
8a3a96dd5b
2 changed files with 6 additions and 2 deletions
|
@ -88,7 +88,10 @@ 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(realRoot, gcRoot, false);
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ static bool indirectRoot = false;
|
|||
|
||||
static Path fixPath(Path path)
|
||||
{
|
||||
SwitchToOriginalUser sw;
|
||||
path = absPath(path);
|
||||
while (!isInStore(path)) {
|
||||
if (!isLink(path)) break;
|
||||
|
|
Loading…
Reference in a new issue