diff options
author | root <root@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-02-14 04:01:20 +0000 |
---|---|---|
committer | root <root@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-02-14 04:01:20 +0000 |
commit | d6b82d872390f4529ff0f012b30a471f8f544f71 (patch) | |
tree | 92dd858bd42ec6955d84043ab6c56c48c0a8cb51 /asterisk.c | |
parent | c0f8f4a4574b1a9c61d5ebf1433f9d4cba24f68c (diff) |
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@9868 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'asterisk.c')
-rw-r--r-- | asterisk.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/asterisk.c b/asterisk.c index cc23c4ff3..5c8a1bfba 100644 --- a/asterisk.c +++ b/asterisk.c @@ -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); |