parent
4be4f6de56
commit
8bf378e999
|
@ -2554,15 +2554,18 @@ void DerivationGoal::runChild()
|
|||
*/
|
||||
sandboxProfile += "(allow file-read* file-write* process-exec\n";
|
||||
for (auto & i : dirsInChroot) {
|
||||
if (i.first != i.second)
|
||||
if (i.first != i.second.source)
|
||||
throw Error(format(
|
||||
"can't map '%1%' to '%2%': mismatched impure paths not supported on Darwin")
|
||||
% i.first % i.second);
|
||||
% i.first % i.second.source);
|
||||
|
||||
string path = i.first;
|
||||
struct stat st;
|
||||
if (lstat(path.c_str(), &st))
|
||||
if (lstat(path.c_str(), &st)) {
|
||||
if (i.second.optional && errno == ENOENT)
|
||||
continue;
|
||||
throw SysError(format("getting attributes of path ‘%1%’") % path);
|
||||
}
|
||||
if (S_ISDIR(st.st_mode))
|
||||
sandboxProfile += (format("\t(subpath \"%1%\")\n") % path).str();
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue