rafael          Sun Jun  2 16:31:13 2002 EDT

  Added files:                 
    /phpdoc-es/features safe-mode.xml 
  Log:
  Translation updated to PHP 4.x
  
  

Index: phpdoc-es/features/safe-mode.xml
+++ phpdoc-es/features/safe-mode.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<!-- EN-Revision: 1.25 Maintainer: manuelf Status: ready -->
 <chapter id="features.safe-mode">
  <title>Modo Seguro (Safe Mode)</title>

  <para>
   El Modo Seguro de PHP es un intento para resolver el problema de la seguridad
   en un servidor compartido. Tratar de resolver este problema al nivel de PHP es
   arquitect&oacute;nicamente incorrecto, pero ya que las alternativas en un servidor 
web
   y a niveles de sistemas operativos no son tan realistas, mucha gente, 
   especialmente la de proveedores de Internet (ISP), usa el Modo Seguro por ahora.
  </para>
  <para>
   <table>
    <title>Las directivas de Configuraci&oacute;n que controlan el Modo Seguro 
son:</title>
    <tgroup cols="2">
     <thead>
      <row>
       <entry>Directiva</entry>
       <entry>Valor por Omisi&oacute;n</entry>
      </row>
     </thead>
     <tbody>
      <row>
       <entry>
        <link linkend="ini.safe-mode">safe_mode</link>
       </entry>
       <entry><literal>Off</literal></entry>
      </row>
      <row>
       <entry>
        <link linkend="ini.safe-mode-gid">safe_mode_gid</link>
       </entry>
       <entry><literal>0</literal></entry>
      </row>
      <row>
       <entry>
        <link linkend="ini.safe-mode-include-dir">safe_mode_include_dir</link>
       </entry>
       <entry><literal>""</literal></entry>
      </row>
      <row>
       <entry>
        <link linkend="ini.safe-mode-exec-dir">safe_mode_exec_dir</link>
       </entry>
       <entry><literal>1</literal></entry>
      </row>
      <row>
       <entry>
        <link linkend="ini.open-basedir">open_basedir</link>
       </entry>
       <entry><literal>""</literal></entry>
      </row>
      <row>
       <entry>
        <literal>safe_mode_allowed_env_vars</literal>
       </entry>
       <entry><literal>PHP_</literal></entry>
      </row>
      <row>
       <entry>
        <literal>safe_mode_protected_env_vars</literal>
       </entry>
       <entry><literal>LD_LIBRARY_PATH</literal></entry>
      </row>
      <row>
       <entry>
        <literal>disable_functions</literal>
       </entry>
       <entry><literal>""</literal></entry>
      </row>
     </tbody>
    </tgroup>
   </table>
  </para>
  <para>
   Cuando <link linkend="ini.safe-mode">safe_mode</link> est&aacute; en On, el PHP 
verifica
   si el due�o del script actual coincide con el due�o del fichero a ser operado por
   una funci&oacute;n de fichero. Por ejemplo:
   <programlisting role="ls">
<![CDATA[
-rw-rw-r--    1 rasmus   rasmus       33 Jul  1 19:20 script.php 
-rw-r--r--    1 root     root       1116 May 26 18:01 /etc/passwd 
]]>
   </programlisting>
   Corriendo este script.php 
   <programlisting role="php">
<![CDATA[
<?php
 readfile('/etc/passwd'); 
?>
]]>
   </programlisting>
   resulta in este error cuando Modo Seguro est&aacute; habilitado: 
   <screen>
<![CDATA[
Warning: SAFE MODE Restriction in effect. The script whose uid is 500 is not 
allowed to access /etc/passwd owned by uid 0 in /docroot/script.php on line 2
]]>
   </screen>
  </para>
  <para>
   Sin embargo, pueden haber ambientes donde una estricta verificaci&oacute;n del
   <literal>UID</literal> no es apropiada, y una relajada verificaci&oacute;n del
   <literal>GID</literal> es suficiente. Esto es soportado por medio
   del switch <link linkend="ini.safe-mode-gid">safe_mode_gid</link>. 
   Sete&aacute;ndolo a <literal>On</literal> hace la verificaci&oacute;n relajada
   <literal>GID</literal>, sete&aacute;ndolo a <literal>Off</literal> (el valor
   por omisi&oacute;n) hace la verificaci&oacute;n del <literal>UID</literal>.
  </para>
  <para>
   Si en vez del <link linkend="ini.safe-mode">safe_mode</link>, Ud. setea
   un directorio <link linkend="ini.open-basedir">open_basedir</link>, 
   entonces todas las operaciones de fichero estar&aacute;n limitadas a los ficheros
   bajo ese directorio especificado.
   Por ejemplo (ejemplo de httpd.conf de Apache):
   <programlisting role="ini">
<![CDATA[
<Directory /docroot>
  php_admin_value open_basedir /docroot 
</Directory>
]]>
   </programlisting>
   Si Ud. corre el mismo script.php con este seteo
   <link linkend="ini.open-basedir">open_basedir</link>,
   entonces este es el resultado: 
   <screen>
<![CDATA[
Warning: open_basedir restriction in effect. File is in wrong directory in 
/docroot/script.php on line 2 
]]>
   </screen>
  </para>
  <para>
   Ud. tambi&eacute;n puede inhabilitar funciones individuales. Note que la directiva 
   disable_functions no puede ser usada fuera del fichero &php.ini; lo que significa
   que Ud. no puede inhabilitar funciones en los principios per-virtualhost o
   per-directory en su fichero httpd.conf.
   Si agregamos esto a nuestro fichero &php.ini;:
   <programlisting role="ini">
<![CDATA[
disable_functions readfile,system  
]]>
   </programlisting>
   Entonces obtenemos esta salida: 
   <screen>
<![CDATA[
Warning: readfile() has been disabled for security reasons in 
/docroot/script.php on line 2 
]]>
   </screen>
  </para>

  <sect1 id="features.safe-mode.functions">
   <title>Funciones restringidas/inhabilitadas por Modo Seguro</title>
   <para>
    Esta es una lista probablemente incompleta y posiblemente incorrecta
    de las funciones limitadas por <link linkend="features.safe-mode">safe 
    mode</link>.
    <!-- TODO: add &note.sm.*; to the functions mentioned here.
    That entity should link to this section -->
    <table>
     <title>Funciones limitadas por Modo Seguro</title>
     <tgroup cols="2">
      <thead>
       <row>
        <entry>Funci&oacute;n</entry>
        <entry>Limitaciones</entry>
       </row>
      </thead>
      <tbody>
       <row>
        <entry><function>dbmopen</function></entry>
        <entry>&sm.uidcheck;</entry>
       </row>
       <row>
        <entry><function>dbase_open</function></entry>
        <entry>&sm.uidcheck;</entry>
       </row>
       <row>
        <entry><function>filepro</function></entry>
        <entry>&sm.uidcheck;</entry>
       </row>
       <row>
        <entry><function>filepro_rowcount</function></entry>
        <entry>&sm.uidcheck;</entry>
       </row>
       <row>
        <entry><function>filepro_retrieve</function></entry>
        <entry>&sm.uidcheck;</entry>
       </row>
       <row>
        <entry><function>ifx_*</function></entry>
        <entry>restricciones sql_safe_mode, (!= safe mode)</entry>
        <!-- TODO: more info on sql-safe-mode -->
       </row>
       <row>
        <entry><function>ingres_*</function></entry>
        <entry>restricciones sql_safe_mode, (!= safe mode)</entry>
        <!-- TODO: more info on sql-safe-mode -->
       </row>
       <row>
        <entry><function>mysql_*</function></entry>
        <entry>restricciones sql_safe_mode, (!= safe mode)</entry>
        <!-- TODO: more info on sql-safe-mode -->
       </row>
       <row>
        <entry><function>pg_loimport</function></entry>
        <entry>&sm.uidcheck;</entry>
        <!-- source TODO: there is no PHP-warning for that safe-mode-restriction -->
       </row>
       <row>
        <entry><function>posix_mkfifo</function></entry>
        <entry>&sm.uidcheck.dir;</entry>
       </row>
       <row>
        <entry><function>putenv</function></entry>
        <entry>Obecede las ini-directivas safe_mode_protected_env_vars y 
        safe_mode_allowed_env_vars. Vea tambi&eacute;n la documentaci&oacute;n
        de <function>putenv</function></entry>
        <!-- TODO: document those directives in chapters/config.xml -->
       </row>
       <row>
        <entry><function>move_uploaded_file</function></entry>
        <entry>&sm.uidcheck; <!-- TODO: check this --></entry>
       </row>

       <!-- TODO: from here on, add warning to the function itself -->

       <row>
        <entry><function>chdir</function></entry>
        <entry>&sm.uidcheck.dir;</entry>
       </row>
       <row>
        <entry><function>dl</function></entry>
        <entry>&sm.disabled;</entry>
       </row>
       <row>
        <entry><link linkend="language.operators.execution">backtick 
operator</link></entry>
        <entry>&sm.disabled;</entry>
       </row>
       <row>
        <entry><function>shell_exec</function> (equivalencia funcional de 
        backticks)</entry>
        <entry>&sm.disabled;</entry>
       </row>
       <row>
        <entry><function>exec</function></entry>
        <entry>Ud. puede correr s&oacute;lo ejecutables dentro del<link 
        linkend="ini.safe-mode-exec-dir">safe_mode_exec_dir</link>.
        Por razones pr&aacute;cticas, no est&aacute; actualmente permitido tener
        componentes <literal>..</literal> en la ruta del fichero
        ejecutable.</entry>
       </row>
       <row>
        <entry><function>system</function></entry>
        <entry>Ud. puede correr s&oacute;lo ejecutatables dentro del<link 
        linkend="ini.safe-mode-exec-dir">safe_mode_exec_dir</link>.
        Por razones pr&aacute;cticas, no est&aacute; actualmente permitido tener
        componentes <literal>..</literal> en la ruta del fichero
        ejecutable.</entry>
       </row>
       <row>
        <entry><function>passthru</function></entry>
        <entry>Ud. puede correr s&oacute;lo ejecutatables dentro del<link 
        linkend="ini.safe-mode-exec-dir">safe_mode_exec_dir</link>.
        Por razones pr&aacute;cticas, no est&aacute; actualmente permitido tener
        componentes <literal>..</literal> en la ruta del fichero
        ejecutable.</entry>
       </row>
       <row>
        <entry><function>popen</function></entry>
        <entry>Ud. puede correr s&oacute;lo ejecutatables dentro del<link 
        linkend="ini.safe-mode-exec-dir">safe_mode_exec_dir</link>.
        Por razones pr&aacute;cticas, no est&aacute; actualmente permitido tener
        componentes <literal>..</literal> en la ruta del fichero 
        ejecutable.</entry>
        <!-- TODO: not sure. popen uses a completely different implementation
        Don't know why, don't know whether it's behaving the same -->
       </row>
       <row>
        <entry><function>mkdir</function></entry>
        <entry>&sm.uidcheck.dir;</entry>
       </row>
       <row>
        <entry><function>rmdir</function></entry>
        <entry>&sm.uidcheck;</entry>
       </row>
       <row>
        <entry><function>rename</function></entry>
        <entry>&sm.uidcheck; &sm.uidcheck.dir;<!-- on the old name only, it seems. Is 
rename preventing moving files? --></entry>
       </row>
       <row>
        <entry><function>unlink</function></entry>
        <entry>&sm.uidcheck; &sm.uidcheck.dir;</entry>
       </row>
       <row>
        <entry><function>copy</function></entry>
        <entry>&sm.uidcheck; &sm.uidcheck.dir; (en 
        <parameter>source</parameter> y 
        <parameter>target</parameter>) </entry>
       </row>
       <row>
        <entry><function>chgrp</function></entry>
        <entry>&sm.uidcheck;</entry>
       </row>
       <row>
        <entry><function>chown</function></entry>
        <entry>&sm.uidcheck;</entry>
       </row>
       <row>
        <entry><function>chmod</function></entry>
        <entry>&sm.uidcheck; Adem&aacute;s, Ud. no puede setear  
        los bits de SUID, SGID y sticky</entry>
       </row>
       <row>
        <entry><function>touch</function></entry>
        <entry>&sm.uidcheck; &sm.uidcheck.dir;</entry>
       </row>
       <row>
        <entry><function>symlink</function></entry>
        <entry>&sm.uidcheck; &sm.uidcheck.dir; (Nota: s&oacute;lo el target es 
        comprobado)</entry>
       </row>
       <row>
        <entry><function>link</function></entry>
        <entry>&sm.uidcheck; &sm.uidcheck.dir; (Nota: s&oacute;lo the target es
        comprobado)</entry>
       </row>
       <row>
        <entry><function>getallheaders</function></entry>
        <entry>En Modo Seguro, las cabeceras que empiezan con 'authorization' 
        (insensitivo al tipo de letra)
        no ser&aacute;n retornadas. Advertencia: esto est&aacute; roto por la 
implementaci&oacute;n 
        de aol-server de <function>getallheaders</function>!</entry>
       </row>
        <row>
        <entry><function>header</function></entry>
        <entry>En Modo Seguro, el UID del script est&aacute; agregado a la
        parte <literal>realm</literal> de la cabecera 
        <literal>WWW-Authenticate</literal> si Ud. setea esta
        cabecera (usado por HTTP Authentication).</entry>
       </row>
       <row>
        <entry>
         <function>highlight_file</function>,
         <function>show_source</function>
        </entry>
        <entry>
         &sm.uidcheck; &sm.uidcheck.dir; (Nota: s&oacute;lo afectado desde PHP 4.2.1)
        </entry>
       </row>
       <row>
        <entry>
         <function>parse_ini_file</function>
        </entry>
        <entry>
         &sm.uidcheck; &sm.uidcheck.dir; (Nota: s&oacute;lo afectado desde PHP 4.2.1)
        </entry>
       </row>
       <row>
        <entry>Cualquier funci&oacute;n que usa 
         <filename>php4/main/fopen_wrappers.c</filename>
        </entry>
        <entry>??</entry>
       </row>
      </tbody>
     </tgroup>
    </table>
   </para>
  </sect1>

 </chapter>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->


Reply via email to