Below is the list of changes that have just been committed into a local
5.0 repository of cmiller. When cmiller does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-06-14 14:24:59-04:00, cmiller@stripped +2 -0
Bug#21723: Should be able to dump core after setuid() under Linux
In many cases, binaries can no longer dump core after calling setuid().
Where the PR_SET_DUMPABLE macro is set, use the prctl() system call
to tell the kernel that it's allowed to dump the core of the server.
configure.in@stripped, 2007-06-14 14:24:57-04:00, cmiller@stripped +1 -0
Test system for "sys/prctl.h", to get access to prctl().
sql/mysqld.cc@stripped, 2007-06-14 14:24:57-04:00, cmiller@stripped +12 -0
Add a process-control operation that tells the Linux kernel that it
is allowed to dump core after setuid().
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: cmiller
# Host: zippy.cornsilk.net
# Root: /home/cmiller/work/mysql/mysql-5.0-maint--bug21723
--- 1.444/configure.in 2007-05-08 18:19:34 -04:00
+++ 1.445/configure.in 2007-06-14 14:24:57 -04:00
@@ -776,6 +776,7 @@ AC_CHECK_HEADERS(fcntl.h float.h floatin
sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \
unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h \
sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h linux/config.h \
+ sys/prctl.h \
sys/resource.h sys/param.h)
#--------------------------------------------------------------------
--- 1.609/sql/mysqld.cc 2007-05-02 08:25:09 -04:00
+++ 1.610/sql/mysqld.cc 2007-06-14 14:24:57 -04:00
@@ -32,6 +32,9 @@
#ifdef HAVE_NDBCLUSTER_DB
#include "ha_ndbcluster.h"
#endif
+#ifdef HAVE_SYS_PRCTL_H
+#include <sys/prctl.h>
+#endif
#ifdef HAVE_INNOBASE_DB
#define OPT_INNODB_DEFAULT 1
@@ -1365,6 +1368,15 @@ static struct passwd *check_user(const c
err:
sql_print_error("Fatal error: Can't change to run as user '%s' ; Please check that the
user exists!\n",user);
unireg_abort(1);
+
+#ifdef PR_SET_DUMPABLE
+ if (test_flags & TEST_CORE_ON_SIGNAL)
+ {
+ /* inform kernel that process is dumpable */
+ (void) prctl(PR_SET_DUMPABLE, 1);
+ }
+#endif
+
#endif
return NULL;
}
| Thread |
|---|
| • bk commit into 5.0 tree (cmiller:1.2479) BUG#21723 | Chad MILLER | 14 Jun |