Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
3051d8bb
Commit
3051d8bb
authored
May 14, 2002
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Corrected fix for DROP DATABASE on symbolic link
parent
f876e01f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
13 deletions
+14
-13
sql/sql_db.cc
sql/sql_db.cc
+14
-13
No files found.
sql/sql_db.cc
View file @
3051d8bb
...
...
@@ -271,20 +271,20 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *org_path,
*/
if
(
!
found_other_files
)
{
char
tmp_path
[
FN_REFLEN
],
lnk_path
[
FN_REFLEN
]
;
char
tmp_path
[
FN_REFLEN
],
*
pos
;
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
int
error
;
/* Remove end FN_LIBCHAR as this causes problem on Linux in readlink */
pos
=
strend
(
path
);
if
(
pos
>
path
&&
pos
[
-
1
]
==
FN_LIBCHAR
)
*--
pos
=
0
;
if
((
error
=
my_readlink
(
filePath
,
path
,
MYF
(
MY_WME
)))
<
0
)
DBUG_RETURN
(
-
1
);
if
(
!
error
)
{
*
(
filePath
+
linkcount
)
=
'\0'
;
if
(
my_delete
(
path
,
MYF
(
!
level
?
MY_WME
:
0
)))
{
/* Don't give errors if we can't delete 'RAID' directory */
...
...
@@ -293,11 +293,12 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *org_path,
send_error
(
&
thd
->
net
);
DBUG_RETURN
(
-
1
);
}
path
=
filePath
;
/* Delete directory symbolic link pointed at */
path
=
filePath
;
}
#endif
/* Remove last FN_LIBCHAR to not cause a probelm on OS/2 */
char
*
pos
=
strend
(
path
);
pos
=
strend
(
path
);
if
(
pos
>
path
&&
pos
[
-
1
]
==
FN_LIBCHAR
)
*--
pos
=
0
;
/* Don't give errors if we can't delete 'RAID' directory */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment