[asterisk-commits] branch 1.2 r9861 - /branches/1.2/asterisk.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Feb 13 20:08:19 MST 2006


Author: bweschke
Date: Mon Feb 13 21:08:17 2006
New Revision: 9861

URL: http://svn.digium.com/view/asterisk?rev=9861&view=rev
Log:
 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.


Modified:
    branches/1.2/asterisk.c

Modified: branches/1.2/asterisk.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/asterisk.c?rev=9861&r1=9860&r2=9861&view=diff
==============================================================================
--- branches/1.2/asterisk.c (original)
+++ branches/1.2/asterisk.c Mon Feb 13 21:08:17 2006
@@ -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 @@
 
 #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);



More information about the asterisk-commits mailing list