Fixed bug #68077 (LOAD DATA LOCAL INFILE / open_basedir restriction)

Actually, this only be fixed if php uses mysqlnd
This commit is contained in:
Xinchen Hui 2015-11-16 16:58:19 +08:00
parent e5abc53701
commit be6fd4ba89
8 changed files with 94 additions and 10 deletions

View file

@ -799,6 +799,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
passwd_len = passwd? strlen(passwd):0;
}
#if !defined(MYSQL_USE_MYSQLND)
/* disable local infile option for open_basedir */
#if PHP_API_VERSION < 20100412
if (((PG(open_basedir) && PG(open_basedir)[0] != '\0') || PG(safe_mode)) && (client_flags & CLIENT_LOCAL_FILES)) {
@ -807,6 +808,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
#endif
client_flags ^= CLIENT_LOCAL_FILES;
}
#endif
#ifdef CLIENT_MULTI_RESULTS
client_flags |= CLIENT_MULTI_RESULTS; /* compatibility with 5.2, see bug#50416 */