diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-08-08 10:27:22 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-08-08 21:27:30 +0200 |
commit | 2a54a530a9ba96a9a57607dd156a42192dae0873 (patch) | |
tree | b5b1085239672cf007d2021014e99f76e2237989 /sql/sys_vars.cc | |
parent | a7c43a684ac390636f2859dfe5cf65fb4be8f75b (diff) | |
download | mariadb-git-2a54a530a9ba96a9a57607dd156a42192dae0873.tar.gz |
MDEV-10465 general_log_file can be abused
followup
Diffstat (limited to 'sql/sys_vars.cc')
-rw-r--r-- | sql/sys_vars.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 2ed5be3bf3b..7d43984c9c0 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -3033,19 +3033,19 @@ static bool check_log_path(sys_var *self, THD *thd, set_var *var) return true; } - static const LEX_CSTRING my_cnf= { STRING_WITH_LEN("my.cnf") }; - if (val->length >= my_cnf.length) - { - if (strcasecmp(val->str + val->length - my_cnf.length, my_cnf.str) == 0) - return true; // log file name ends with "my.cnf" - } - char path[FN_REFLEN]; size_t path_length= unpack_filename(path, val->str); if (!path_length) return true; + static const LEX_CSTRING my_cnf= { STRING_WITH_LEN("my.cnf") }; + if (path_length >= my_cnf.length) + { + if (strcasecmp(path + path_length - my_cnf.length, my_cnf.str) == 0) + return true; // log file name ends with "my.cnf" + } + MY_STAT f_stat; if (my_stat(path, &f_stat, MYF(0))) |