summaryrefslogtreecommitdiff
path: root/ext/oci8/oci8.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/oci8/oci8.c')
-rw-r--r--ext/oci8/oci8.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index 5fb8f9ff7e..051e177c1d 100644
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -1012,6 +1012,16 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Privileged connect is disabled. Enable oci8.privileged_connect to be able to connect as SYSOPER or SYSDBA");
return NULL;
}
+ /* Disable privileged connections in Safe Mode (N.b. safe mode has been removed in PHP 6 anyway) */
+ if (PG(safe_mode)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Privileged connect is disabled in Safe Mode");
+ return NULL;
+ }
+ /* Increase security by not caching privileged
+ * oci_pconnect() connections. The connection becomes
+ * equivalent to oci_connect() or oci_new_connect().
+ */
+ persistent = 0;
break;
default:
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid session mode specified (%ld)", session_mode);