|
1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | | -<!-- EN-Revision: cc1fd3979ee4c308ca9c086583c4d0e45549d3fe Maintainer: Fan2Shrek Status: ready --> |
| 2 | +<!-- EN-Revision: 9c40251a81d8f369c184e83fd142c4cc656a7261 Maintainer: Fan2Shrek Status: ready --> |
3 | 3 | <!-- Reviewed: yes --> |
4 | 4 | <chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="reference.luasandbox.differences"> |
5 | 5 | <title>Différences avec Lua standard</title> |
6 | | - <para> |
| 6 | + <simpara> |
7 | 7 | LuaSandbox fournit un environnement sécurisé qui diffère de certaines manières de Lua 5.1 standard. |
8 | | - </para> |
| 8 | + </simpara> |
9 | 9 |
|
10 | 10 | <simplesect xml:id="reference.luasandbox.differences.unavailable"> |
11 | 11 | <title>Fonctionnalités non disponibles</title> |
12 | 12 | <itemizedlist> |
13 | 13 | <listitem> |
14 | | - <para> |
| 14 | + <simpara> |
15 | 15 | Les packages <literal>dofile()</literal>, <literal>loadfile()</literal>, et <literal>io</literal>, car ils permettent un accès direct au système de fichiers. Si nécessaire, l'accès au système de fichiers doit être effectué via des fonctions de rappels PHP. |
16 | | - </para> |
| 16 | + </simpara> |
17 | 17 | </listitem> |
18 | 18 | <listitem> |
19 | | - <para> |
| 19 | + <simpara> |
20 | 20 | Le package <literal>package</literal>, y compris <literal>require()</literal> et <literal>module()</literal>, car il dépend fortement de l'accès direct au système de fichiers. Une réécriture pure Lua telle que celle utilisée dans l'extension MediaWiki Scribunto peut être utilisée à la place. |
21 | | - </para> |
| 21 | + </simpara> |
22 | 22 | </listitem> |
23 | 23 | <listitem> |
24 | | - <para> |
| 24 | + <simpara> |
25 | 25 | <literal>load()</literal> et <literal>loadstring()</literal>, pour permettre l'analyse statique du code Lua. |
26 | | - </para> |
| 26 | + </simpara> |
27 | 27 | </listitem> |
28 | 28 | <listitem> |
29 | | - <para> |
| 29 | + <simpara> |
30 | 30 | <literal>print()</literal>, depuis qu'il écrit sur la sortie standard. Si nécessaire, la sortie doit être effectuée via des fonction de rappels PHP. |
31 | | - </para> |
| 31 | + </simpara> |
32 | 32 | </listitem> |
33 | 33 | <listitem> |
34 | | - <para> |
| 34 | + <simpara> |
35 | 35 | La plupart du package <literal>os</literal>, car il permet la manipulation du processus et l'exécution d'autres processus. |
36 | | - </para> |
| 36 | + </simpara> |
37 | 37 | <itemizedlist> |
38 | 38 | <listitem> |
39 | | - <para> |
| 39 | + <simpara> |
40 | 40 | <literal>os.clock()</literal>, <literal>os.date()</literal>, <literal>os.difftime()</literal>, et <literal>os.time()</literal> reste disponibles. |
41 | | - </para> |
| 41 | + </simpara> |
42 | 42 | </listitem> |
43 | 43 | </itemizedlist> |
44 | 44 | </listitem> |
45 | 45 | <listitem> |
46 | | - <para> |
| 46 | + <simpara> |
47 | 47 | La plupart du package <literal>debug</literal>, car il permet la manipulation de l'état Lua et des métadonnées de manière à pouvoir casser l'isolation. |
48 | | - </para> |
| 48 | + </simpara> |
49 | 49 | <itemizedlist> |
50 | 50 | <listitem> |
51 | | - <para> |
| 51 | + <simpara> |
52 | 52 | <literal>debug.traceback()</literal> reste disponibles. |
53 | | - </para> |
| 53 | + </simpara> |
54 | 54 | </listitem> |
55 | 55 | </itemizedlist> |
56 | 56 | </listitem> |
57 | 57 | <listitem> |
58 | | - <para> |
| 58 | + <simpara> |
59 | 59 | <literal>string.dump()</literal>, car il peut exposer des données internes. |
60 | | - </para> |
| 60 | + </simpara> |
61 | 61 | </listitem> |
62 | 62 | <listitem> |
63 | | - <para> |
| 63 | + <simpara> |
64 | 64 | Le package <literal>collectgarbage()</literal>, <literal>gcinfo()</literal>, et <literal>coroutine</literal> n'ont pas été examinés pour la sécurité. |
65 | | - </para> |
| 65 | + </simpara> |
66 | 66 | </listitem> |
67 | 67 | </itemizedlist> |
68 | 68 | </simplesect> |
|
71 | 71 | <title>Features that have been modified</title> |
72 | 72 | <itemizedlist> |
73 | 73 | <listitem> |
74 | | - <para> |
| 74 | + <simpara> |
75 | 75 | <literal>pcall()</literal> et <literal>xpcall()</literal> ne peuvent pas attraper certaines erreurs, en particulier les erreurs de délai d'attente. |
76 | | - </para> |
| 76 | + </simpara> |
77 | 77 | </listitem> |
78 | 78 | <listitem> |
79 | | - <para> |
| 79 | + <simpara> |
80 | 80 | <literal>tostring()</literal> n'inclut pas les adresses de pointeur. |
81 | | - </para> |
| 81 | + </simpara> |
82 | 82 | </listitem> |
83 | 83 | <listitem> |
84 | | - <para> |
| 84 | + <simpara> |
85 | 85 | <literal>string.match()</literal> a été patché pour limiter la profondeur de récursion et pour vérifier périodiquement un délai d'attente. |
86 | | - </para> |
| 86 | + </simpara> |
87 | 87 | </listitem> |
88 | 88 | <listitem> |
89 | | - <para> |
| 89 | + <simpara> |
90 | 90 | <literal>math.random()</literal> et <literal>math.randomseed()</literal> sont remplacés par des versions qui ne partagent pas l'état avec <literal>rand()</literal> de PHP. |
91 | | - </para> |
| 91 | + </simpara> |
92 | 92 | </listitem> |
93 | 93 | <listitem> |
94 | | - <para> |
| 94 | + <simpara> |
95 | 95 | Les méta méthodes de Lua 5.2 <literal>__pairs</literal> et <literal>__ipairs</literal> sont supportées par <literal>pairs()</literal> et <literal>ipairs()</literal>. |
96 | | - </para> |
| 96 | + </simpara> |
97 | 97 | </listitem> |
98 | 98 | </itemizedlist> |
99 | 99 | </simplesect> |
|
0 commit comments