Commit 693fee5d authored by Georgi Kodinov's avatar Georgi Kodinov

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 
parent 10afe099
...@@ -873,10 +873,6 @@ sub command_line_setup () { ...@@ -873,10 +873,6 @@ sub command_line_setup () {
last; last;
} }
} }
# point vardir to the mem location
$opt_vardir= $opt_mem;
undef $opt_mem;
} }
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
......
...@@ -193,12 +193,6 @@ select * from t1; ...@@ -193,12 +193,6 @@ select * from t1;
a b c a b c
10 NULL Ten 10 NULL Ten
15 NULL Fifteen 15 NULL Fifteen
show variables like "secure_file_pri%";
Variable_name Value
secure_file_priv MYSQLTEST_VARDIR/
select @@secure_file_priv;
@@secure_file_priv
MYSQLTEST_VARDIR/
set @@secure_file_priv= 0; set @@secure_file_priv= 0;
ERROR HY000: Variable 'secure_file_priv' is a read only variable ERROR HY000: Variable 'secure_file_priv' is a read only variable
truncate table t1; truncate table t1;
......
...@@ -149,10 +149,16 @@ select * from t1; ...@@ -149,10 +149,16 @@ select * from t1;
# #
# It should not be possible to load from a file outside of vardir # It should not be possible to load from a file outside of vardir
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR # The following lines were disabled because of patch for
show variables like "secure_file_pri%"; # bug 50373. MYSQLTEST_VARDIR doesn't rewrite symlinks
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR # to real paths, but this is done for secure_file_priv.
select @@secure_file_priv; # Because of this the result can't be replaced if the
# test suite runs with the --mem option which creates
# symlinks to the ramdisk.
#--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
#show variables like "secure_file_pri%";
#--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
#select @@secure_file_priv;
--error 1238 --error 1238
set @@secure_file_priv= 0; set @@secure_file_priv= 0;
......
...@@ -7974,9 +7974,23 @@ static void fix_paths(void) ...@@ -7974,9 +7974,23 @@ static void fix_paths(void)
*/ */
if (opt_secure_file_priv) if (opt_secure_file_priv)
{ {
convert_dirname(buff, opt_secure_file_priv, NullS); if (*opt_secure_file_priv == 0)
my_free(opt_secure_file_priv, MYF(0)); {
opt_secure_file_priv= my_strdup(buff, MYF(MY_FAE)); 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;
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment