Search
j0ke.net Open Build Service
>
Projects
>
internetx
:
mysql5
:
5.0-enterprise
>
mysql-5.0.62-enterprise
> mysql-5.0.26-coredump.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File mysql-5.0.26-coredump.patch of Package mysql-5.0.62-enterprise
# The kernel won't generate coredumps after setgid() and setuid() # unless prctl(PR_SET_DUMPABLE, 1) is called --- sql/mysqld.cc +++ sql/mysqld.cc @@ -126,6 +126,10 @@ extern "C" { // Because of SCO 3.2V4 #include <sys/mman.h> #endif +#ifdef HAVE_LINUX_PRCTL +#include <sys/prctl.h> +#endif + #ifdef __NETWARE__ #define zVOLSTATE_ACTIVE 6 #define zVOLSTATE_DEACTIVE 2 @@ -1362,7 +1366,13 @@ static void set_user(const char *user, s sql_perror("setuid"); unireg_abort(1); } -#endif +#ifdef HAVE_LINUX_PRCTL + if (test_flags & TEST_CORE_ON_SIGNAL) + { + prctl(PR_SET_DUMPABLE, 1); + } +#endif /* HAVE_LINUX_PRCTL */ +#endif /* !__WIN__ !OS2 !__NETWARE__ */ } --- configure.in +++ configure.in @@ -2211,6 +2211,19 @@ then fi AC_MSG_RESULT("$netinet_inc") +# Check for Linux prctl() to get mysqld coredumps +# IRIX reportedly has prctl() too, but it works different +AC_MSG_CHECKING(for Linux prctl()) +AC_TRY_COMPILE( +[#include <sys/prctl.h>], +[prctl(PR_SET_DUMPABLE, 1);], +linux_prctl=yes, linux_prctl=no) +if test "$linux_prctl" = "yes" +then + AC_DEFINE([HAVE_LINUX_PRCTL], [1], [prctl(PR_SET_DUMPABLE, 1) can be used]) +fi +AC_MSG_RESULT($linux_prctl) + # Only build client code? AC_ARG_WITH(server, [ --without-server Only build the client.],