From a6384b368561386ab4a04eab5573fdcdb7b92c4c Mon Sep 17 00:00:00 2001 From: Yasuo Ohgaki Date: Wed, 17 Jul 2002 05:01:58 +0000 Subject: [PATCH] Added safe_mode & open_basedir checks for pg_lo_export() @Added safe_mode & open_basedir checks for pg_lo_export() (Yasuo) --- ext/pgsql/pgsql.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 7979b114267..5eb5f90685b 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -2091,6 +2091,14 @@ PHP_FUNCTION(pg_lo_export) RETURN_FALSE; } + if (PG(safe_mode) &&(!php_checkuid(file_in, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { + RETURN_FALSE; + } + + if (php_check_open_basedir(file_in TSRMLS_CC)) { + RETURN_FALSE; + } + ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); if (lo_export(pgsql, oid, file_out)) {