mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-07 15:03:34 +00:00
* Introduce testlib_extract() helper * Have execve() escape double quotes in cmd.exe's preferred style This makes it possible for us to use system() and popen() with paths that redirect to filenames that contain spaces, e.g. system("echo.com hello >\"hello there.txt\"") It's difficult to solve this problem, because WIN32 only allows passing one single argument when launching programs and each program is allowed to tokenize that however it wants. Most software follows the convention of cmd.exe which is poorly documented and positively byzantine. In the future we're going to solve this by not using cmd.exe at all and instead embedding the cocmd.com interpreter into the system() function. In the meantime, our documentation has been updated to help recalibrate any expectation the user might hold regarding the security of using the Windows command interpreter. Fixes #644 * Introduce double quote support in cocmd.com shell * Add some tests for execve() * Embed cocmd.com interpreter for system() / open() This change lets you use system() in an easier and portable way. The problem with the call in the past has always been that bourne and cmd.com on Windows have less than nothing in common, so pretty much the only command system() could be used for across platforms was maybe echo. cmd.exe is also a security liability due to its escaping rules. Since cocmd.com implements 85% of what we need from bourne, in a really tiny way, it makes perfect sense to be embedded in these functionss. We get a huge performance boost too. Fixes #644 * Support whitespace after cocmd output redirection Co-authored-by: Justine Tunney <jtunney@gmail.com> |
||
---|---|---|
.. | ||
_timespec_test.c | ||
access_test.c | ||
chdir_test.c | ||
clock_getres_test.c | ||
clock_gettime_test.c | ||
closefrom_test.c | ||
commandv_test.c | ||
diagnose_syscall_test.c | ||
dup_test.c | ||
execve_test.c | ||
fcntl_test.c | ||
fileexists_test.c | ||
ftruncate_test.c | ||
getcontext_test.c | ||
getcwd_test.c | ||
getgroups_test.c | ||
getitimer_test.c | ||
ioctl_siocgifconf_test.c | ||
life.c | ||
lock_test.c | ||
lseek_test.c | ||
mkdir_test.c | ||
mkntcmdline_test.c | ||
mkntenvblock_test.c | ||
mkntpath_test.c | ||
nanosleep_test.c | ||
open_test.c | ||
openbsd_test.c | ||
pipe_test.c | ||
pledge2_test.c | ||
pledge_test.c | ||
poll_test.c | ||
pread_test.c | ||
preadv_test.c | ||
printargs_test.c | ||
ptrace_test.c | ||
pwrite_test.c | ||
raise_test.c | ||
read_test.c | ||
readansi_test.c | ||
readlinkat_test.c | ||
renameat_test.c | ||
reservefd_test.c | ||
sched_getaffinity_test.c | ||
sched_setscheduler_test.c | ||
seccomp_test.c | ||
setitimer_test.c | ||
setrlimit_test.c | ||
sigaction_test.c | ||
signal_test.c | ||
sigpending_test.c | ||
sigprocmask_test.c | ||
sigsuspend_test.c | ||
stat_test.c | ||
statfs_test.c | ||
symlinkat_test.c | ||
sys_ptrace_test.c | ||
test.mk | ||
tiny64.elf | ||
tkill_test.c | ||
unlinkat_test.c | ||
unveil_test.c | ||
utimensat_test.c | ||
vfork_test.c | ||
write_test.c | ||
writev_test.c |