mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-06 11:18:30 +00:00
Fix bugs and make code tinier
- Fixed bug where stdio eof wasn't being sticky - Fixed bug where fseeko() wasn't clearing eof state - Removed assert() usage from libc favoring _unassert() / _npassert()
This commit is contained in:
parent
9b7c8db846
commit
d5910e2673
115 changed files with 510 additions and 290 deletions
|
@ -274,6 +274,11 @@ static int WaitForTrace(int main) {
|
|||
|
||||
/**
|
||||
* Disables internet access.
|
||||
*
|
||||
* Warning: This function uses ptrace to react to seccomp filter events.
|
||||
* This approach is effective, but it's not bulletproof, since a highly
|
||||
* motivated attacker could theoretically use threads to modify sockaddr
|
||||
* in the short time between it being monitored and the actual syscall.
|
||||
*/
|
||||
int nointernet(void) {
|
||||
int ws, act, main;
|
||||
|
@ -317,7 +322,7 @@ int nointernet(void) {
|
|||
sigprocmask(SIG_SETMASK, &old, 0);
|
||||
return eperm();
|
||||
}
|
||||
assert(WIFSTOPPED(ws));
|
||||
_npassert(WIFSTOPPED(ws));
|
||||
|
||||
// parent process becomes monitor of subprocess tree. all signals
|
||||
// continue to be blocked since we assume they'll also be sent to
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue