Skip to content
Snippets Groups Projects
Commit 961a430f authored by deuce's avatar deuce
Browse files

If _THREAD_SUID_BROKEN then use sigprocmask() and block the hell out of

everything.  *sigh* perhaps we need _PTHREADS_ARENT or something instead.
parent 85e5fe98
Branches
Tags
No related merge requests found
......@@ -1582,6 +1582,10 @@ int main(int argc, char** argv)
SetConsoleCtrlHandler(ControlHandler, TRUE /* Add */);
#elif defined(__unix__)
/* Set up blocked signals */
#ifdef _THREAD_SUID_BROKEN
sigfillset(&sigs);
sigprocmask(SIG_BLOCK,&sigs,NULL);
#else
sigemptyset(&sigs);
sigaddset(&sigs,SIGINT);
sigaddset(&sigs,SIGQUIT);
......@@ -1593,6 +1597,7 @@ int main(int argc, char** argv)
pthread_sigmask(SIG_BLOCK,&sigs,NULL);
signal(SIGPIPE, SIG_IGN); /* Ignore "Broken Pipe" signal (Also used for broken socket etc.) */
signal(SIGALRM, SIG_IGN); /* Ignore "Alarm" signal */
#endif
_beginthread((void(*)(void*))handle_sigs,0,NULL);
if(new_uid_name[0]!=0) { /* check the user arg, if we have uid 0 */
/* Can't recycle servers (re-bind ports) as non-root user */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment