mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-28 15:28:30 +00:00
Stop using .com extension in monorepo
The WIN32 CreateProcess() function does not require an .exe or .com suffix in order to spawn an executable. Now that we have Cosmo bash we're no longer so dependent on the cmd.exe prompt.
This commit is contained in:
parent
c8383f25b4
commit
a6baba1b07
239 changed files with 2092 additions and 2244 deletions
|
@ -15,7 +15,7 @@ TOOL_BUILD_OBJS = \
|
|||
$(TOOL_BUILD_SRCS:%.c=o/$(MODE)/%.o)
|
||||
|
||||
TOOL_BUILD_COMS = \
|
||||
$(TOOL_BUILD_SRCS:%.c=o/$(MODE)/%.com)
|
||||
$(TOOL_BUILD_SRCS:%.c=o/$(MODE)/%)
|
||||
|
||||
TOOL_BUILD_CHECKS = \
|
||||
$(TOOL_BUILD).pkg \
|
||||
|
@ -69,7 +69,7 @@ o/$(MODE)/tool/build/build.pkg: \
|
|||
$(TOOL_BUILD_OBJS) \
|
||||
$(foreach x,$(TOOL_BUILD_DIRECTDEPS),$($(x)_A).pkg)
|
||||
|
||||
o/$(MODE)/tool/build/%.com.dbg: \
|
||||
o/$(MODE)/tool/build/%.dbg: \
|
||||
$(TOOL_BUILD_DEPS) \
|
||||
o/$(MODE)/tool/build/build.pkg \
|
||||
o/$(MODE)/tool/build/%.o \
|
||||
|
@ -78,9 +78,9 @@ o/$(MODE)/tool/build/%.com.dbg: \
|
|||
@$(APELINK)
|
||||
|
||||
o/$(MODE)/tool/build/dso/sandbox-$(ARCH).so.zip.o \
|
||||
o/$(MODE)/tool/build/false.com.zip.o \
|
||||
o/$(MODE)/tool/build/echo.com.zip.o \
|
||||
o/$(MODE)/tool/build/cocmd.com.zip.o: private \
|
||||
o/$(MODE)/tool/build/false.zip.o \
|
||||
o/$(MODE)/tool/build/echo.zip.o \
|
||||
o/$(MODE)/tool/build/cocmd.zip.o: private \
|
||||
ZIPOBJ_FLAGS += \
|
||||
-B
|
||||
|
||||
|
@ -115,7 +115,7 @@ o/$(MODE)/tool/build/dso/sandbox-$(ARCH).so: \
|
|||
o/$(MODE)/libc/sysv/restorert.o \
|
||||
$(OUTPUT_OPTION)
|
||||
|
||||
o/$(MODE)/tool/build/pledge.com.dbg: \
|
||||
o/$(MODE)/tool/build/pledge.dbg: \
|
||||
$(TOOL_BUILD_DEPS) \
|
||||
o/$(MODE)/tool/build/build.pkg \
|
||||
o/$(MODE)/tool/build/dso/sandbox-$(ARCH).so.zip.o \
|
||||
|
@ -135,8 +135,8 @@ o/$(MODE)/tool/build/dso/dlopen_helper.so: \
|
|||
o/$(MODE)/tool/build/dso/dlopen_helper.o \
|
||||
$(OUTPUT_OPTION)
|
||||
|
||||
o/$(MODE)/tool/build/dlopen_test.com.runs: \
|
||||
o/$(MODE)/tool/build/dlopen_test.com \
|
||||
o/$(MODE)/tool/build/dlopen_test.runs: \
|
||||
o/$(MODE)/tool/build/dlopen_test \
|
||||
o/$(MODE)/tool/build/dso/dlopen_helper.so
|
||||
$< o/$(MODE)/tool/build/dso/dlopen_helper.so
|
||||
|
||||
|
|
|
@ -1722,7 +1722,7 @@ static unsigned char *GetZipEndOfCentralDirectory(struct Input *in) {
|
|||
}
|
||||
}
|
||||
Die(in->path, "zip eocd not found in last 64kb of elf even though a .zip "
|
||||
"section exists; you may need to run fixupobj.com");
|
||||
"section exists; you may need to run fixupobj");
|
||||
}
|
||||
|
||||
static void IndexZipAssetsFromElf(struct Input *in) {
|
||||
|
|
|
@ -24,11 +24,11 @@
|
|||
#include "libc/elf/struct/ehdr.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/limits.h"
|
||||
#include "libc/macho.internal.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/stdckdint.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
|
@ -275,7 +275,7 @@ static void GetMachoPayload(const char *image, size_t imagesize,
|
|||
//
|
||||
// - `arg=" 9293"` is how we originally had ape do it
|
||||
// - `arg=$(( 9293))` b/c busybox sh disliked quoted space
|
||||
// - `arg=9293 ` is generated by modern apelink.com program
|
||||
// - `arg=9293 ` is generated by modern apelink program
|
||||
//
|
||||
unassert(regcomp(&rx,
|
||||
"bs=" // dd block size arg
|
||||
|
@ -507,7 +507,7 @@ static void Assimilate(void) {
|
|||
case FORMAT_MACHO:
|
||||
Die(path, "can't assimilate elf to macho");
|
||||
case FORMAT_PE:
|
||||
Die(path, "can't assimilate elf to pe (try elf2pe.com)");
|
||||
Die(path, "can't assimilate elf to pe (try elf2pe)");
|
||||
default:
|
||||
unassert(false);
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ __static_yoink("zipos");
|
|||
"\
|
||||
SYNOPSIS\n\
|
||||
\n\
|
||||
compile.com [FLAGS] COMMAND [ARGS...]\n\
|
||||
compile [FLAGS] COMMAND [ARGS...]\n\
|
||||
\n\
|
||||
OVERVIEW\n\
|
||||
\n\
|
||||
|
@ -83,7 +83,7 @@ DESCRIPTION\n\
|
|||
\n\
|
||||
This is a generic command wrapper, e.g.\n\
|
||||
\n\
|
||||
compile.com gcc -o program program.c\n\
|
||||
compile gcc -o program program.c\n\
|
||||
\n\
|
||||
This wrapper provides the following services:\n\
|
||||
\n\
|
||||
|
@ -681,7 +681,7 @@ int Launch(void) {
|
|||
} else {
|
||||
/* this should never happen */
|
||||
PrintRed();
|
||||
appends(&output, "error: compile.com read() failed w/ ");
|
||||
appends(&output, "error: compile read() failed w/ ");
|
||||
appendd(&output, buf, FormatInt64(buf, errno) - buf);
|
||||
PrintReset();
|
||||
appendw(&output, READ16LE(": "));
|
||||
|
@ -704,7 +704,7 @@ int Launch(void) {
|
|||
} else {
|
||||
/* this should never happen */
|
||||
PrintRed();
|
||||
appends(&output, "error: compile.com wait4() failed w/ ");
|
||||
appends(&output, "error: compile wait4() failed w/ ");
|
||||
appendd(&output, buf, FormatInt64(buf, errno) - buf);
|
||||
PrintReset();
|
||||
appendw(&output, READ16LE(": "));
|
||||
|
@ -716,13 +716,13 @@ int Launch(void) {
|
|||
if (gotchld) {
|
||||
us = GetTimespecMicros(finish) - GetTimespecMicros(signalled);
|
||||
if (us > 1000000) {
|
||||
appends(&output, "wut: compile.com needed ");
|
||||
appends(&output, "wut: compile needed ");
|
||||
appendd(&output, buf, FormatUint64Thousands(buf, us) - buf);
|
||||
appends(&output, "µs to wait() for zombie ");
|
||||
rc = -1;
|
||||
}
|
||||
if (gotchld > 1) {
|
||||
appends(&output, "wut: compile.com got multiple sigchld?! ");
|
||||
appends(&output, "wut: compile got multiple sigchld?! ");
|
||||
rc = -1;
|
||||
}
|
||||
}
|
||||
|
@ -909,9 +909,9 @@ int main(int argc, char *argv[]) {
|
|||
isgcc = true;
|
||||
} else if (strstr(s, "ld.bfd")) {
|
||||
isbfd = true;
|
||||
} else if (strstr(s, "ar.com")) {
|
||||
} else if (strstr(s, "ar")) {
|
||||
isar = true;
|
||||
} else if (strstr(s, "package.com")) {
|
||||
} else if (strstr(s, "package")) {
|
||||
ispkg = true;
|
||||
}
|
||||
|
||||
|
@ -921,7 +921,7 @@ int main(int argc, char *argv[]) {
|
|||
// replace output filename argument
|
||||
//
|
||||
// some commands (e.g. ar) don't use the `-o PATH` notation. in that
|
||||
// case we assume the output path was passed to compile.com -TTARGET
|
||||
// case we assume the output path was passed to compile -TTARGET
|
||||
// which means we can replace the appropriate command line argument.
|
||||
if (!noworkaround && //
|
||||
!movepath && //
|
||||
|
@ -1180,7 +1180,7 @@ int main(int argc, char *argv[]) {
|
|||
} else if (target) {
|
||||
outpath = target;
|
||||
} else {
|
||||
fputs("error: compile.com needs -TTARGET or -oOUTPATH\n", stderr);
|
||||
fputs("error: compile needs -TTARGET or -oOUTPATH\n", stderr);
|
||||
exit(7);
|
||||
}
|
||||
|
||||
|
@ -1514,10 +1514,10 @@ int main(int argc, char *argv[]) {
|
|||
// flush output
|
||||
if (WriteAllUntilSignalledOrError(2, output, appendz(output).i) == -1) {
|
||||
if (errno == EINTR) {
|
||||
s = "notice: compile.com output truncated\n";
|
||||
s = "notice: compile output truncated\n";
|
||||
} else {
|
||||
if (!exitcode) exitcode = 55;
|
||||
s = "error: compile.com failed to write result\n";
|
||||
s = "error: compile failed to write result\n";
|
||||
}
|
||||
write(2, s, strlen(s));
|
||||
}
|
||||
|
|
|
@ -26,10 +26,10 @@
|
|||
/**
|
||||
* Removes file system caches from RAM.
|
||||
*
|
||||
* make o//tool/build/dropcache.com
|
||||
* sudo mv o//tool/build/dropcache.com /usr/local/bin/
|
||||
* sudo chown root /usr/local/bin/dropcache.com
|
||||
* sudo chmod u+s /usr/local/bin/dropcache.com
|
||||
* make o//tool/build/dropcache
|
||||
* sudo mv o//tool/build/dropcache /usr/local/bin/
|
||||
* sudo chown root /usr/local/bin/dropcache
|
||||
* sudo chmod u+s /usr/local/bin/dropcache
|
||||
*/
|
||||
|
||||
static void Write(int fd, const char *s) {
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "libc/elf/struct/shdr.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/intrin/describeflags.internal.h"
|
||||
#include "libc/intrin/dll.h"
|
||||
#include "libc/limits.h"
|
||||
|
@ -39,6 +38,7 @@
|
|||
#include "libc/nt/struct/imageoptionalheader.internal.h"
|
||||
#include "libc/nt/struct/imagesectionheader.internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/stdckdint.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
|
@ -48,7 +48,7 @@
|
|||
#include "third_party/getopt/getopt.internal.h"
|
||||
|
||||
// see tool/hello/hello-pe.c for an example program this can link
|
||||
// make -j8 m=tiny o/tiny/tool/hello/hello-pe.com
|
||||
// make -j8 m=tiny o/tiny/tool/hello/hello-pe
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||
|
||||
|
|
|
@ -22,14 +22,14 @@ TOOL_BUILD_LIB_A_SRCS = \
|
|||
$(TOOL_BUILD_LIB_A_SRCS_C)
|
||||
|
||||
TOOL_BUILD_LIB_COMS = \
|
||||
o/$(MODE)/tool/build/lib/apetest.com \
|
||||
o/$(MODE)/tool/build/lib/apetest2.com
|
||||
o/$(MODE)/tool/build/lib/apetest \
|
||||
o/$(MODE)/tool/build/lib/apetest2
|
||||
|
||||
TOOL_BUILD_LIB_A_OBJS = \
|
||||
$(TOOL_BUILD_LIB_A_SRCS_S:%.S=o/$(MODE)/%.o) \
|
||||
$(TOOL_BUILD_LIB_A_SRCS_C:%.c=o/$(MODE)/%.o) \
|
||||
o/$(MODE)/tool/build/lib/apetest.com.zip.o \
|
||||
o/$(MODE)/tool/build/lib/apetest2.com.zip.o
|
||||
o/$(MODE)/tool/build/lib/apetest.zip.o \
|
||||
o/$(MODE)/tool/build/lib/apetest2.zip.o
|
||||
|
||||
TOOL_BUILD_LIB_A_DIRECTDEPS = \
|
||||
LIBC_CALLS \
|
||||
|
@ -74,22 +74,22 @@ o/$(MODE)/tool/build/lib/ssefloat.o: private \
|
|||
-msse3
|
||||
endif
|
||||
|
||||
o/$(MODE)/tool/build/lib/apetest.com.dbg: \
|
||||
o/$(MODE)/tool/build/lib/apetest.dbg: \
|
||||
$(TOOL_BUILD_LIB_A_DEPS) \
|
||||
o/$(MODE)/tool/build/lib/apetest.o \
|
||||
$(CRT) \
|
||||
$(APE_NO_MODIFY_SELF)
|
||||
@$(APELINK)
|
||||
|
||||
o/$(MODE)/tool/build/lib/apetest2.com.dbg: \
|
||||
o/$(MODE)/tool/build/lib/apetest2.dbg: \
|
||||
$(TOOL_BUILD_LIB_A_DEPS) \
|
||||
o/$(MODE)/tool/build/lib/apetest.o \
|
||||
$(CRT) \
|
||||
$(APE_COPY_SELF)
|
||||
@$(APELINK)
|
||||
|
||||
o/$(MODE)/tool/build/lib/apetest.com.zip.o \
|
||||
o/$(MODE)/tool/build/lib/apetest2.com.zip.o: private \
|
||||
o/$(MODE)/tool/build/lib/apetest.zip.o \
|
||||
o/$(MODE)/tool/build/lib/apetest2.zip.o: private \
|
||||
ZIPOBJ_FLAGS += \
|
||||
-B
|
||||
|
||||
|
|
|
@ -37,12 +37,12 @@
|
|||
* The purpose of this library is to be able to have build commands with
|
||||
* huge argument lists. The way we do that is by replacing commands like
|
||||
*
|
||||
* foo.com lots of args
|
||||
* foo lots of args
|
||||
*
|
||||
* with this
|
||||
*
|
||||
* echo of args >args
|
||||
* foo.com lots @args
|
||||
* foo lots @args
|
||||
*
|
||||
* This iterator abstracts the process of reading the special `@`
|
||||
* prefixed args. In order to do that quickly and easily, we make the
|
||||
|
@ -57,7 +57,7 @@
|
|||
* # don't do this
|
||||
* target: thousands of args
|
||||
* $(file >$@.args) $(foreach x,$^,$(file >>$@.args,$(x)))
|
||||
* tool.com -o $@ @$@.args
|
||||
* tool -o $@ @$@.args
|
||||
*
|
||||
* That is slow because it needs to open and close the args file
|
||||
* thousands of times. If we trade away filenames with spaces then the
|
||||
|
@ -66,7 +66,7 @@
|
|||
* # do this
|
||||
* target: thousands of args
|
||||
* $(file >$@.args,$^)
|
||||
* tool.com -o $@ @$@.args
|
||||
* tool -o $@ @$@.args
|
||||
*
|
||||
* We need (2) because it make the code in this file simpler and avoids
|
||||
* a malloc() dependency. Having that trailing character means argument
|
||||
|
|
|
@ -37,7 +37,7 @@ void *GetRunitPsk(void) {
|
|||
struct stat st;
|
||||
p = gc(xasprintf("%s/.runit.psk", gc(xhomedir())));
|
||||
if (stat(p, &st) == -1 || st.st_size != 32) {
|
||||
fprintf(stderr, "need o//examples/getrandom.com -bn32 >~/.runit.psk\n");
|
||||
fprintf(stderr, "need o//examples/getrandom -bn32 >~/.runit.psk\n");
|
||||
exit(1);
|
||||
}
|
||||
CHECK_NOTNULL((r = malloc(32)));
|
||||
|
|
|
@ -40,10 +40,10 @@
|
|||
"-march=native flag printer v0.1\n" \
|
||||
"copyright 2023 justine alexandra roberts tunney\n"
|
||||
|
||||
#define USAGE \
|
||||
"usage: march-native.com [-hvc]\n" \
|
||||
" -h show help\n" \
|
||||
" -v show version\n" \
|
||||
#define USAGE \
|
||||
"usage: march-native [-hvc]\n" \
|
||||
" -h show help\n" \
|
||||
" -v show version\n" \
|
||||
" -c assume we're using clang (not gcc)\n"
|
||||
|
||||
static bool isclang;
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
/**
|
||||
* @fileoverview stronger mktemp for shell scripts, e.g.
|
||||
*
|
||||
* o//tool/build/mktemper.com ${TMPDIR:-/tmp}/fooXXXXXXXXXXXXX.o
|
||||
* o//tool/build/mktemper ${TMPDIR:-/tmp}/fooXXXXXXXXXXXXX.o
|
||||
*
|
||||
* Is a good way to name an intermediate object file.
|
||||
*/
|
||||
|
|
|
@ -52,11 +52,11 @@ __static_yoink("realloc");
|
|||
*
|
||||
* This script verifies the well-formedness of dependencies, e.g.
|
||||
*
|
||||
* o/tool/build/package.com \
|
||||
* o/tool/build/package \
|
||||
* -o o/libc/stubs/stubs.pkg \
|
||||
* o/libc/stubs/{a,b,...}.o
|
||||
*
|
||||
* o/tool/build/package.com \
|
||||
* o/tool/build/package \
|
||||
* -o o/libc/nexgen32e/nexgen32e.pkg \
|
||||
* -d o/libc/stubs/stubs.pkg \
|
||||
* o/libc/nexgen32e/{a,b,...}.o
|
||||
|
@ -358,15 +358,14 @@ static void GetOpts(struct Package *pkg, struct Packages *deps, int argc,
|
|||
}
|
||||
}
|
||||
if (pkg->path == -1) {
|
||||
tinyprint(2, "error: no packages passed to package.com\n", NULL);
|
||||
tinyprint(2, "error: no packages passed to package\n", NULL);
|
||||
exit(1);
|
||||
}
|
||||
if (optind == argc) {
|
||||
tinyprint(
|
||||
2,
|
||||
"no objects passed to package.com; is your foo.mk $(FOO_OBJS) glob "
|
||||
"broken?\n",
|
||||
NULL);
|
||||
tinyprint(2,
|
||||
"no objects passed to package; is your foo.mk $(FOO_OBJS) glob "
|
||||
"broken?\n",
|
||||
NULL);
|
||||
exit(1);
|
||||
}
|
||||
getargs_init(&ga, argv + optind);
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#include "libc/errno.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/intrin/promises.internal.h"
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
|
@ -48,6 +47,7 @@
|
|||
#include "libc/nexgen32e/kcpuids.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/runtime/stack.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/sock/sock.h"
|
||||
#include "libc/sock/struct/pollfd.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
|
@ -854,10 +854,10 @@ int main(int argc, char *argv[]) {
|
|||
// perform unveiling
|
||||
ApplyFilesystemPolicy(ipromises);
|
||||
|
||||
// pledge.com uses the return eperm instead of killing the process
|
||||
// model. we do this becasue it's only possible to have sigsys print
|
||||
// crash messages if we're not pledging exec, which is what this tool
|
||||
// always has to do currently.
|
||||
// pledge uses the return eperm instead of killing the process model.
|
||||
// we do this becasue it's only possible to have sigsys print crash
|
||||
// messages if we're not pledging exec, which is what this tool always
|
||||
// has to do currently.
|
||||
if (g_kflag) {
|
||||
__pledge_mode = PLEDGE_PENALTY_KILL_PROCESS;
|
||||
} else {
|
||||
|
|
|
@ -72,9 +72,9 @@
|
|||
* of certificates. It's how long it takes to connect, copy the binary,
|
||||
* and run it. The remote daemon is deployed via SSH if it's not there.
|
||||
*
|
||||
* o/default/tool/build/runit.com \
|
||||
* o/default/tool/build/runitd.com \
|
||||
* o/default/test/libc/mem/qsort_test.com \
|
||||
* o/default/tool/build/runit \
|
||||
* o/default/tool/build/runitd \
|
||||
* o/default/test/libc/mem/qsort_test \
|
||||
* freebsd.test.:31337:22
|
||||
*
|
||||
* APE binaries are hermetic and embed dependent files within their zip
|
||||
|
@ -412,10 +412,10 @@ int SpawnSubprocesses(int argc, char *argv[]) {
|
|||
// fork off 𝑛 subprocesses for each host on which we run binary.
|
||||
// what's important here is htop in tree mode will report like:
|
||||
//
|
||||
// runit.com xnu freebsd netbsd
|
||||
// ├─runit.com xnu
|
||||
// ├─runit.com freebsd
|
||||
// └─runit.com netbsd
|
||||
// runit xnu freebsd netbsd
|
||||
// ├─runit xnu
|
||||
// ├─runit freebsd
|
||||
// └─runit netbsd
|
||||
//
|
||||
// That way when one hangs, it's easy to know what o/s it is.
|
||||
argc -= 3;
|
||||
|
|
|
@ -30,19 +30,18 @@
|
|||
#include "libc/fmt/conv.h"
|
||||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/fmt/libgen.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/log/appendresourcereport.internal.h"
|
||||
#include "libc/log/check.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/mem/gc.h"
|
||||
#include "libc/mem/gc.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/nexgen32e/crc32.h"
|
||||
#include "libc/proc/posix_spawn.h"
|
||||
#include "libc/runtime/internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/runtime/syslib.internal.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/sock/sock.h"
|
||||
#include "libc/sock/struct/pollfd.h"
|
||||
#include "libc/sock/struct/sockaddr.h"
|
||||
|
@ -489,7 +488,7 @@ void *ClientWorker(void *arg) {
|
|||
// condition can happen, where etxtbsy is raised by our execve
|
||||
// we're using o_cloexec so it's guaranteed to fix itself fast
|
||||
// thus we use an optimistic approach to avoid expensive locks
|
||||
sprintf(client->tmpexepath, "o/%s.XXXXXX.com",
|
||||
sprintf(client->tmpexepath, "o/%s.XXXXXX",
|
||||
basename(stripext(gc(strdup(origname)))));
|
||||
int exefd = openatemp(AT_FDCWD, client->tmpexepath, 4, O_CLOEXEC, 0700);
|
||||
if (exefd == -1) {
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
#define USAGE \
|
||||
"\
|
||||
Usage: unbuffer.com [FLAGS] PROG ARGS...\n\
|
||||
Usage: unbuffer [FLAGS] PROG ARGS...\n\
|
||||
-o PATH output file\n\
|
||||
"
|
||||
|
||||
|
|
|
@ -29,15 +29,12 @@
|
|||
|
||||
#define USAGE \
|
||||
"\
|
||||
usage: unveil.com [-h] PROG ARGS...\n\
|
||||
usage: unveil [-h] PROG ARGS...\n\
|
||||
-h show help\n\
|
||||
\n\
|
||||
unveil.com v1.o\n\
|
||||
unveil v1.o\n\
|
||||
copyright 2022 justine alexandra roberts tunney\n\
|
||||
https://twitter.com/justinetunney\n\
|
||||
https://linkedin.com/in/jtunney\n\
|
||||
https://justine.lol/pledge/\n\
|
||||
https://github.com/jart\n\
|
||||
licensed isc\n\
|
||||
\n\
|
||||
this program lets you launch linux commands in a filesystem sandbox\n\
|
||||
inspired by the design of openbsd's unveil() system call.\n\
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
#include "libc/elf/struct/shdr.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/fmt/magnumstrs.internal.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/limits.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/stdio/sysparam.h"
|
||||
#include "libc/str/str.h"
|
||||
|
@ -85,8 +85,8 @@ FLAGS\n\
|
|||
\n\
|
||||
EXAMPLE\n\
|
||||
\n\
|
||||
objcopy -SO binary foo.com.dbg foo.com\n\
|
||||
zipcopy foo.com.dbg foo.com\n\
|
||||
objcopy -SO binary foo.dbg foo\n\
|
||||
zipcopy foo.dbg foo\n\
|
||||
\n\
|
||||
\n\
|
||||
",
|
||||
|
@ -122,7 +122,7 @@ static void CopyZip(void) {
|
|||
//
|
||||
// if input is an elf file with sections, then the zip artifacts need
|
||||
// to have been linked into a .zip section and then later copied into
|
||||
// the file end by fixupobj.com.
|
||||
// the file end by fixupobj.
|
||||
//
|
||||
if (IsElf64Binary((ehdr = (Elf64_Ehdr *)inmap), insize) && ehdr->e_shnum &&
|
||||
(secstrs = GetElfSectionNameStringTable(ehdr, insize)) &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue