4 ms·
The behavior that Cosmopolitan needs is required by POSIX because UNIX Sixth Edition didn't have shebang lines. It's normally an implementation detail of execve
by jart 6y ago
The behavior that Cosmopolitan needs is required by POSIX because UNIX Sixth Edition didn't have shebang lines. It's normally an implementation detail of execve() in C libraries and the behavior is implemented by nearly all shells too. So far the only issue has been that some shells, like zsh, have a binary safety check where it refuses to run scripts that have embedded NUL characters. I worked with the FreeBSD team to get POSIX revised to clarify the correct behavior w.r.t. these restrictions. FreeBSD's /bin/sh has already been patched and zsh is pending upstream. https://github.com/jart/zsh/commit/94a4bc14bb2e415ec3d10cf716512bd3e0d99f48 https://github.com/jart/zsh/commit/94a4bc14bb2e415ec3d10cf71...
- ashkankiani 6y agoI appreciate the thoroughness with which you are pursuing this. The amount of work you're doing outside of the technical aspect is definitely something I can admit that I would've never pursued. It's encouraging to see.