diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2004-06-04 15:26:54 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2004-06-04 15:26:54 +0000 |
commit | f9cec029c84bc8817495a8523dbd9375f01f4c73 (patch) | |
tree | fd37c5db9ec5027dc40c9b37cfd07e6f441f02bf | |
parent | a37ffd814d9b22bbc203670dad4e4469cccadd0b (diff) | |
download | php-git-f9cec029c84bc8817495a8523dbd9375f01f4c73.tar.gz |
Fixed bug #28632 (Prevent open_basedir bypass in MySQL's LOAD DATA LOCAL).
-rw-r--r-- | ext/mysql/php_mysql.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index 093a2723ea..11dae41632 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -598,6 +598,11 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) WRONG_PARAM_COUNT; break; } + /* disable local infile option for open_basedir */ + if (PG(open_basedir) && strlen(PG(open_basedir)) && (client_flags & CLIENT_LOCAL_FILES)) { + client_flags ^= CLIENT_LOCAL_FILES; + } + if (z_host) { SEPARATE_ZVAL(z_host); /* We may modify z_host if it contains a port, separate */ convert_to_string_ex(z_host); |