summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Kuruvila <arun.kuruvila@oracle.com>2013-09-02 14:53:45 +0530
committerArun Kuruvila <arun.kuruvila@oracle.com>2013-09-02 14:53:45 +0530
commit5b333350a8f439d1456ef485e06a74e14ceaa19b (patch)
treedee880d6162c374d6f8dc1afedd0ece09765f058
parentb8c9a8a3d35b5558890ec9d8ba77565b3d76d841 (diff)
downloadmariadb-git-5b333350a8f439d1456ef485e06a74e14ceaa19b.tar.gz
Bug #17168602 MYSQL_PLUGIN REMOVES NON-DIRECTORY TYPE FILES
SPECIFIED WITH THE BASEDIR OPTION Description: The mysql_plugin client attempts to remove any filename specified to the --basedir option. The problem is that if the filename does not end with a slash, it will attempt to unlink it, which succeeds for files, but not for directories. Analysis: When we are starting mysql_plugin with basedir option and if we are giving path of a file as basedir, it deletes that file. It was because it uses a function my_delete which unlinks the file path given. Fix: As a fix we replace that line using another function my_free, which will only free the pointer which is having that file path.
-rw-r--r--client/mysql_plugin.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/client/mysql_plugin.c b/client/mysql_plugin.c
index 72bab3ad528..7fbfeb9e9a6 100644
--- a/client/mysql_plugin.c
+++ b/client/mysql_plugin.c
@@ -856,7 +856,7 @@ static int process_options(int argc, char *argv[], char *operation)
strncat(buff, FN_DIRSEP, sizeof(buff) - strlen(buff) - 1);
#endif
buff[sizeof(buff) - 1]= 0;
- my_delete(opt_basedir, MYF(0));
+ my_free(opt_basedir);
opt_basedir= my_strdup(buff, MYF(MY_FAE));
}
}