FSCORE-197 unprivileged user setting bigger stack for switch_system thread failure

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9817 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2008-10-03 21:30:04 +00:00
parent 18adf282ae
commit 23375deb8c
1 changed files with 4 additions and 2 deletions

View File

@ -758,7 +758,7 @@ SWITCH_DECLARE(void) switch_core_setrlimits(void)
#ifndef __FreeBSD__
memset(&rlp, 0, sizeof(rlp));
rlp.rlim_cur = SWITCH_THREAD_STACKSIZE;
rlp.rlim_max = SWITCH_THREAD_STACKSIZE;
rlp.rlim_max = SWITCH_SYSTEM_THREAD_STACKSIZE;
setrlimit(RLIMIT_STACK, &rlp);
#endif
@ -1512,7 +1512,9 @@ SWITCH_DECLARE(int) switch_system(const char *cmd, switch_bool_t wait)
rlim.rlim_cur = SWITCH_SYSTEM_THREAD_STACKSIZE;
rlim.rlim_max = SWITCH_SYSTEM_THREAD_STACKSIZE;
setrlimit(RLIMIT_STACK, &rlim);
if (setrlimit(RLIMIT_STACK, &rlim) < 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Setting stack size failed!\n");
}
#endif
if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) {