mirror of
https://github.com/NixOS/nix
synced 2025-06-29 06:21:14 +02:00
Obfuscate memory roots for non-root users
This commit is contained in:
parent
43331d6344
commit
a17f86ce3a
2 changed files with 16 additions and 9 deletions
|
@ -478,8 +478,15 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
|
|||
Roots roots = store->findRoots();
|
||||
logger->stopWork();
|
||||
to << roots.size();
|
||||
for (auto & i : roots)
|
||||
to << i.first << i.second;
|
||||
int n = 0;
|
||||
for (auto & i : roots) {
|
||||
// Obfuscate 'memory' roots as they exposes information about other users,
|
||||
if (i.first.rfind("{memory:", 0) == 0) {
|
||||
to << fmt("{memory:%d}", n++) << i.second;
|
||||
} else {
|
||||
to << i.first << i.second;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue