mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 08:46:58 +08:00
properly disable safe_fork
This commit is contained in:
@@ -52,9 +52,9 @@ void pr_set_undumpable(const char *mod)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__linux__) && defined(ENABLE_LINUX_NS)
|
||||||
pid_t safe_fork(void)
|
pid_t safe_fork(void)
|
||||||
{
|
{
|
||||||
#if defined(__linux__) && defined(ENABLE_LINUX_NS)
|
|
||||||
long ret;
|
long ret;
|
||||||
/* fork: 100%
|
/* fork: 100%
|
||||||
* CLONE_NEWPID|CLONE_NEWNET|CLONE_NEWIPC: 3%
|
* CLONE_NEWPID|CLONE_NEWNET|CLONE_NEWIPC: 3%
|
||||||
@@ -66,10 +66,8 @@ pid_t safe_fork(void)
|
|||||||
if (ret == 0 && syscall(SYS_getpid)!= 1)
|
if (ret == 0 && syscall(SYS_getpid)!= 1)
|
||||||
return -1;
|
return -1;
|
||||||
return ret;
|
return ret;
|
||||||
#else
|
|
||||||
return -1;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
SIGHANDLER_T ocsignal(int signum, SIGHANDLER_T handler)
|
SIGHANDLER_T ocsignal(int signum, SIGHANDLER_T handler)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user