|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /proc/21571/root/usr/lib64/python2.4/ |
Upload File : |
m
=5Dc @ s d Z d k Z d k Z d k Z d k Z d k Z d g Z d f d YZ d e f d YZ d Z d e f d YZ
d
e i f d YZ e i
Z e i Z d e i f d YZ d
Z e d j o e i e n d S( s9 Restricted execution facilities.
The class RExec exports methods r_exec(), r_eval(), r_execfile(), and
r_import(), which correspond roughly to the built-in operations
exec, eval(), execfile() and import, but executing the code in an
environment that only exposes those built-in operations that are
deemed safe. To this end, a modest collection of 'fake' modules is
created which mimics the standard modules by the same names. It is a
policy decision which built-in modules and operations are made
available; this module provides a reasonable default, but derived
classes can change the policies e.g. by overriding or extending class
variables like ok_builtin_modules or methods like make_sys().
XXX To do:
- r_open should allow writing tmp dir
- r_exec etc. with explicit globals/locals? (Use rexec("exec ... in ...")?)
Nt RExect FileBasec B s t Z d
Z RS( Nt filenot flusht isattyt readt readlinet readlinest seekt tellt writet
writelinest
xreadlinest __iter__( s filenos flushs isattys reads readlines readliness seeks tells writes
writeliness
xreadliness __iter__( t __name__t
__module__t ok_file_methods( ( ( t /usr/lib64/python2.4/rexec.pyR s t FileWrapperc B s t Z d Z d Z RS( Nc C sV xO | i D]D } t | | o- t | | o t | | t | | q
q
Wd S( N( t selfR t mt hasattrt ft setattrt getattr( R R R ( ( R t __init__( s
!c C s | i d S( N( R R ( R ( ( R t close- s ( R R R R ( ( ( R R $ s sL
def %s(self, *args):
return getattr(self.mod, self.name).%s(*args)
t FileDelegatec B s; t Z d Z x' e i d D] Z e e e f d Uq WRS( Nc C s | | _ | | _ d S( N( t modR t name( R R R ( ( R R 8 s R ( s close( R R R R R R t TEMPLATE( ( ( R R 6 s t RHooksc B s} t Z d Z d Z d Z d Z d Z d Z d Z d Z d Z
d
Z d Z d Z
d
Z RS( Nc G s d } d } | o5 t | d t d j o | d } | d } n | o, t | d d o | d } | d } n | o
t d n t i i | | | | _ d S( Ni it __class__i s too many arguments( t verboset Nonet rexect argst typeR t TypeErrort ihookst HooksR R ( R R$ R! R# ( ( R R B s $
c C s
| | _ d S( N( R# R ( R R# ( ( R t set_rexecS s c C s
| i i S( N( R R# t get_suffixes( R ( ( R R* W s c C s | i i | S( N( R R# t
is_builtinR ( R R ( ( R R+ Z s c C s t | } | i i | f S( N( t
__import__R R R R# t copy_except( R R R ( ( R t init_builtin] s c C s
t d d S( Ns don't use this( t SystemError( R R ( ( R t init_frozena s c G s
t d d S( Ns don't use this( R/ ( R R$ ( ( R t load_sourceb s c G s
t d d S( Ns don't use this( R/ ( R R$ ( ( R t
load_compiledc s c G s
t d d S( Ns don't use this( R/ ( R R$ ( ( R t load_packaged s c C s | i i | | | S( N( R R# t load_dynamicR t filenamet file( R R R5 R6 ( ( R R4 f s c C s | i i | S( N( R R# t
add_moduleR ( R R ( ( R R7 i s c C s
| i i S( N( R R# t modules( R ( ( R t modules_dictl s c C s | i i d i S( Nt sys( R R# R8 t path( R ( ( R t default_patho s ( R R R R) R* R+ R. R0 R1 R2 R3 R4 R7 R9 R<