From 77912fb35c22a505a2602c400a6b41584ed71d88 Mon Sep 17 00:00:00 2001 From: Jeroen van Wolffelaar Date: Tue, 31 Jul 2001 22:28:30 +0000 Subject: [PATCH] - More correct safe-mode documentation - Partially added warnings to the functions themselves - Small xml-id fix in cybermut git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@52878 c90b9560-bf6c-de11-be94-00142212c4b1 --- features/safe-mode.xml | 116 +++++++++++++++++++++++---------------- functions/cybermut.xml | 6 +- functions/dbase.xml | 1 + functions/dbm.xml | 1 + functions/filepro.xml | 3 + functions/filesystem.xml | 2 + functions/info.xml | 5 ++ functions/pgsql.xml | 1 + functions/posix.xml | 1 + 9 files changed, 87 insertions(+), 49 deletions(-) diff --git a/features/safe-mode.xml b/features/safe-mode.xml index 22f6adf0aa..deef2fbd0c 100644 --- a/features/safe-mode.xml +++ b/features/safe-mode.xml @@ -1,4 +1,4 @@ - + Safe mode @@ -107,20 +107,24 @@ Warning: readfile() has been disabled for security reasons in &sm.uidcheck; - imap_thread - ?? + ifx_* + sql_safe_mode restrictions, (!= safe-mode) + - ifxus_tell_slob - ?? + ingres_* + sql_safe_mode restrictions, (!= safe-mode) + - muscat_close - ?? + mysql_* + sql_safe_mode restrictions, (!= safe-mode) + pg_loimport &sm.uidcheck; + posix_mkfifo @@ -128,27 +132,64 @@ Warning: readfile() has been disabled for security reasons in putenv - ?? + Obeys the safe_mode_protected_env_vars and + safe_mode_allowed_env_vars ini-directives. See also the documentation + on putenv + move_uploaded_file - &sm.uidcheck; + &sm.uidcheck; + + + chdir &sm.uidcheck.dir; dl - ?? + &sm.disabled; - shell_exec - ?? + backtick operator + &sm.disabled; + + + shell_exec (functional equivalent + of backticks) + &sm.disabled; + + + exec + You can only execute executables within the safe_mode_exec_dir. + For practical reasons it's currently not allowed to have + .. components in the path to the executable. + + + system + You can only execute executables within the safe_mode_exec_dir. + For practical reasons it's currently not allowed to have + .. components in the path to the executable. + + + passthru + You can only execute executables within the safe_mode_exec_dir. + For practical reasons it's currently not allowed to have + .. components in the path to the executable. popen - &sm.uidcheck.dir; + You can only execute executables within the safe_mode_exec_dir. + For practical reasons it's currently not allowed to have + .. components in the path to the executable. + mkdir @@ -160,15 +201,17 @@ Warning: readfile() has been disabled for security reasons in rename - &sm.uidcheck; + &sm.uidcheck; &sm.uidcheck.dir; unlink - &sm.uidcheck; + &sm.uidcheck; &sm.uidcheck.dir; copy - &sm.uidcheck; + &sm.uidcheck; &sm.uidcheck.dir; (on + source and + target) chgrp @@ -180,48 +223,29 @@ Warning: readfile() has been disabled for security reasons in chmod - &sm.uidcheck; + &sm.uidcheck; In addition, you cannot + set the SUID, SGID and sticky bits touch - &sm.uidcheck; + &sm.uidcheck; &sm.uidcheck.dir; symlink - &sm.uidcheck; + &sm.uidcheck; &sm.uidcheck.dir; (note: only the target is + checked) link - &sm.uidcheck; - - - ob_gzhandler - &sm.uidcheck; + &sm.uidcheck; &sm.uidcheck.dir; (note: only the target is + checked) getallheaders - ?? - - - exec - ?? - - - system - ?? - - - passthru - ?? - - - mail - ?? - - - backtick operator - ?? + In safe-mode, headers beginning with 'authorization' + (case-insensitive) + will not be returned. Warning: this is broken with the aol-server + implementation of getallheaders! Any function that uses diff --git a/functions/cybermut.xml b/functions/cybermut.xml index 7725ef2e53..83cfb20567 100755 --- a/functions/cybermut.xml +++ b/functions/cybermut.xml @@ -40,7 +40,7 @@ - + cybermut_creerformulairecm Generate HTML form of request for payment @@ -104,7 +104,7 @@ $VERSION="1.2"; - + cybermut_testmac @@ -177,7 +177,7 @@ if ($mac_ok) { - + cybermut_creerreponsecm diff --git a/functions/dbase.xml b/functions/dbase.xml index 00a0f110ec..a0711b7983 100644 --- a/functions/dbase.xml +++ b/functions/dbase.xml @@ -147,6 +147,7 @@ if (!dbase_create($dbname, $def)) Returns a dbase_identifier for the opened database, or &false; if the database couldn't be opened. + ¬e.sm.uidcheck; diff --git a/functions/dbm.xml b/functions/dbm.xml index 7d6f76ebb1..0d992b87f2 100644 --- a/functions/dbm.xml +++ b/functions/dbm.xml @@ -67,6 +67,7 @@ dbmclose ($dbm); information on DBM files, see your Unix man pages, or obtain GNU's GDBM. + ¬e.sm.uidcheck; diff --git a/functions/filepro.xml b/functions/filepro.xml index fa4eaf433f..93347275d7 100644 --- a/functions/filepro.xml +++ b/functions/filepro.xml @@ -29,6 +29,7 @@ No locking is done, so you should avoid modifying your filePro database while it may be opened in PHP. + ¬e.sm.uidcheck; @@ -102,6 +103,7 @@ Returns the data from the specified location in the database. + ¬e.sm.uidcheck; @@ -141,6 +143,7 @@ Returns the number of rows in the opened filePro database. + ¬e.sm.uidcheck; See also filepro. diff --git a/functions/filesystem.xml b/functions/filesystem.xml index 306c3937e9..b4946e4e35 100644 --- a/functions/filesystem.xml +++ b/functions/filesystem.xml @@ -2136,6 +2136,8 @@ mkdir ("/path/to/my/dir", 0700); system. + ¬e.sm.uidcheck; + See also is_uploaded_file, and the section Handling file uploads diff --git a/functions/info.xml b/functions/info.xml index 12e19891cb..b7c4e74495 100644 --- a/functions/info.xml +++ b/functions/info.xml @@ -1332,6 +1332,11 @@ if (substr(php_uname(), 0, 7) == "Windows") { These variables will be protected even if safe_mode_allowed_env_vars is set to allow to change them. + + + These directives have only effect when safe-mode itself is enabled! + + Setting an Environment Variable diff --git a/functions/pgsql.xml b/functions/pgsql.xml index f934bea382..06e882172c 100644 --- a/functions/pgsql.xml +++ b/functions/pgsql.xml @@ -907,6 +907,7 @@ for ($i=0; $i<$num; $i++) { object otherwise. Remember that handling large objects in PostgreSQL must happen inside a transaction. + ¬e.sm.uidcheck; diff --git a/functions/posix.xml b/functions/posix.xml index 0222aee17e..cd24da5565 100644 --- a/functions/posix.xml +++ b/functions/posix.xml @@ -578,6 +578,7 @@ Needs to be written ASAP. + ¬e.sm.uidcheck.dir;