home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / python / pytex / pytexdoc / lib2 / restricted / tex
LaTeX Document  |  1996-11-08  |  3.6 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: LaTeX Document (document/latex).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file LaTeX document text default
99% file LaTeX document, ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 63 68 61 70 74 65 72 | 7b 52 65 73 74 72 69 63 |\chapter|{Restric|
|00000010| 74 65 64 20 45 78 65 63 | 75 74 69 6f 6e 7d 0a 0a |ted Exec|ution}..|
|00000020| 49 6e 20 67 65 6e 65 72 | 61 6c 2c 20 50 79 74 68 |In gener|al, Pyth|
|00000030| 6f 6e 20 70 72 6f 67 72 | 61 6d 73 20 68 61 76 65 |on progr|ams have|
|00000040| 20 63 6f 6d 70 6c 65 74 | 65 20 61 63 63 65 73 73 | complet|e access|
|00000050| 20 74 6f 20 74 68 65 20 | 75 6e 64 65 72 6c 79 69 | to the |underlyi|
|00000060| 6e 67 0a 6f 70 65 72 61 | 74 69 6e 67 20 73 79 73 |ng.opera|ting sys|
|00000070| 74 65 6d 20 74 68 72 6f | 75 67 20 74 68 65 20 76 |tem thro|ug the v|
|00000080| 61 72 69 6f 75 73 20 66 | 75 6e 63 74 69 6f 6e 73 |arious f|unctions|
|00000090| 20 61 6e 64 20 63 6c 61 | 73 73 65 73 2c 20 46 6f | and cla|sses, Fo|
|000000a0| 72 0a 65 78 61 6d 70 6c | 65 2c 20 61 20 50 79 74 |r.exampl|e, a Pyt|
|000000b0| 68 6f 6e 20 70 72 6f 67 | 72 61 6d 20 63 61 6e 20 |hon prog|ram can |
|000000c0| 6f 70 65 6e 20 61 6e 79 | 20 66 69 6c 65 20 66 6f |open any| file fo|
|000000d0| 72 20 72 65 61 64 69 6e | 67 20 61 6e 64 20 77 72 |r readin|g and wr|
|000000e0| 69 74 69 6e 67 20 62 79 | 0a 75 73 69 6e 67 20 74 |iting by|.using t|
|000000f0| 68 65 20 5c 63 6f 64 65 | 7b 6f 70 65 6e 28 29 7d |he \code|{open()}|
|00000100| 20 62 75 69 6c 74 2d 69 | 6e 20 66 75 6e 63 74 69 | built-i|n functi|
|00000110| 6f 6e 20 28 70 72 6f 76 | 69 64 65 64 20 74 68 65 |on (prov|ided the|
|00000120| 20 75 6e 64 65 72 6c 79 | 69 6e 67 20 4f 53 0a 67 | underly|ing OS.g|
|00000130| 69 76 65 73 20 79 6f 75 | 20 70 65 72 6d 69 73 73 |ives you| permiss|
|00000140| 69 6f 6e 21 29 2e 20 20 | 54 68 69 73 20 69 73 20 |ion!). |This is |
|00000150| 65 78 61 63 74 6c 79 20 | 77 68 61 74 20 79 6f 75 |exactly |what you|
|00000160| 20 77 61 6e 74 20 66 6f | 72 20 6d 6f 73 74 0a 61 | want fo|r most.a|
|00000170| 70 70 6c 69 63 61 74 69 | 6f 6e 73 2e 0a 0a 54 68 |pplicati|ons...Th|
|00000180| 65 72 65 20 65 78 69 73 | 74 73 20 61 20 63 6c 61 |ere exis|ts a cla|
|00000190| 73 73 20 6f 66 20 61 70 | 70 6c 69 63 61 74 69 6f |ss of ap|plicatio|
|000001a0| 6e 73 20 66 6f 72 20 77 | 68 69 63 68 20 74 68 69 |ns for w|hich thi|
|000001b0| 73 20 60 60 6f 70 65 6e | 6e 65 73 73 27 27 20 69 |s ``open|ness'' i|
|000001c0| 73 0a 69 6e 61 70 70 72 | 6f 70 72 69 61 74 65 2e |s.inappr|opriate.|
|000001d0| 20 20 54 61 6b 65 20 47 | 72 61 69 6c 3a 20 61 20 | Take G|rail: a |
|000001e0| 77 65 62 20 62 72 6f 77 | 73 65 72 20 74 68 61 74 |web brow|ser that|
|000001f0| 20 61 63 63 65 70 74 73 | 20 60 60 61 70 70 6c 65 | accepts| ``apple|
|00000200| 74 73 27 27 2c 0a 73 6e | 69 70 70 65 74 73 20 6f |ts'',.sn|ippets o|
|00000210| 66 20 50 79 74 68 6f 6e | 20 63 6f 64 65 2c 20 66 |f Python| code, f|
|00000220| 72 6f 6d 20 61 6e 79 77 | 68 65 72 65 20 6f 6e 20 |rom anyw|here on |
|00000230| 74 68 65 20 49 6e 74 65 | 72 6e 65 74 20 66 6f 72 |the Inte|rnet for|
|00000240| 20 65 78 65 63 75 74 69 | 6f 6e 0a 6f 6e 20 74 68 | executi|on.on th|
|00000250| 65 20 6c 6f 63 61 6c 20 | 73 79 73 74 65 6d 2e 20 |e local |system. |
|00000260| 20 54 68 69 73 20 63 61 | 6e 20 62 65 20 75 73 65 | This ca|n be use|
|00000270| 64 20 74 6f 20 69 6d 70 | 72 6f 76 65 20 74 68 65 |d to imp|rove the|
|00000280| 20 75 73 65 72 20 69 6e | 74 65 72 66 61 63 65 0a | user in|terface.|
|00000290| 6f 66 20 66 6f 72 6d 73 | 2c 20 66 6f 72 20 69 6e |of forms|, for in|
|000002a0| 73 74 61 6e 63 65 2e 20 | 20 53 69 6e 63 65 20 74 |stance. | Since t|
|000002b0| 68 65 20 6f 72 69 67 69 | 6e 61 74 6f 72 20 6f 66 |he origi|nator of|
|000002c0| 20 74 68 65 20 63 6f 64 | 65 20 69 73 20 75 6e 6b | the cod|e is unk|
|000002d0| 6e 6f 77 6e 2c 0a 69 74 | 20 69 73 20 6f 62 76 69 |nown,.it| is obvi|
|000002e0| 6f 75 73 20 74 68 61 74 | 20 69 74 20 63 61 6e 6e |ous that| it cann|
|000002f0| 6f 74 20 62 65 20 74 72 | 75 73 74 65 64 20 77 69 |ot be tr|usted wi|
|00000300| 74 68 20 74 68 65 20 66 | 75 6c 6c 20 72 65 73 6f |th the f|ull reso|
|00000310| 75 72 63 65 73 20 6f 66 | 20 74 68 65 0a 6c 6f 63 |urces of| the.loc|
|00000320| 61 6c 20 6d 61 63 68 69 | 6e 65 2e 0a 0a 5c 65 6d |al machi|ne...\em|
|00000330| 70 68 7b 52 65 73 74 72 | 69 63 74 65 64 20 65 78 |ph{Restr|icted ex|
|00000340| 65 63 75 74 69 6f 6e 7d | 20 69 73 20 74 68 65 20 |ecution}| is the |
|00000350| 62 61 73 69 63 20 66 72 | 61 6d 65 77 6f 72 6b 20 |basic fr|amework |
|00000360| 69 6e 20 50 79 74 68 6f | 6e 20 74 68 61 74 20 61 |in Pytho|n that a|
|00000370| 6c 6c 6f 77 73 0a 66 6f | 72 20 74 68 65 20 73 65 |llows.fo|r the se|
|00000380| 67 72 65 67 61 74 69 6f | 6e 20 6f 66 20 74 72 75 |gregatio|n of tru|
|00000390| 73 74 65 64 20 61 6e 64 | 20 75 6e 74 72 75 73 74 |sted and| untrust|
|000003a0| 65 64 20 63 6f 64 65 2e | 20 20 49 74 20 69 73 20 |ed code.| It is |
|000003b0| 62 61 73 65 64 20 6f 6e | 20 74 68 65 0a 6e 6f 74 |based on| the.not|
|000003c0| 69 6f 6e 20 74 68 61 74 | 20 74 72 75 73 74 65 64 |ion that| trusted|
|000003d0| 20 50 79 74 68 6f 6e 20 | 63 6f 64 65 20 28 61 20 | Python |code (a |
|000003e0| 5c 65 6d 70 68 7b 73 75 | 70 65 72 76 69 73 6f 72 |\emph{su|pervisor|
|000003f0| 7d 29 20 63 61 6e 20 63 | 72 65 61 74 65 20 61 0a |}) can c|reate a.|
|00000400| 60 60 70 61 64 64 65 64 | 20 63 65 6c 6c 27 20 28 |``padded| cell' (|
|00000410| 6f 72 20 65 6e 76 69 72 | 6f 6e 6d 65 6e 74 29 20 |or envir|onment) |
|00000420| 77 69 74 68 20 6c 69 6d | 69 74 65 64 20 70 65 72 |with lim|ited per|
|00000430| 6d 69 73 73 69 6f 6e 73 | 2c 20 61 6e 64 20 72 75 |missions|, and ru|
|00000440| 6e 20 74 68 65 0a 75 6e | 74 72 75 73 74 65 64 20 |n the.un|trusted |
|00000450| 63 6f 64 65 20 77 69 74 | 68 69 6e 20 74 68 69 73 |code wit|hin this|
|00000460| 20 63 65 6c 6c 2e 20 20 | 54 68 65 20 75 6e 74 72 | cell. |The untr|
|00000470| 75 73 74 65 64 20 63 6f | 64 65 20 63 61 6e 6e 6f |usted co|de canno|
|00000480| 74 20 62 72 65 61 6b 20 | 6f 75 74 0a 6f 66 20 69 |t break |out.of i|
|00000490| 74 73 20 63 65 6c 6c 2c | 20 61 6e 64 20 63 61 6e |ts cell,| and can|
|000004a0| 20 6f 6e 6c 79 20 69 6e | 74 65 72 61 63 74 20 77 | only in|teract w|
|000004b0| 69 74 68 20 73 65 6e 73 | 69 74 69 76 65 20 73 79 |ith sens|itive sy|
|000004c0| 73 74 65 6d 20 72 65 73 | 6f 75 72 63 65 73 0a 74 |stem res|ources.t|
|000004d0| 68 72 6f 75 67 68 20 69 | 6e 74 65 72 66 61 63 65 |hrough i|nterface|
|000004e0| 73 20 64 65 66 69 6e 65 | 64 20 61 6e 64 20 6d 61 |s define|d and ma|
|000004f0| 6e 61 67 65 64 20 62 79 | 20 74 68 65 20 74 72 75 |naged by| the tru|
|00000500| 73 74 65 64 20 63 6f 64 | 65 2e 20 20 54 68 65 20 |sted cod|e. The |
|00000510| 74 65 72 6d 0a 60 60 72 | 65 73 74 72 69 63 74 65 |term.``r|estricte|
|00000520| 64 20 65 78 65 63 75 74 | 69 6f 6e 27 27 20 69 73 |d execut|ion'' is|
|00000530| 20 66 61 76 6f 72 65 64 | 20 6f 76 65 72 20 60 60 | favored| over ``|
|00000540| 73 61 66 65 2d 50 79 74 | 68 6f 6e 27 27 0a 73 69 |safe-Pyt|hon''.si|
|00000550| 6e 63 65 20 74 72 75 65 | 20 73 61 66 65 74 79 20 |nce true| safety |
|00000560| 69 73 20 68 61 72 64 20 | 74 6f 20 64 65 66 69 6e |is hard |to defin|
|00000570| 65 2c 20 61 6e 64 20 69 | 73 20 64 65 74 65 72 6d |e, and i|s determ|
|00000580| 69 6e 65 64 20 62 79 20 | 74 68 65 20 77 61 79 20 |ined by |the way |
|00000590| 74 68 65 0a 72 65 73 74 | 72 69 63 74 65 64 20 65 |the.rest|ricted e|
|000005a0| 6e 76 69 72 6f 6e 6d 65 | 6e 74 20 69 73 20 63 72 |nvironme|nt is cr|
|000005b0| 65 61 74 65 64 2e 20 20 | 4e 6f 74 65 20 74 68 61 |eated. |Note tha|
|000005c0| 74 20 74 68 65 20 72 65 | 73 74 72 69 63 74 65 64 |t the re|stricted|
|000005d0| 0a 65 6e 76 69 72 6f 6e | 6d 65 6e 74 73 20 63 61 |.environ|ments ca|
|000005e0| 6e 20 62 65 20 6e 65 73 | 74 65 64 2c 20 77 69 74 |n be nes|ted, wit|
|000005f0| 68 20 69 6e 6e 65 72 20 | 63 65 6c 6c 73 20 63 72 |h inner |cells cr|
|00000600| 65 61 74 69 6e 67 20 73 | 75 62 63 65 6c 6c 73 20 |eating s|ubcells |
|00000610| 6f 66 0a 6c 65 73 73 65 | 72 2c 20 62 75 74 20 6e |of.lesse|r, but n|
|00000620| 65 76 65 72 20 67 72 65 | 61 74 65 72 2c 20 70 72 |ever gre|ater, pr|
|00000630| 69 76 69 6c 65 67 65 2e | 0a 0a 41 6e 20 69 6e 74 |ivilege.|..An int|
|00000640| 65 72 65 73 74 69 6e 67 | 20 61 73 70 65 63 74 20 |eresting| aspect |
|00000650| 6f 66 20 50 79 74 68 6f | 6e 27 73 20 72 65 73 74 |of Pytho|n's rest|
|00000660| 72 69 63 74 65 64 20 65 | 78 65 63 75 74 69 6f 6e |ricted e|xecution|
|00000670| 20 6d 6f 64 65 6c 20 69 | 73 20 74 68 61 74 0a 74 | model i|s that.t|
|00000680| 68 65 20 69 6e 74 65 72 | 66 61 63 65 73 20 70 72 |he inter|faces pr|
|00000690| 65 73 65 6e 74 65 64 20 | 74 6f 20 75 6e 74 72 75 |esented |to untru|
|000006a0| 73 74 65 64 20 63 6f 64 | 65 20 75 73 75 61 6c 6c |sted cod|e usuall|
|000006b0| 79 20 68 61 76 65 20 74 | 68 65 20 73 61 6d 65 20 |y have t|he same |
|000006c0| 6e 61 6d 65 73 0a 61 73 | 20 74 68 6f 73 65 20 70 |names.as| those p|
|000006d0| 72 65 73 65 6e 74 65 64 | 20 74 6f 20 74 72 75 73 |resented| to trus|
|000006e0| 74 65 64 20 63 6f 64 65 | 2e 20 20 54 68 65 72 65 |ted code|. There|
|000006f0| 66 6f 72 65 20 6e 6f 20 | 73 70 65 63 69 61 6c 20 |fore no |special |
|00000700| 69 6e 74 65 72 66 61 63 | 65 73 0a 6e 65 65 64 20 |interfac|es.need |
|00000710| 74 6f 20 62 65 20 6c 65 | 61 72 6e 65 64 20 74 6f |to be le|arned to|
|00000720| 20 77 72 69 74 65 20 63 | 6f 64 65 20 64 65 73 69 | write c|ode desi|
|00000730| 67 6e 65 64 20 74 6f 20 | 72 75 6e 20 69 6e 20 61 |gned to |run in a|
|00000740| 20 72 65 73 74 72 69 63 | 74 65 64 0a 65 6e 76 69 | restric|ted.envi|
|00000750| 72 6f 6e 6d 65 6e 74 2e | 20 20 41 6e 64 20 62 65 |ronment.| And be|
|00000760| 63 61 75 73 65 20 74 68 | 65 20 65 78 61 63 74 20 |cause th|e exact |
|00000770| 6e 61 74 75 72 65 20 6f | 66 20 74 68 65 20 70 61 |nature o|f the pa|
|00000780| 64 64 65 64 20 63 65 6c | 6c 20 69 73 0a 64 65 74 |dded cel|l is.det|
|00000790| 65 72 6d 69 6e 65 64 20 | 62 79 20 74 68 65 20 73 |ermined |by the s|
|000007a0| 75 70 65 72 76 69 73 6f | 72 2c 20 64 69 66 66 65 |uperviso|r, diffe|
|000007b0| 72 65 6e 74 20 72 65 73 | 74 72 69 63 74 69 6f 6e |rent res|triction|
|000007c0| 73 20 63 61 6e 20 62 65 | 20 69 6d 70 6f 73 65 64 |s can be| imposed|
|000007d0| 2c 0a 64 65 70 65 6e 64 | 69 6e 67 20 6f 6e 20 74 |,.depend|ing on t|
|000007e0| 68 65 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 2e 20 |he appli|cation. |
|000007f0| 20 46 6f 72 20 65 78 61 | 6d 70 6c 65 2c 20 69 74 | For exa|mple, it|
|00000800| 20 6d 69 67 68 74 20 62 | 65 20 64 65 65 6d 65 64 | might b|e deemed|
|00000810| 0a 60 60 73 61 66 65 27 | 27 20 66 6f 72 20 75 6e |.``safe'|' for un|
|00000820| 74 72 75 73 74 65 64 20 | 63 6f 64 65 20 74 6f 20 |trusted |code to |
|00000830| 72 65 61 64 20 61 6e 79 | 20 66 69 6c 65 20 77 69 |read any| file wi|
|00000840| 74 68 69 6e 20 61 20 73 | 70 65 63 69 66 69 65 64 |thin a s|pecified|
|00000850| 0a 64 69 72 65 63 74 6f | 72 79 2c 20 62 75 74 20 |.directo|ry, but |
|00000860| 6e 65 76 65 72 20 74 6f | 20 77 72 69 74 65 20 61 |never to| write a|
|00000870| 20 66 69 6c 65 2e 20 20 | 49 6e 20 74 68 69 73 20 | file. |In this |
|00000880| 63 61 73 65 2c 20 74 68 | 65 20 73 75 70 65 72 76 |case, th|e superv|
|00000890| 69 73 6f 72 0a 6d 61 79 | 20 72 65 64 65 66 69 6e |isor.may| redefin|
|000008a0| 65 20 74 68 65 20 62 75 | 69 6c 74 2d 69 6e 0a 5c |e the bu|ilt-in.\|
|000008b0| 63 6f 64 65 7b 6f 70 65 | 6e 28 29 7d 20 66 75 6e |code{ope|n()} fun|
|000008c0| 63 74 69 6f 6e 20 73 6f | 20 74 68 61 74 20 69 74 |ction so| that it|
|000008d0| 20 72 61 69 73 65 73 20 | 61 6e 20 65 78 63 65 70 | raises |an excep|
|000008e0| 74 69 6f 6e 20 77 68 65 | 6e 65 76 65 72 20 74 68 |tion whe|never th|
|000008f0| 65 0a 5c 76 61 72 7b 6d | 6f 64 65 7d 20 70 61 72 |e.\var{m|ode} par|
|00000900| 61 6d 65 74 65 72 20 69 | 73 20 5c 63 6f 64 65 7b |ameter i|s \code{|
|00000910| 27 77 27 7d 2e 20 20 49 | 74 20 6d 69 67 68 74 20 |'w'}. I|t might |
|00000920| 61 6c 73 6f 20 70 65 72 | 66 6f 72 6d 20 61 0a 5c |also per|form a.\|
|00000930| 63 6f 64 65 7b 63 68 72 | 6f 6f 74 28 29 7d 2d 6c |code{chr|oot()}-l|
|00000940| 69 6b 65 20 6f 70 65 72 | 61 74 69 6f 6e 20 6f 6e |ike oper|ation on|
|00000950| 20 74 68 65 20 5c 76 61 | 72 7b 66 69 6c 65 6e 61 | the \va|r{filena|
|00000960| 6d 65 7d 20 70 61 72 61 | 6d 65 74 65 72 2c 20 73 |me} para|meter, s|
|00000970| 75 63 68 0a 74 68 61 74 | 20 72 6f 6f 74 20 69 73 |uch.that| root is|
|00000980| 20 61 6c 77 61 79 73 20 | 72 65 6c 61 74 69 76 65 | always |relative|
|00000990| 20 74 6f 20 73 6f 6d 65 | 20 73 61 66 65 20 60 60 | to some| safe ``|
|000009a0| 73 61 6e 64 62 6f 78 27 | 27 20 61 72 65 61 20 6f |sandbox'|' area o|
|000009b0| 66 20 74 68 65 0a 66 69 | 6c 65 73 79 73 74 65 6d |f the.fi|lesystem|
|000009c0| 2e 20 20 49 6e 20 74 68 | 69 73 20 63 61 73 65 2c |. In th|is case,|
|000009d0| 20 74 68 65 20 75 6e 74 | 72 75 73 74 65 64 20 63 | the unt|rusted c|
|000009e0| 6f 64 65 20 77 6f 75 6c | 64 20 73 74 69 6c 6c 20 |ode woul|d still |
|000009f0| 73 65 65 20 61 6e 0a 62 | 75 69 6c 74 2d 69 6e 20 |see an.b|uilt-in |
|00000a00| 5c 63 6f 64 65 7b 6f 70 | 65 6e 28 29 7d 20 66 75 |\code{op|en()} fu|
|00000a10| 6e 63 74 69 6f 6e 20 69 | 6e 20 69 74 73 20 65 6e |nction i|n its en|
|00000a20| 76 69 72 6f 6e 6d 65 6e | 74 2c 20 77 69 74 68 20 |vironmen|t, with |
|00000a30| 74 68 65 20 73 61 6d 65 | 0a 63 61 6c 6c 69 6e 67 |the same|.calling|
|00000a40| 20 69 6e 74 65 72 66 61 | 63 65 2e 20 20 54 68 65 | interfa|ce. The|
|00000a50| 20 73 65 6d 61 6e 74 69 | 63 73 20 77 6f 75 6c 64 | semanti|cs would|
|00000a60| 20 62 65 20 69 64 65 6e | 74 69 63 61 6c 20 74 6f | be iden|tical to|
|00000a70| 6f 2c 20 77 69 74 68 0a | 5c 63 6f 64 65 7b 49 4f |o, with.|\code{IO|
|00000a80| 45 72 72 6f 72 7d 73 20 | 62 65 69 6e 67 20 72 61 |Error}s |being ra|
|00000a90| 69 73 65 64 20 77 68 65 | 6e 20 74 68 65 20 73 75 |ised whe|n the su|
|00000aa0| 70 65 72 76 69 73 6f 72 | 20 64 65 74 65 72 6d 69 |pervisor| determi|
|00000ab0| 6e 65 64 20 74 68 61 74 | 20 61 6e 0a 75 6e 61 6c |ned that| an.unal|
|00000ac0| 6c 6f 77 61 62 6c 65 20 | 70 61 72 61 6d 65 74 65 |lowable |paramete|
|00000ad0| 72 20 69 73 20 62 65 69 | 6e 67 20 75 73 65 64 2e |r is bei|ng used.|
|00000ae0| 0a 0a 54 68 65 20 50 79 | 74 68 6f 6e 20 72 75 6e |..The Py|thon run|
|00000af0| 2d 74 69 6d 65 20 64 65 | 74 65 72 6d 69 6e 65 73 |-time de|termines|
|00000b00| 20 77 68 65 74 68 65 72 | 20 61 20 70 61 72 74 69 | whether| a parti|
|00000b10| 63 75 6c 61 72 20 63 6f | 64 65 20 62 6c 6f 63 6b |cular co|de block|
|00000b20| 20 69 73 0a 65 78 65 63 | 75 74 69 6e 67 20 69 6e | is.exec|uting in|
|00000b30| 20 72 65 73 74 72 69 63 | 74 65 64 20 65 78 65 63 | restric|ted exec|
|00000b40| 75 74 69 6f 6e 20 6d 6f | 64 65 20 62 61 73 65 64 |ution mo|de based|
|00000b50| 20 6f 6e 20 74 68 65 20 | 69 64 65 6e 74 69 74 79 | on the |identity|
|00000b60| 20 6f 66 20 74 68 65 0a | 5c 63 6f 64 65 7b 5f 5f | of the.|\code{__|
|00000b70| 62 75 69 6c 74 69 6e 73 | 5f 5f 7d 20 6f 62 6a 65 |builtins|__} obje|
|00000b80| 63 74 20 69 6e 20 69 74 | 73 20 67 6c 6f 62 61 6c |ct in it|s global|
|00000b90| 20 76 61 72 69 61 62 6c | 65 73 3a 20 69 66 20 74 | variabl|es: if t|
|00000ba0| 68 69 73 20 69 73 20 28 | 74 68 65 0a 64 69 63 74 |his is (|the.dict|
|00000bb0| 69 6f 6e 61 72 79 20 6f | 66 29 20 74 68 65 20 73 |ionary o|f) the s|
|00000bc0| 74 61 6e 64 61 72 64 20 | 5c 63 6f 64 65 7b 5f 5f |tandard |\code{__|
|00000bd0| 62 75 69 6c 74 69 6e 5f | 5f 7d 20 6d 6f 64 75 6c |builtin_|_} modul|
|00000be0| 65 2c 20 74 68 65 20 63 | 6f 64 65 20 69 73 0a 64 |e, the c|ode is.d|
|00000bf0| 65 65 6d 65 64 20 74 6f | 20 62 65 20 75 6e 72 65 |eemed to| be unre|
|00000c00| 73 74 72 69 63 74 65 64 | 2c 20 65 6c 73 65 20 69 |stricted|, else i|
|00000c10| 74 20 69 73 20 64 65 65 | 6d 65 64 20 74 6f 20 62 |t is dee|med to b|
|00000c20| 65 20 72 65 73 74 72 69 | 63 74 65 64 2e 0a 0a 50 |e restri|cted...P|
|00000c30| 79 74 68 6f 6e 20 63 6f | 64 65 20 65 78 65 63 75 |ython co|de execu|
|00000c40| 74 69 6e 67 20 69 6e 20 | 72 65 73 74 72 69 63 74 |ting in |restrict|
|00000c50| 65 64 20 6d 6f 64 65 20 | 66 61 63 65 73 20 61 20 |ed mode |faces a |
|00000c60| 6e 75 6d 62 65 72 20 6f | 66 20 6c 69 6d 69 74 61 |number o|f limita|
|00000c70| 74 69 6f 6e 73 0a 74 68 | 61 74 20 61 72 65 20 64 |tions.th|at are d|
|00000c80| 65 73 69 67 6e 65 64 20 | 74 6f 20 70 72 65 76 65 |esigned |to preve|
|00000c90| 6e 74 20 69 74 20 66 72 | 6f 6d 20 65 73 63 61 70 |nt it fr|om escap|
|00000ca0| 69 6e 67 20 66 72 6f 6d | 20 74 68 65 20 70 61 64 |ing from| the pad|
|00000cb0| 64 65 64 20 63 65 6c 6c | 2e 0a 46 6f 72 20 69 6e |ded cell|..For in|
|00000cc0| 73 74 61 6e 63 65 2c 20 | 74 68 65 20 66 75 6e 63 |stance, |the func|
|00000cd0| 74 69 6f 6e 20 6f 62 6a | 65 63 74 20 61 74 74 72 |tion obj|ect attr|
|00000ce0| 69 62 75 74 65 20 5c 63 | 6f 64 65 7b 66 75 6e 63 |ibute \c|ode{func|
|00000cf0| 5f 67 6c 6f 62 61 6c 73 | 7d 20 61 6e 64 20 74 68 |_globals|} and th|
|00000d00| 65 0a 63 6c 61 73 73 20 | 61 6e 64 20 69 6e 73 74 |e.class |and inst|
|00000d10| 61 6e 63 65 20 6f 62 6a | 65 63 74 20 61 74 74 72 |ance obj|ect attr|
|00000d20| 69 62 75 74 65 20 5c 63 | 6f 64 65 7b 5f 5f 64 69 |ibute \c|ode{__di|
|00000d30| 63 74 5f 5f 7d 20 61 72 | 65 20 75 6e 61 76 61 69 |ct__} ar|e unavai|
|00000d40| 6c 61 62 6c 65 2e 0a 0a | 54 77 6f 20 6d 6f 64 75 |lable...|Two modu|
|00000d50| 6c 65 73 20 70 72 6f 76 | 69 64 65 20 74 68 65 20 |les prov|ide the |
|00000d60| 66 72 61 6d 65 77 6f 72 | 6b 20 66 6f 72 20 73 65 |framewor|k for se|
|00000d70| 74 74 69 6e 67 20 75 70 | 20 72 65 73 74 72 69 63 |tting up| restric|
|00000d80| 74 65 64 20 65 78 65 63 | 75 74 69 6f 6e 0a 65 6e |ted exec|ution.en|
|00000d90| 76 69 72 6f 6e 6d 65 6e | 74 73 3a 0a 0a 5c 62 65 |vironmen|ts:..\be|
|00000da0| 67 69 6e 7b 64 65 73 63 | 72 69 70 74 69 6f 6e 7d |gin{desc|ription}|
|00000db0| 0a 0a 5c 69 74 65 6d 5b | 72 65 78 65 63 5d 0a 2d |..\item[|rexec].-|
|00000dc0| 2d 2d 20 42 61 73 69 63 | 20 72 65 73 74 72 69 63 |-- Basic| restric|
|00000dd0| 74 65 64 20 65 78 65 63 | 75 74 69 6f 6e 20 66 72 |ted exec|ution fr|
|00000de0| 61 6d 65 77 6f 72 6b 2e | 0a 0a 5c 69 74 65 6d 5b |amework.|..\item[|
|00000df0| 42 61 73 74 69 6f 6e 5d | 0a 2d 2d 2d 20 50 72 6f |Bastion]|.--- Pro|
|00000e00| 76 69 64 69 6e 67 20 72 | 65 73 74 72 69 63 74 65 |viding r|estricte|
|00000e10| 64 20 61 63 63 65 73 73 | 20 74 6f 20 6f 62 6a 65 |d access| to obje|
|00000e20| 63 74 73 2e 0a 0a 5c 65 | 6e 64 7b 64 65 73 63 72 |cts...\e|nd{descr|
|00000e30| 69 70 74 69 6f 6e 7d 0a | |iption}.| |
+--------+-------------------------+-------------------------+--------+--------+