forked from lix-project/lix
* Switch to the calling user context for some more operations in a
setuid installation.
This commit is contained in:
parent
88273f9574
commit
8a3a96dd5b
|
@ -87,8 +87,11 @@ Path addPermRoot(const Path & _storePath, const Path & _gcRoot,
|
||||||
string hash = printHash32(hashString(htSHA1, gcRoot));
|
string hash = printHash32(hashString(htSHA1, gcRoot));
|
||||||
Path realRoot = canonPath((format("%1%/%2%/auto/%3%")
|
Path realRoot = canonPath((format("%1%/%2%/auto/%3%")
|
||||||
% nixStateDir % gcRootsDir % hash).str());
|
% nixStateDir % gcRootsDir % hash).str());
|
||||||
|
|
||||||
createSymlink(gcRoot, storePath, true);
|
{
|
||||||
|
SwitchToOriginalUser sw;
|
||||||
|
createSymlink(gcRoot, storePath, true);
|
||||||
|
}
|
||||||
createSymlink(realRoot, gcRoot, false);
|
createSymlink(realRoot, gcRoot, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ static bool indirectRoot = false;
|
||||||
|
|
||||||
static Path fixPath(Path path)
|
static Path fixPath(Path path)
|
||||||
{
|
{
|
||||||
|
SwitchToOriginalUser sw;
|
||||||
path = absPath(path);
|
path = absPath(path);
|
||||||
while (!isInStore(path)) {
|
while (!isInStore(path)) {
|
||||||
if (!isLink(path)) break;
|
if (!isLink(path)) break;
|
||||||
|
|
Loading…
Reference in a new issue