mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-04-22 06:44:42 +00:00
Fix build rule for pushing cosmo nightlies
This commit is contained in:
parent
e62d7b8789
commit
b212f49ef4
2 changed files with 161 additions and 149 deletions
|
@ -1,17 +1,16 @@
|
||||||
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐
|
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐
|
||||||
#───vi: set et ft=make ts=8 tw=8 fenc=utf-8 :vi───────────────────────┘
|
#───vi: set et ft=make ts=8 tw=8 fenc=utf-8 :vi───────────────────────┘
|
||||||
|
|
||||||
|
o/$(MODE)/test/libc/release/cosmopolitan.zip: .UNSANDBOXED = 1
|
||||||
o/$(MODE)/test/libc/release/cosmopolitan.zip: \
|
o/$(MODE)/test/libc/release/cosmopolitan.zip: \
|
||||||
o/cosmopolitan.h \
|
o/cosmopolitan.h \
|
||||||
o/$(MODE)/ape/ape.lds \
|
o/$(MODE)/ape/ape.lds \
|
||||||
o/$(MODE)/libc/crt/crt.o \
|
o/$(MODE)/libc/crt/crt.o \
|
||||||
o/$(MODE)/ape/ape.o \
|
o/$(MODE)/ape/ape.o \
|
||||||
o/$(MODE)/ape/ape-no-modify-self.o \
|
o/$(MODE)/ape/ape-no-modify-self.o \
|
||||||
o/$(MODE)/cosmopolitan.a \
|
o/$(MODE)/cosmopolitan.a
|
||||||
o/$(MODE)/third_party/zip/zip.com
|
mkdir -p $(@D)
|
||||||
@$(COMPILE) -wAZIP -T$@ \
|
zip -qj $@ \
|
||||||
o/$(MODE)/third_party/zip/zip.com \
|
|
||||||
-qj $@ \
|
|
||||||
o/cosmopolitan.h \
|
o/cosmopolitan.h \
|
||||||
o/$(MODE)/ape/ape.lds \
|
o/$(MODE)/ape/ape.lds \
|
||||||
o/$(MODE)/libc/crt/crt.o \
|
o/$(MODE)/libc/crt/crt.o \
|
||||||
|
|
27
third_party/make/job.c
vendored
27
third_party/make/job.c
vendored
|
@ -68,6 +68,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||||
#include "libc/log/rop.h"
|
#include "libc/log/rop.h"
|
||||||
#include "libc/intrin/kprintf.h"
|
#include "libc/intrin/kprintf.h"
|
||||||
#include "libc/sock/sock.h"
|
#include "libc/sock/sock.h"
|
||||||
|
#include "libc/intrin/kprintf.h"
|
||||||
#include "third_party/make/dep.h"
|
#include "third_party/make/dep.h"
|
||||||
|
|
||||||
#define GOTO_SLOW \
|
#define GOTO_SLOW \
|
||||||
|
@ -1719,6 +1720,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
||||||
{
|
{
|
||||||
const int fdin = good_stdin ? FD_STDIN : get_bad_stdin ();
|
const int fdin = good_stdin ? FD_STDIN : get_bad_stdin ();
|
||||||
struct dep *d;
|
struct dep *d;
|
||||||
|
bool sandboxed;
|
||||||
struct child *c;
|
struct child *c;
|
||||||
char pathbuf[PATH_MAX];
|
char pathbuf[PATH_MAX];
|
||||||
char outpathbuf[PATH_MAX];
|
char outpathbuf[PATH_MAX];
|
||||||
|
@ -1759,8 +1761,22 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
||||||
|
|
||||||
g_strict = Vartoi (lookup_variable (STRING_SIZE_TUPLE(".STRICT")));
|
g_strict = Vartoi (lookup_variable (STRING_SIZE_TUPLE(".STRICT")));
|
||||||
|
|
||||||
|
intptr_t loc = (intptr_t)child; /* we can cast if it's on the heap ;_; */
|
||||||
|
if (!(GetStackAddr() < loc && loc < GetStackAddr() + GetStackSize())) {
|
||||||
|
c = (struct child *)child;
|
||||||
|
} else {
|
||||||
|
c = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
sandboxed = (
|
||||||
|
!Vartoi (lookup_variable
|
||||||
|
(STRING_SIZE_TUPLE(".UNSANDBOXED"))) &&
|
||||||
|
(!c || !Vartoi (lookup_variable_in_set
|
||||||
|
(STRING_SIZE_TUPLE(".UNSANDBOXED"),
|
||||||
|
c->file->variables->set))));
|
||||||
|
|
||||||
/* resolve command into executable path */
|
/* resolve command into executable path */
|
||||||
if (!g_strict)
|
if (!g_strict || !sandboxed)
|
||||||
{
|
{
|
||||||
if ((s = commandv (argv[0], pathbuf, sizeof (pathbuf))))
|
if ((s = commandv (argv[0], pathbuf, sizeof (pathbuf))))
|
||||||
argv[0] = s;
|
argv[0] = s;
|
||||||
|
@ -1773,13 +1789,10 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* [jart] sandbox command based on prerequisites */
|
/* [jart] sandbox command based on prerequisites */
|
||||||
intptr_t loc = (intptr_t)child; /* we can cast if it's on the heap ;_; */
|
if (c)
|
||||||
if (!(GetStackAddr() < loc && loc < GetStackAddr() + GetStackSize())) {
|
{
|
||||||
c = (struct child *)child;
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
if (!Vartoi (lookup_variable (STRING_SIZE_TUPLE(".UNSANDBOXED"))) &&
|
if (sandboxed)
|
||||||
!Vartoi (lookup_variable_in_set (STRING_SIZE_TUPLE(".UNSANDBOXED"),
|
|
||||||
c->file->variables->set)))
|
|
||||||
{
|
{
|
||||||
if (!g_strict && argv[0][0] == '/' && IsDynamicExecutable (argv[0]))
|
if (!g_strict && argv[0][0] == '/' && IsDynamicExecutable (argv[0]))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue