1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-03 02:01:48 +02:00

Handle octal escapes in /proc/self/mountinfo

This commit is contained in:
Eelco Dolstra 2012-09-28 21:39:30 -04:00
parent f406288cc7
commit e666e1156f
3 changed files with 24 additions and 2 deletions

View file

@ -1914,8 +1914,9 @@ void DerivationGoal::initChild()
Strings mounts = tokenizeString<Strings>(readFile("/proc/self/mountinfo", true), "\n");
foreach (Strings::iterator, i, mounts) {
vector<string> fields = tokenizeString<vector<string> >(*i, " ");
if (mount(0, fields.at(4).c_str(), 0, MS_PRIVATE, 0) == -1)
throw SysError(format("unable to make filesystem `%1%' private") % fields.at(4));
string fs = decodeOctalEscaped(fields.at(4));
if (mount(0, fs.c_str(), 0, MS_PRIVATE, 0) == -1)
throw SysError(format("unable to make filesystem `%1%' private") % fs);
}
/* Bind-mount all the directories from the "host"