summaryrefslogtreecommitdiff
path: root/mysys/mf_pack.c
diff options
context:
space:
mode:
authorDmitry Shulga <Dmitry.Shulga@oracle.com>2011-06-15 16:18:08 +0700
committerDmitry Shulga <Dmitry.Shulga@oracle.com>2011-06-15 16:18:08 +0700
commit44ed935b212d67d35c937037ff649f548737e0bc (patch)
treeec4c5e59d1aa0dcdd10060b12f62388812fb321c /mysys/mf_pack.c
parentd5d2c4fa741f57ff40dbf886ef613626a2638ed9 (diff)
downloadmariadb-git-44ed935b212d67d35c937037ff649f548737e0bc.tar.gz
Fixed bug#12403662 (formerly known as bug#60987): LOAD DATA LOCAL INFILE
can't parse relative paths "higher" than 3 levels up When trying to LOAD DATA LOCAL INFILE using a relative path with 3 or more levels up in the directory hierarchy, mysqld wrongly parses the path and as a consequence, can't find the file. This bug was introduced by patch for bug#58205. The reason for bug is that implementaiton of function cleanup_dirname() doesn't take into account the begin of buffer being processed during handling of path to file. mysys/mf_pack.c: function cleanup_dirname() was modified: fixed wrong comparison condition when handling substring "../" at the begining of the buffer.
Diffstat (limited to 'mysys/mf_pack.c')
-rw-r--r--mysys/mf_pack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mysys/mf_pack.c b/mysys/mf_pack.c
index 292cd8c0454..790936461a4 100644
--- a/mysys/mf_pack.c
+++ b/mysys/mf_pack.c
@@ -193,7 +193,7 @@ size_t cleanup_dirname(register char *to, const char *from)
while (pos >= start && *pos != FN_LIBCHAR) /* remove prev dir */
pos--;
if (pos[1] == FN_HOMELIB ||
- (pos > start && memcmp(pos, parent, length) == 0))
+ (pos >= start && memcmp(pos, parent, length) == 0))
{ /* Don't remove ~user/ */
pos=strmov(end_parentdir+1,parent);
*pos=FN_LIBCHAR;