ROOTPLOIT
Server: LiteSpeed
System: Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User: niphet (1079)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/setuptools/__pycache__/sandbox.cpython-36.opt-1.pyc
3

vh7@sddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
mZddlZejjdrddljjjjZnejejZyeZWnek
rdZYnXeZddlm Z ddlm!Z!ddd	d
gZ"d-ddZ#ej$d.d
dZ%ej$ddZ&ej$ddZ'ej$ddZ(Gddde)Z*GdddZ+ej$ddZ,ddZ-ej$ddZ.ej$dd Z/d!d"Z0d#d$Z1d%d
Z2Gd&ddZ3e4ed'rej5gZ6ngZ6Gd(dde3Z7ej8ej9d)d*d+j:DZ;Gd,d	d	e Z<dS)/N)six)builtinsmapjava)DistutilsError)working_setAbstractSandboxDirectorySandboxSandboxViolation	run_setupcCsJd}t||}|j}WdQRX|dkr.|}t||d}t|||dS)z.
    Python 3 implementation of execfile.
    rbNexec)openreadcompiler
)filenameglobalslocalsmodestreamZscriptcoder/usr/lib/python3.6/sandbox.py	_execfile#src
csDtjdd}|dk	r$|tjdd<z
|VWd|tjdd<XdS)N)sysargv)replsavedrrr	save_argv0s
rc
cs.tjdd}z
|VWd|tjdd<XdS)N)rpath)rrrr	save_path;s
r ccs4tjj|ddtj}|t_z
dVWd|t_XdS)zL
    Monkey-patch tempfile.tempdir with replacement, ensuring it exists
    T)exist_okN)
pkg_resourcesZ
py31compatmakedirstempfileZtempdir)Zreplacementrrrr
override_tempDs
r%ccs.tj}tj|z
|VWdtj|XdS)N)osgetcwdchdir)targetrrrrpushdUs


r*c@seZdZdZeddZdS)UnpickleableExceptionzP
    An exception representing another Exception that could not be pickled.
    cCsJytj|tj|fStk
rDddlm}|j||t|SXdS)z
        Always return a dumped (pickled) type and exc. If exc can't be pickled,
        wrap it in UnpickleableException first.
        r)r+N)pickledumps	Exceptionsetuptools.sandboxr+dumprepr)typeexcclsrrrr0ds
zUnpickleableException.dumpN)__name__
__module____qualname____doc__staticmethodr0rrrrr+_sr+c@s(eZdZdZddZddZddZdS)	ExceptionSaverz^
    A Context Manager that will save an exception, serialized, and restore it
    later.
    cCs|S)Nr)selfrrr	__enter__xszExceptionSaver.__enter__cCs |sdStj|||_||_dS)NT)r+r0_saved_tb)r;r2r3tbrrr__exit__{s
zExceptionSaver.__exit__cCs6dt|krdSttj|j\}}tj|||jdS)z"restore and re-raise any exceptionr=N)varsrr,loadsr=rZreraiser>)r;r2r3rrrresumeszExceptionSaver.resumeN)r5r6r7r8r<r@rCrrrrr:rsr:c
#sVtjjt}VWdQRXtjjfddtjD}t||jdS)z
    Context in which imported modules are saved.

    Translates exceptions internal to the context into the equivalent exception
    outside the context.
    Nc3s&|]}|kr|jdr|VqdS)z
encodings.N)
startswith).0mod_name)rrr	<genexpr>szsave_modules.<locals>.<genexpr>)rmodulescopyr:update_clear_modulesrC)	saved_excZdel_modulesr)rrsave_moduless
rMcCsxt|D]}tj|=q
WdS)N)listrrH)Zmodule_namesrFrrrrKsrKccs$tj}z
|VWdtj|XdS)N)r"__getstate____setstate__)rrrrsave_pkg_resources_states
rQc,cstjj|d}txtfttNt<t|(t	|t
ddVWdQRXWdQRXWdQRXWdQRXWdQRXWdQRXdS)NZtempZ
setuptools)r&rjoinrQrMhide_setuptoolsr rr%r*
__import__)	setup_dirZtemp_dirrrr
setup_contexts

rVcCstjd}t|j|S)aH
    >>> _needs_hiding('setuptools')
    True
    >>> _needs_hiding('pkg_resources')
    True
    >>> _needs_hiding('setuptools_plugin')
    False
    >>> _needs_hiding('setuptools.__init__')
    True
    >>> _needs_hiding('distutils')
    True
    >>> _needs_hiding('os')
    False
    >>> _needs_hiding('Cython')
    True
    z1(setuptools|pkg_resources|distutils|Cython)(\.|$))rerboolmatch)rFpatternrrr
_needs_hidings
r[cCstttj}t|dS)a%
    Remove references to setuptools' modules from sys.modules to allow the
    invocation to import the most appropriate setuptools. This technique is
    necessary to avoid issues such as #315 where setuptools upgrading itself
    would fail to find a function declared in the metadata.
    N)filterr[rrHrK)rHrrrrSsrScCstjjtjj|}t|y|gt|tjdd<tjjd|t	j
t	jjddt
|trl|n|jtj}t|t|dd}t||WdQRXWn4tk
r}z|jr|jdrʂWYdd}~XnXWdQRXdS)z8Run a distutils setup script, sandboxed in its directoryNrcSs|jS)N)Zactivate)Zdistrrr<lambda>szrun_setup.<locals>.<lambda>__main__)__file__r5)r&rabspathdirnamerVrNrrinsertr__init__Z	callbacksappend
isinstancestrencodegetfilesystemencodingr	dictr
SystemExitargs)Zsetup_scriptrkrUZdunder_filensvrrrrs

c@s2eZdZdZdZddZddZddZd	d
ZddZ	d
dZ
x$d9D]Zee
erFe
eee<qFWd:ddZer~edeZedeZx$d;D]Zee
ereeee<qWd)d*Zx$d<D]Zee
ereeee<qWd-d.Zx(d=D] Zee
ereeee<qWd1d2Zd3d4Zd5d6Zd7d8ZdS)>rzDWrap 'os' module and 'open()' builtin for virtualizing setup scriptsFcsfddttD_dS)Ncs&g|]}|jdrt|r|qS)_)rDhasattr)rEname)r;rr
<listcomp>sz,AbstractSandbox.__init__.<locals>.<listcomp>)dir_os_attrs)r;r)r;rrcszAbstractSandbox.__init__cCs&x |jD]}tt|t||qWdS)N)rtsetattrr&getattr)r;sourcerprrr_copyszAbstractSandbox._copycCs(|j|tr|jt_|jt_d|_dS)NT)rx_filerfile_openr_active)r;rrrr<s

zAbstractSandbox.__enter__cCs$d|_trtt_tt_|jtdS)NF)r|ryrrzr{rrxrs)r;exc_type	exc_value	tracebackrrrr@s
zAbstractSandbox.__exit__c	Cs||SQRXdS)zRun 'func' under os sandboxingNr)r;funcrrrrunszAbstractSandbox.runcsttfdd}|S)Ncs2|jr |j||f||\}}||f||S)N)r|_remap_pair)r;srcdstrkkw)rporiginalrrwrap&sz3AbstractSandbox._mk_dual_path_wrapper.<locals>.wrap)rvrs)rprr)rprr_mk_dual_path_wrapper#s
z%AbstractSandbox._mk_dual_path_wrapperrenamelinksymlinkNcs pttfdd}|S)Ncs*|jr|j|f||}|f||S)N)r|_remap_input)r;rrkr)rprrrr4sz5AbstractSandbox._mk_single_path_wrapper.<locals>.wrap)rvrs)rprrr)rprr_mk_single_path_wrapper1sz'AbstractSandbox._mk_single_path_wrapperrzrstatlistdirr(chmodchownmkdirremoveunlinkrmdirutimelchownchrootlstat	startfilemkfifomknodpathconfaccesscsttfdd}|S)NcsB|jr2|j|f||}|j|f||S|f||S)N)r|r
_remap_output)r;rrkr)rprrrrIsz4AbstractSandbox._mk_single_with_return.<locals>.wrap)rvrs)rprr)rprr_mk_single_with_returnFs
z&AbstractSandbox._mk_single_with_returnreadlinktempnamcsttfdd}|S)Ncs ||}|jr|j|S|S)N)r|r)r;rkrZretval)rprrrrXs
z'AbstractSandbox._mk_query.<locals>.wrap)rvrs)rprr)rprr	_mk_queryUs
zAbstractSandbox._mk_queryr'tmpnamcCs|S)z=Called to remap or validate any path, whether input or outputr)r;rrrr_validate_pathdszAbstractSandbox._validate_pathcOs
|j|S)zCalled for path inputs)r)r;	operationrrkrrrrrhszAbstractSandbox._remap_inputcCs
|j|S)zCalled for path outputs)r)r;rrrrrrlszAbstractSandbox._remap_outputcOs0|j|d|f|||j|d|f||fS)z?Called for path pairs like rename, link, and symlink operationsz-fromz-to)r)r;rrrrkrrrrrpszAbstractSandbox._remap_pair)rrr)N)rrr(rrrrrrrrrrrrrrrr)rr)r'r)r5r6r7r8r|rcrxr<r@rrrprorsrrryr{rrrrrrrrrrrsB










devnullc@seZdZdZejdddddddd	d
ddd
dg
ZdgZefddZ	ddZ
erXd'ddZd(ddZddZ
ddZddZdd Zd!d"Zd)d$d%Zd&S)*r	z<Restrict operations to a single subdirectory - pseudo-chrootrrrrrrrrrrrrrz.*lib2to3.*\.pickle$cCsFtjjtjj||_tjj|jd|_dd|D|_tj	|dS)NcSs g|]}tjjtjj|qSr)r&rnormcaserealpath)rErrrrrqsz-DirectorySandbox.__init__.<locals>.<listcomp>)
r&rrr_sandboxrR_prefix_exceptionsrrc)r;Zsandbox
exceptionsrrrrcs

zDirectorySandbox.__init__cOsddlm}||||dS)Nr)r
)r/r
)r;rrkrr
rrr
_violationszDirectorySandbox._violationrcOs<|dkr*|j|r*|jd||f||t||f||S)NrrtrrUUrz)rrrrr)_okrry)r;rrrkrrrrryszDirectorySandbox._filecOs<|dkr*|j|r*|jd||f||t||f||S)Nrrrrrr)rrrrr)rrr{)r;rrrkrrrrr{szDirectorySandbox._opencCs|jddS)Nr)r)r;rrrrszDirectorySandbox.tmpnamcCsN|j}z:d|_tjjtjj|}|j|p@||jkp@|j|jS||_XdS)NF)	r|r&rrr	_exemptedrrDr)r;rZactiverrrrrs

zDirectorySandbox._okcs<fdd|jD}fdd|jD}tj||}t|S)Nc3s|]}j|VqdS)N)rD)rEZ	exception)filepathrrrGsz-DirectorySandbox._exempted.<locals>.<genexpr>c3s|]}tj|VqdS)N)rWrY)rErZ)rrrrGs)r_exception_patterns	itertoolschainany)r;rZ
start_matchesZpattern_matchesZ
candidatesr)rrrs



zDirectorySandbox._exemptedcOs6||jkr2|j|r2|j|tjj|f|||S)zCalled for path inputs)	write_opsrrr&rr)r;rrrkrrrrrszDirectorySandbox._remap_inputcOs6|j|s|j|r.|j|||f||||fS)z?Called for path pairs like rename, link, and symlink operations)rr)r;rrrrkrrrrrszDirectorySandbox._remap_paircOsB|t@r,|j|r,|jd|||f||tj|||f||S)zCalled for low-level os.open()zos.open)WRITE_FLAGSrrrsr)r;rzflagsrrkrrrrrszDirectorySandbox.openN)r)r)r)r5r6r7r8rifromkeysrr_EXCEPTIONSrcrryr{rrrrrrrrrrr	~s 	


cCsg|]}tt|dqS)r)rvrs)rEarrrrqsrqz4O_WRONLY O_RDWR O_APPEND O_CREAT O_TRUNC O_TEMPORARYc@s&eZdZdZejdjZddZdS)r
zEA setup script attempted to modify the filesystem outside the sandboxa
        SandboxViolation: {cmd}{args!r} {kwargs}

        The package setup script has attempted to modify files on your system
        that are not within the EasyInstall build area, and has been aborted.

        This package cannot be safely installed by EasyInstall, and may not
        support alternate installation locations even if you run its setup
        script by hand.  Please inform the package's author and the EasyInstall
        maintainers to find out if a fix or workaround is available.
        cCs|j\}}}|jjftS)N)rktmplformatr)r;cmdrkkwargsrrr__str__szSandboxViolation.__str__N)	r5r6r7r8textwrapdedentlstriprrrrrrr
s

)N)N)=r&rr$operator	functoolsrrW
contextlibr,rZsetuptools.externrZsetuptools.extern.six.movesrrZpkg_resources.py31compatr"platformrDZ$org.python.modules.posix.PosixModulepythonrHposixZPosixModulersrprzry	NameErrorrr{Zdistutils.errorsrr__all__rcontextmanagerrr r%r*r.r+r:rMrKrQrVr[rSrrrorrr	reduceor_splitrr
rrrr<module>s^



	
	w
V