slawek Wed Jan 2 02:16:12 2002 EDT Modified files: /phpdoc/pl/features safe-mode.xml Log: Typo fixed.
Index: phpdoc/pl/features/safe-mode.xml diff -u phpdoc/pl/features/safe-mode.xml:1.9 phpdoc/pl/features/safe-mode.xml:1.10 --- phpdoc/pl/features/safe-mode.xml:1.9 Sat Dec 22 13:13:30 2001 +++ phpdoc/pl/features/safe-mode.xml Wed Jan 2 02:16:11 2002 @@ -1,311 +1,311 @@ -<?xml version="1.0" encoding="iso-8859-2"?> -<!-- EN-Revision: 1.18 Maintainer: slawek Status: ready --> -<!-- $Revision: 1.9 $ --> - <chapter id="features.safe-mode"> - <title>Tryb bezpieczny</title> - - <para> - Tryb bezpieczny (safe mode) jest próbą rozwiązania problemów - bezpieczeństwa na współdzielnym serwerze. Co prawda rozwiązywanie ich na - poziomie PHP nie jest najlepszym rozwiązaniem, ale jeśli nie ma możliwości - zrobienia tego na poziomie serwera www lub systemu operacyjnego, na wielu - serwerach, zwłaszcza u usługodawców internetowych, używa się trybu - bezpiecznego. - </para> - <para> - Dykertywy konfiguracyjne odpowiadające za tryb bezpieczny: - <programlisting role="ini"> -<![CDATA[ -safe_mode = Off -open_basedir = -safe_mode_exec_dir = -safe_mode_allowed_env_vars = PHP_ -safe_mode_protected_env_vars = LD_LIBRARY_PATH -disable_functions = -]]> - </programlisting> - </para> - <para> - Gdy opcja <link linkend="ini.safe-mode">safe_mode</link> jest włączona, - PHP sprawdza czy właścicielem pliku na którym na którym funkcja chce - operować i właścicielem uruchamianego skryptu jest ten sam użytkownik. - Na przykład: - <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> - Uruchomienie script.php - <programlisting role="php"> -<![CDATA[ -<?php - readfile('/etc/passwd'); -?> -]]> - </programlisting> - z uruchomionym trybem bezpiecznym spowoduje wyświetlenie błędu: - <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> - Jeśli zamiast włączać opcję <link linkend="ini.safe-mode">safe_mode</link> - ustawisz katalog <link linkend="ini.open-basedir">open_basedir</link>, - wtedy wszystkie operacje plikowe bedą ograniczone do tego katalogu. Na - przykład (dla httpd.conf Apache'a): - <programlisting role="ini"> -<![CDATA[ -<Directory /docroot> -php_admin_value open_basedir /docroot -</Directory> -]]> - </programlisting> - Uruchomienie tego samego skryptu script.php z ustawionym katalogiem - <link linkend="ini.open-basedir">open_basedir</link> spowoduje wyświetlenie: - <screen> -<![CDATA[ -Warning: open_basedir restriction in effect. File is in wrong directory in -/docroot/script.php on line 2 -]]> - </screen> - </para> - <para> - Możesz także wyłączyć pojedyncze funkcje. Jeśli do pliku php.ini dodasz: - <programlisting role="ini"> -<![CDATA[ -disable_functions readfile,system -]]> - </programlisting> - po uruchomieniu skryptu otrzymasz: - <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>Funkcje ograniczone/wyłączone w trybie bezpiecznym</title> - <para> - Jest to najprawdopodobniej wciąż niekompletna lista funkcji ograniczonych - przez <link linkend="features.safe-mode">tryb bezpieczny</link>. - <!-- TODO: add ¬e.sm.*; to the functions mentioned here. - That entity should link to this section --> - <table> - <title>Funkcje ograniczone w trybie bezpiecznym</title> - <tgroup cols="2"> - <thead> - <row> - <entry>Funkcja</entry> - <entry>Ograniczenia</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>Podlega ograniczeniom narzuconym przez sql_safe_mode, - (!= tryb bezpieczny)</entry> - <!-- TODO: more info on sql-safe-mode --> - </row> - <row> - <entry><function>ingres_*</function></entry> - <entry>Podlega ograniczeniom narzuconym przez sql_safe_mode, - (!= tryb bezpieczny)</entry> - <!-- TODO: more info on sql-safe-mode --> - </row> - <row> - <entry><function>mysql_*</function></entry> - <entry>Podlega ograniczeniom narzuconym przez sql_safe_mode, - (!= tryb bezpieczny)</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>Podlega dyrektywom safe_mode_protected_env_vars i - safe_mode_allowed_env_vars w php.ini. Zobacz również dokumantację - do <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">lewy apostrof</link></entry> - <entry>&sm.disabled;</entry> - </row> - <row> - <entry><function>shell_exec</function> (funkcja równoważna z - lewym apostrofem)</entry> - <entry>&sm.disabled;</entry> - </row> - <row> - <entry><function>exec</function></entry> - <entry>Możesz uruchamiać programy jedynie z katalogu zdefiniowanego - dyrektywą - <link linkend="ini.safe-mode-exec-dir">safe_mode_exec_dir</link>. - Ze względów praktycznych obecnie nie ma możliwości stosowania - <literal>..</literal> w ścieżce do programu.</entry> - </row> - <row> - <entry><function>system</function></entry> - <entry>Można uruchamiać programy jedynie z katalogu zdefiniowanego - dyrektywą - <link linkend="ini.safe-mode-exec-dir">safe_mode_exec_dir</link>. - Ze względów praktycznych obecnie nie ma możliwości stosowania - <literal>..</literal> w ścieżce do programu.</entry> - </row> - <row> - <entry><function>passthru</function></entry> - <entry>Można uruchamiać programy jedynie z katalogu zdefiniowanego - dyrektywą - <link linkend="ini.safe-mode-exec-dir">safe_mode_exec_dir</link>. - Ze względów praktycznych obecnie nie ma możliwości stosowania - <literal>..</literal> w ścieżce do programu.</entry> - </row> - <row> - <entry><function>popen</function></entry> - <entry>Można uruchamiać programy jedynie z katalogu zdefiniowanego - dyrektywą - <link linkend="ini.safe-mode-exec-dir">safe_mode_exec_dir</link>. - Ze względów praktycznych obecnie nie ma możliwości stosowania - <literal>..</literal> w ścieżce do programu.</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; (dla - <parameter>źródła</parameter> i - <parameter>przeznaczenia</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; Dodatkowo, nie można ustawić bitów SUID, SGID - i sticky bit.</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; (sprawdzany jest jedynie element - do którego tworzony jest link)</entry> - </row> - <row> - <entry><function>link</function></entry> - <entry>&sm.uidcheck; &sm.uidcheck.dir; (sprawdzany jest jedynie element - do którego tworzony jest link)</entry> - </row> - <row> - <entry><function>getallheaders</function></entry> - <entry> - W tybie bezpiecznym, nagłowki zaczynające się od 'authorization' - (wielkość liter bez znaczenia) nie będą zwracane. Uwaga: w - implementacji dla serwera AOL ta funkcjonalność jest uszkodzona - </entry> - </row> - <row> - <entry>Każda funkcja korzystająca z - <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 ---> +<?xml version="1.0" encoding="iso-8859-2"?> +<!-- EN-Revision: 1.18 Maintainer: slawek Status: ready --> +<!-- $Revision: 1.10 $ --> + <chapter id="features.safe-mode"> + <title>Tryb bezpieczny</title> + + <para> + Tryb bezpieczny (safe mode) jest próbą rozwiązania problemów + bezpieczeństwa na współdzielnym serwerze. Co prawda rozwiązywanie ich na + poziomie PHP nie jest najlepszym rozwiązaniem, ale jeśli nie ma możliwości + zrobienia tego na poziomie serwera www lub systemu operacyjnego, na wielu + serwerach, zwłaszcza u usługodawców internetowych, używa się trybu + bezpiecznego. + </para> + <para> + Dyrektywy konfiguracyjne odpowiadające za tryb bezpieczny: + <programlisting role="ini"> +<![CDATA[ +safe_mode = Off +open_basedir = +safe_mode_exec_dir = +safe_mode_allowed_env_vars = PHP_ +safe_mode_protected_env_vars = LD_LIBRARY_PATH +disable_functions = +]]> + </programlisting> + </para> + <para> + Gdy opcja <link linkend="ini.safe-mode">safe_mode</link> jest włączona, + PHP sprawdza czy właścicielem pliku na którym na którym funkcja chce + operować i właścicielem uruchamianego skryptu jest ten sam użytkownik. + Na przykład: + <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> + Uruchomienie script.php + <programlisting role="php"> +<![CDATA[ +<?php + readfile('/etc/passwd'); +?> +]]> + </programlisting> + z uruchomionym trybem bezpiecznym spowoduje wyświetlenie błędu: + <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> + Jeśli zamiast włączać opcję <link linkend="ini.safe-mode">safe_mode</link> + ustawisz katalog <link linkend="ini.open-basedir">open_basedir</link>, + wtedy wszystkie operacje plikowe bedą ograniczone do tego katalogu. Na + przykład (dla httpd.conf Apache'a): + <programlisting role="ini"> +<![CDATA[ +<Directory /docroot> +php_admin_value open_basedir /docroot +</Directory> +]]> + </programlisting> + Uruchomienie tego samego skryptu script.php z ustawionym katalogiem + <link linkend="ini.open-basedir">open_basedir</link> spowoduje wyświetlenie: + <screen> +<![CDATA[ +Warning: open_basedir restriction in effect. File is in wrong directory in +/docroot/script.php on line 2 +]]> + </screen> + </para> + <para> + Możesz także wyłączyć pojedyncze funkcje. Jeśli do pliku php.ini dodasz: + <programlisting role="ini"> +<![CDATA[ +disable_functions readfile,system +]]> + </programlisting> + po uruchomieniu skryptu otrzymasz: + <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>Funkcje ograniczone/wyłączone w trybie bezpiecznym</title> + <para> + Jest to najprawdopodobniej wciąż niekompletna lista funkcji ograniczonych + przez <link linkend="features.safe-mode">tryb bezpieczny</link>. + <!-- TODO: add ¬e.sm.*; to the functions mentioned here. + That entity should link to this section --> + <table> + <title>Funkcje ograniczone w trybie bezpiecznym</title> + <tgroup cols="2"> + <thead> + <row> + <entry>Funkcja</entry> + <entry>Ograniczenia</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>Podlega ograniczeniom narzuconym przez sql_safe_mode, + (!= tryb bezpieczny)</entry> + <!-- TODO: more info on sql-safe-mode --> + </row> + <row> + <entry><function>ingres_*</function></entry> + <entry>Podlega ograniczeniom narzuconym przez sql_safe_mode, + (!= tryb bezpieczny)</entry> + <!-- TODO: more info on sql-safe-mode --> + </row> + <row> + <entry><function>mysql_*</function></entry> + <entry>Podlega ograniczeniom narzuconym przez sql_safe_mode, + (!= tryb bezpieczny)</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>Podlega dyrektywom safe_mode_protected_env_vars i + safe_mode_allowed_env_vars w php.ini. Zobacz również dokumantację + do <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">lewy +apostrof</link></entry> + <entry>&sm.disabled;</entry> + </row> + <row> + <entry><function>shell_exec</function> (funkcja równoważna z + lewym apostrofem)</entry> + <entry>&sm.disabled;</entry> + </row> + <row> + <entry><function>exec</function></entry> + <entry>Możesz uruchamiać programy jedynie z katalogu zdefiniowanego + dyrektywą + <link linkend="ini.safe-mode-exec-dir">safe_mode_exec_dir</link>. + Ze względów praktycznych obecnie nie ma możliwości stosowania + <literal>..</literal> w ścieżce do programu.</entry> + </row> + <row> + <entry><function>system</function></entry> + <entry>Można uruchamiać programy jedynie z katalogu zdefiniowanego + dyrektywą + <link linkend="ini.safe-mode-exec-dir">safe_mode_exec_dir</link>. + Ze względów praktycznych obecnie nie ma możliwości stosowania + <literal>..</literal> w ścieżce do programu.</entry> + </row> + <row> + <entry><function>passthru</function></entry> + <entry>Można uruchamiać programy jedynie z katalogu zdefiniowanego + dyrektywą + <link linkend="ini.safe-mode-exec-dir">safe_mode_exec_dir</link>. + Ze względów praktycznych obecnie nie ma możliwości stosowania + <literal>..</literal> w ścieżce do programu.</entry> + </row> + <row> + <entry><function>popen</function></entry> + <entry>Można uruchamiać programy jedynie z katalogu zdefiniowanego + dyrektywą + <link linkend="ini.safe-mode-exec-dir">safe_mode_exec_dir</link>. + Ze względów praktycznych obecnie nie ma możliwości stosowania + <literal>..</literal> w ścieżce do programu.</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; (dla + <parameter>źródła</parameter> i + <parameter>przeznaczenia</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; Dodatkowo, nie można ustawić bitów SUID, SGID + i sticky bit.</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; (sprawdzany jest jedynie element + do którego tworzony jest link)</entry> + </row> + <row> + <entry><function>link</function></entry> + <entry>&sm.uidcheck; &sm.uidcheck.dir; (sprawdzany jest jedynie element + do którego tworzony jest link)</entry> + </row> + <row> + <entry><function>getallheaders</function></entry> + <entry> + W tybie bezpiecznym, nagłowki zaczynające się od 'authorization' + (wielkość liter bez znaczenia) nie będą zwracane. Uwaga: w + implementacji dla serwera AOL ta funkcjonalność jest uszkodzona + </entry> + </row> + <row> + <entry>Każda funkcja korzystająca z + <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 +-->