#At file:///home/bzr/bugs/b57108-5.5-bugteam/ based on revid:davi.arnaut@stripped
3258 Mats Kindahl 2010-10-21
BUG#57108: mysqld crashes when I attempt to install plugin
If a relative path is supplied to option --defaults-file or
--defaults-extra-file, the server will crash when executing
an INSTALL PLUGIN command. The reason is that the defaults
file is initially read relative the current working directory
when the server is started, but when INSTALL PLUGIN is executed,
the server has changed working directory to the data directory.
The value given to --defaults-file and --defaults-extra-file
have to be an absolute path, so this patch fixes the problem by
adding a check that the path given to these options indeed is
an absolute path, and throw an error and abort the start
otherwise.
modified:
mysys/default.c
=== modified file 'mysys/default.c'
--- a/mysys/default.c 2010-07-23 20:17:55 +0000
+++ b/mysys/default.c 2010-10-21 19:15:31 +0000
@@ -190,10 +190,25 @@ int my_search_option_files(const char *c
my_defaults_group_suffix= getenv(STRINGIFY_ARG(DEFAULT_GROUP_SUFFIX_ENV));
if (forced_extra_defaults)
+ {
+ /* Only absolute path names allowed */
+ if (!test_if_hard_path(forced_extra_defaults))
+ {
+ fprintf(stderr, "Path to option --defaults-extra-file have to be absolute\n");
+ goto err;
+ }
my_defaults_extra_file= (char *) forced_extra_defaults;
+ }
- if (forced_default_file)
+ if (forced_default_file) {
+ /* Only absolute path names allowed */
+ if (!test_if_hard_path(forced_default_file))
+ {
+ fprintf(stderr, "Path to option --defaults-file have to be absolute\n");
+ goto err;
+ }
my_defaults_file= forced_default_file;
+ }
/*
We can only handle 'defaults-group-suffix' if we are called from
Attachment: [text/bzr-bundle] bzr/mats.kindahl@oracle.com-20101021191531-8ebpqc6vun6k8wjp.bundle