Merged changes from r9844 from /trunk. Make sure that PR_SET_DUMPABLE is set to make certain that we still dump core if Asterisk has setuid'd to run as non-root.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@9861 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
BJ Weschke
2006-02-14 03:08:17 +00:00
parent b5111fb985
commit ae8fe3738b

View File

@@ -75,6 +75,7 @@
#include <grp.h>
#include <pwd.h>
#include <sys/stat.h>
#include <sys/prctl.h>
#include <regex.h>
#if defined(__FreeBSD__) || defined( __NetBSD__ ) || defined(SOLARIS)
@@ -2209,6 +2210,12 @@ int main(int argc, char *argv[])
#endif /* __CYGWIN__ */
if (geteuid() && ast_opt_dump_core) {
if (prctl(PR_SET_DUMPABLE, 1, 0, 0, 0) < 0) {
ast_log(LOG_WARNING, "Unable to set the process for core dumps after changing to a non-root user. %s\n", strerror(errno));
}
}
term_init();
printf(term_end());
fflush(stdout);