summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2011-05-05 12:10:49 +0300
committerGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2011-05-05 12:10:49 +0300
commit858cf12f898a96540b59f1695486a2014dc3440b (patch)
tree1a7f3b90ff8556d1ee05839807594eb207606a0c /sql
parent93f62d51a896d819cc2956efe10a71bc77a60c69 (diff)
downloadmariadb-git-858cf12f898a96540b59f1695486a2014dc3440b.tar.gz
Addendum 3 for bug #BUG#11764517 : expand secure_file_priv to the real
patch so that it can later be compared with patchs with expanded symlinks
Diffstat (limited to 'sql')
-rw-r--r--sql/mysqld.cc20
1 files changed, 17 insertions, 3 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 3291085f380..caeac5be100 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -7974,9 +7974,23 @@ static void fix_paths(void)
*/
if (opt_secure_file_priv)
{
- convert_dirname(buff, opt_secure_file_priv, NullS);
- my_free(opt_secure_file_priv, MYF(0));
- opt_secure_file_priv= my_strdup(buff, MYF(MY_FAE));
+ if (*opt_secure_file_priv == 0)
+ {
+ opt_secure_file_priv= 0;
+ }
+ else
+ {
+ if (strlen(opt_secure_file_priv) >= FN_REFLEN)
+ opt_secure_file_priv[FN_REFLEN-1]= '\0';
+ if (my_realpath(buff, opt_secure_file_priv, 0))
+ {
+ sql_print_warning("Failed to normalize the argument for --secure-file-priv.");
+ exit(1);
+ }
+ char *secure_file_real_path= (char *)my_malloc(FN_REFLEN, MYF(MY_FAE));
+ convert_dirname(secure_file_real_path, buff, NullS); my_free(opt_secure_file_priv, MYF(0));
+ opt_secure_file_priv= secure_file_real_path;
+ }
}
}