cvs: php4(PHP_4_2_0) /ext/mysql config.m4 /ext/mysql/libmysql libmysql.c
| From: | Jason Greene | Date: | Thu, 07 Mar 2002 20:39:55 +0000 |
| Subject: | cvs: php4(PHP_4_2_0) /ext/mysql config.m4 /ext/mysql/libmysql libmysql.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-9801@lists.php.net to get a copy of this message | ||
jason Thu Mar 7 15:39:55 2002 EDT
Modified files: (Branch: PHP_4_2_0)
/php4/ext/mysql config.m4
/php4/ext/mysql/libmysql libmysql.c
Log:
Disallow mysql's 'LOAD LOCAL' when safe mode is enabled
Index: php4/ext/mysql/config.m4
diff -u php4/ext/mysql/config.m4:1.38 php4/ext/mysql/config.m4:1.38.2.1
--- php4/ext/mysql/config.m4:1.38 Fri Nov 30 13:59:45 2001
+++ php4/ext/mysql/config.m4 Thu Mar 7 15:39:55 2002
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.38 2001/11/30 18:59:45 sniper Exp $
+dnl $Id: config.m4,v 1.38.2.1 2002/03/07 20:39:55 jason Exp $
dnl
sinclude(ext/mysql/libmysql/acinclude.m4)
@@ -41,6 +41,9 @@
if test "$PHP_MYSQL" != "no"; then
AC_DEFINE(HAVE_MYSQL, 1, [Whether you have MySQL])
+ if test "$PHP_SAFE_MODE" = "yes"; then
+ AC_DEFINE(DISALLOW_MYSQL_LOAD_LOCAL, 1, [Whether to disable load local])
+ fi
PHP_EXTENSION(mysql,$ext_shared)
fi
Index: php4/ext/mysql/libmysql/libmysql.c
diff -u php4/ext/mysql/libmysql/libmysql.c:1.9 php4/ext/mysql/libmysql/libmysql.c:1.9.2.1
--- php4/ext/mysql/libmysql/libmysql.c:1.9 Tue Nov 6 11:59:07 2001
+++ php4/ext/mysql/libmysql/libmysql.c Thu Mar 7 15:39:55 2002
@@ -50,7 +50,11 @@
uint mysql_port=0;
my_string mysql_unix_port=0;
+#ifndef DISALLOW_MYSQL_LOAD_LOCAL
#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_LOCAL_FILES |
CLIENT_TRANSACTIONS)
+#else
+#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_TRANSACTIONS)
+#endif
#ifdef __WIN__
#define CONNECT_TIMEOUT 20