Ignore:
Timestamp:
2011-07-17T09:18:59+02:00 (5 years ago)
Author:
jow
Message:

[package] uhttpd: unblock signals in CGI childs, solves hanging ssh logout after server restart from within LuCI and similar problems

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/uhttpd/src/uhttpd-cgi.c

    r22692 r27628  
    158158        fd_set writer; 
    159159 
     160        sigset_t ss; 
     161 
    160162        struct sigaction sa; 
    161163        struct timeval timeout; 
     
    188190                /* exec child */ 
    189191                case 0: 
     192                        /* unblock signals */ 
     193                        sigemptyset(&ss); 
     194                        sigprocmask(SIG_SETMASK, &ss, NULL); 
     195 
    190196                        /* restore SIGTERM */ 
    191197                        sa.sa_flags = 0; 
     
    201207                        dup2(rfd[1], 1); 
    202208                        dup2(wfd[0], 0); 
     209 
     210                        /* avoid leaking our pipe into child-child processes */ 
     211                        fd_cloexec(rfd[1]); 
     212                        fd_cloexec(wfd[0]); 
    203213 
    204214                        /* check for regular, world-executable file _or_ interpreter */ 
Note: See TracChangeset for help on using the changeset viewer.