mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-12 01:08:00 +00:00
Fix make sandboxing logic for .STRICT mode (#661)
Patch segfaults and handle the `.STRICT = 0` case.
This commit is contained in:
parent
31dab8a75d
commit
9d2f993364
1 changed files with 13 additions and 15 deletions
28
third_party/make/job.c
vendored
28
third_party/make/job.c
vendored
|
@ -1904,32 +1904,30 @@ child_execute_job (struct childbase *child,
|
||||||
c = 0;
|
c = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
internet = !get_target_variable(STRING_SIZE_TUPLE (".STRICT"),
|
|
||||||
c->file, 0) ||
|
|
||||||
parse_bool (get_target_variable
|
|
||||||
(STRING_SIZE_TUPLE (".INTERNET"),
|
|
||||||
c ? c->file : 0, "0"));
|
|
||||||
|
|
||||||
unsandboxed = !get_target_variable(STRING_SIZE_TUPLE (".STRICT"),
|
|
||||||
c->file, 0) ||
|
|
||||||
parse_bool (get_target_variable
|
|
||||||
(STRING_SIZE_TUPLE (".UNSANDBOXED"),
|
|
||||||
c ? c->file : 0, "0"));
|
|
||||||
|
|
||||||
if (c)
|
if (c)
|
||||||
{
|
{
|
||||||
sandboxed = !unsandboxed;
|
|
||||||
strict = parse_bool (get_target_variable
|
strict = parse_bool (get_target_variable
|
||||||
(STRING_SIZE_TUPLE (".STRICT"),
|
(STRING_SIZE_TUPLE (".STRICT"),
|
||||||
c->file, "0"));
|
c->file, "0"));
|
||||||
|
internet = !strict ||
|
||||||
|
parse_bool (get_target_variable
|
||||||
|
(STRING_SIZE_TUPLE (".INTERNET"),
|
||||||
|
c->file, "0"));
|
||||||
|
unsandboxed = !strict ||
|
||||||
|
parse_bool (get_target_variable
|
||||||
|
(STRING_SIZE_TUPLE (".UNSANDBOXED"),
|
||||||
|
c->file, "0"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sandboxed = false;
|
|
||||||
strict = false;
|
strict = false;
|
||||||
|
internet = true;
|
||||||
|
unsandboxed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!unsandboxed)
|
sandboxed = !unsandboxed;
|
||||||
|
|
||||||
|
if (sandboxed)
|
||||||
{
|
{
|
||||||
promises = emptytonull (get_target_variable
|
promises = emptytonull (get_target_variable
|
||||||
(STRING_SIZE_TUPLE (".PLEDGE"),
|
(STRING_SIZE_TUPLE (".PLEDGE"),
|
||||||
|
|
Loading…
Reference in a new issue