File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -992,10 +992,24 @@ void DerivationBuilderImpl::startBuilder()
992992 i.pop_back ();
993993 }
994994 size_t p = i.find (' =' );
995- if (p == std::string::npos)
996- pathsInChroot[i] = {i, optional};
997- else
998- pathsInChroot[i.substr (0 , p)] = {i.substr (p + 1 ), optional};
995+
996+ std::string inside, outside;
997+ if (p == std::string::npos) {
998+ inside = i;
999+ outside = i;
1000+ } else {
1001+ inside = i.substr (0 , p);
1002+ outside = i.substr (p + 1 );
1003+ }
1004+
1005+ auto maybeSt = maybeLstat (outside);
1006+ if (!maybeSt) {
1007+ if (!optional) {
1008+ throw SysError (" path '%s' is configured as part of the `sandbox-paths` option, but is inaccessible" , outside);
1009+ }
1010+ }
1011+
1012+ pathsInChroot[inside] = {outside, optional};
9991013 }
10001014 if (hasPrefix (store.storeDir , tmpDirInSandbox))
10011015 {
You can’t perform that action at this time.
0 commit comments