|
|
@ -157,6 +157,8 @@ void uh_cgi_request( |
|
|
|
fd_set reader; |
|
|
|
fd_set reader; |
|
|
|
fd_set writer; |
|
|
|
fd_set writer; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sigset_t ss; |
|
|
|
|
|
|
|
|
|
|
|
struct sigaction sa; |
|
|
|
struct sigaction sa; |
|
|
|
struct timeval timeout; |
|
|
|
struct timeval timeout; |
|
|
|
struct http_response *res; |
|
|
|
struct http_response *res; |
|
|
@ -187,6 +189,10 @@ void uh_cgi_request( |
|
|
|
|
|
|
|
|
|
|
|
/* exec child */ |
|
|
|
/* exec child */ |
|
|
|
case 0: |
|
|
|
case 0: |
|
|
|
|
|
|
|
/* unblock signals */ |
|
|
|
|
|
|
|
sigemptyset(&ss); |
|
|
|
|
|
|
|
sigprocmask(SIG_SETMASK, &ss, NULL); |
|
|
|
|
|
|
|
|
|
|
|
/* restore SIGTERM */ |
|
|
|
/* restore SIGTERM */ |
|
|
|
sa.sa_flags = 0; |
|
|
|
sa.sa_flags = 0; |
|
|
|
sa.sa_handler = SIG_DFL; |
|
|
|
sa.sa_handler = SIG_DFL; |
|
|
@ -201,6 +207,10 @@ void uh_cgi_request( |
|
|
|
dup2(rfd[1], 1); |
|
|
|
dup2(rfd[1], 1); |
|
|
|
dup2(wfd[0], 0); |
|
|
|
dup2(wfd[0], 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* avoid leaking our pipe into child-child processes */ |
|
|
|
|
|
|
|
fd_cloexec(rfd[1]); |
|
|
|
|
|
|
|
fd_cloexec(wfd[0]); |
|
|
|
|
|
|
|
|
|
|
|
/* check for regular, world-executable file _or_ interpreter */ |
|
|
|
/* check for regular, world-executable file _or_ interpreter */ |
|
|
|
if( ((pi->stat.st_mode & S_IFREG) && |
|
|
|
if( ((pi->stat.st_mode & S_IFREG) && |
|
|
|
(pi->stat.st_mode & S_IXOTH)) || (ip != NULL) |
|
|
|
(pi->stat.st_mode & S_IXOTH)) || (ip != NULL) |
|
|
|