Make fixes and improvements

- Invent iso8601us() for faster timestamps
- Improve --strace descriptions of sigset_t
- Rebuild the Landlock Make bootstrap binary
- Introduce MODE=sysv for non-Windows builds
- Permit OFD fcntl() locks under pledge(flock)
- redbean can now protect your kernel from ddos
- Have vfork() fallback to sys_fork() not fork()
- Change kmalloc() to not die when out of memory
- Improve documentation for some termios functions
- Rewrite putenv() and friends to conform to POSIX
- Fix linenoise + strace verbosity issue on Windows
- Fix regressions in our ability to show backtraces
- Change redbean SetHeader() to no-op if value is nil
- Improve fcntl() so SQLite locks work in non-WAL mode
- Remove some unnecessary work during fork() on Windows
- Create redbean-based SSL reverse proxy for IPv4 TurfWar
- Fix ape/apeinstall.sh warning when using non-bash shells
- Add ProgramTrustedIp(), and IsTrustedIp() APIs to redbean
- Support $PWD, $UID, $GID, and $EUID in command interpreter
- Introduce experimental JTqFpD APE prefix for non-Windows builds
- Invent blackhole daemon for firewalling IP addresses via UNIX named socket
- Add ProgramTokenBucket(), AcquireToken(), and CountTokens() APIs to redbean
This commit is contained in:
Justine Tunney 2022-10-17 11:02:04 -07:00
parent 648bf6555c
commit f7ff77d865
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
209 changed files with 3818 additions and 998 deletions

View file

@ -6,10 +6,10 @@
*/
#include "libc/calls/calls.h"
#include "libc/dce.h"
#include "libc/mem/gc.internal.h"
#include "libc/mem/mem.h"
#include "libc/nt/dll.h"
#include "libc/nt/version.h"
#include "libc/mem/gc.internal.h"
#include "libc/runtime/runtime.h"
#include "libc/stdio/stdio.h"
#include "libc/str/locale.h"

View file

@ -13,4 +13,8 @@ LICENSE
LOCAL CHANGES
- Changed the fsync() code to be configured at runtime.
- Added `/zip/.args` file support to SQLite shell
- Added `--strace` system call tracing flag to SQLite shell
- Added `--strace` function call logging flag to SQLite shell
- Configured fsync() using runtime magnums rather than ifdefs
- Save and restore errno in some places to avoid log pollution

View file

@ -1 +1,2 @@
STATIC_YOINK("zipos");
#include "third_party/sqlite3/main.c"

View file

@ -60,6 +60,9 @@
#include "libc/time/time.h"
#include "libc/runtime/runtime.h"
#include "libc/errno.h"
#include "libc/log/log.h"
#include "libc/runtime/symbols.internal.h"
#if SQLITE_USER_AUTHENTICATION
#include "third_party/sqlite3/sqlite3userauth.inc"
#endif
@ -10728,6 +10731,8 @@ static char *cmdline_option_value(int argc, char **argv, int i){
# endif
#endif
STATIC_YOINK("zipos"); // for symtab
int SQLITE_CDECL main(int argc, char **argv){
char *zErrMsg = 0;
ShellState data;
@ -10740,7 +10745,16 @@ int SQLITE_CDECL main(int argc, char **argv){
char **azCmd = 0;
const char *zVfs = 0; /* Value of -vfs command-line option */
// [jart] ensure %t symbols in strace log are symbolic
if (__strace > 0) {
GetSymbolTable();
}
// ShowCrashReports();
// [jart] support /zip/.args file for white labeling
LoadZipArgs(&argc, &argv);
setBinaryMode(stdin, 0);
setvbuf(stderr, 0, _IONBF, 0); /* Make sure stderr is unbuffered */
setvbuf(stdin, (char *)NULL, _IONBF, BUFSIZ);

View file

@ -57,6 +57,7 @@ THIRD_PARTY_SQLITE3_A_DIRECTDEPS = \
LIBC_THREAD \
LIBC_TIME \
LIBC_TINYMATH \
LIBC_ZIPOS \
THIRD_PARTY_GDTOA \
THIRD_PARTY_LINENOISE \
THIRD_PARTY_MUSL \

View file

@ -1934,88 +1934,6 @@ int bfcopy(n)
return ZE_OK;
}
#ifdef NO_RENAME
int rename(from, to)
ZCONST char *from;
ZCONST char *to;
{
unlink(to);
if (link(from, to) == -1)
return -1;
if (unlink(from) == -1)
return -1;
return 0;
}
#endif /* NO_RENAME */
#ifdef ZMEM
/************************/
/* Function memset() */
/************************/
/*
* memset - for systems without it
* bill davidsen - March 1990
*/
char *
memset(buf, init, len)
register char *buf; /* buffer loc */
register int init; /* initializer */
register unsigned int len; /* length of the buffer */
{
char *start;
start = buf;
while (len--) *(buf++) = init;
return(start);
}
/************************/
/* Function memcpy() */
/************************/
char *
memcpy(dst,src,len) /* v2.0f */
register char *dst, *src;
register unsigned int len;
{
char *start;
start = dst;
while (len--)
*dst++ = *src++;
return(start);
}
/************************/
/* Function memcmp() */
/************************/
int
memcmp(b1,b2,len) /* jpd@usl.edu -- 11/16/90 */
register char *b1, *b2;
register unsigned int len;
{
if (len) do { /* examine each byte (if any) */
if (*b1++ != *b2++)
return (*((uch *)b1-1) - *((uch *)b2-1)); /* exit when miscompare */
} while (--len);
return(0); /* no miscompares, yield 0 result */
}
#endif /* ZMEM */
/*------------------------------------------------------------------
* Split archives
*/