diff options
author | unknown <Sinisa@sinisa.nasamreza.org> | 2002-05-14 14:42:03 +0300 |
---|---|---|
committer | unknown <Sinisa@sinisa.nasamreza.org> | 2002-05-14 14:42:03 +0300 |
commit | f876e01f9d7c92d3dd61dbaaf708789442cc07e1 (patch) | |
tree | 46c4316089560990a5fe4b53a2d6e165836bec63 /sql | |
parent | 716ed1168f280cd75df310ca80d85b58339b10ef (diff) | |
download | mariadb-git-f876e01f9d7c92d3dd61dbaaf708789442cc07e1.tar.gz |
DROP DATABASE with symlinks did not work before
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_db.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 1e798a392b1..372dff85007 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -271,9 +271,16 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *org_path, */ if (!found_other_files) { - char tmp_path[FN_REFLEN]; + char tmp_path[FN_REFLEN], lnk_path[FN_REFLEN]; char *path=unpack_filename(tmp_path,org_path); #ifdef HAVE_READLINK + if (path[0] == FN_CURLIB) + { + int length = (strxmov(lnk_path,curr_dir,path + 2, NullS) - lnk_path) - 1; + path=lnk_path; + if (path[length] == FN_LIBCHAR) + path[length]='\0'; + } int linkcount = readlink(path,filePath,sizeof(filePath)-1); if (linkcount > 0) // If the path was a symbolic link { |