[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.129.70.129: ~ $
�
��9Qc@s�dZdddddgZddlZddlZddlZddlZddlZdZd	�Zgd
�Z	d�Z
eed�Zeed
�Z
eed�Zeed�ZdS(s=This module contains helper functions for dealing with files.t
issamefiletlinkfiletcopyfiletlinkorcopyfiletoverwrite_safelyi����NicCs1tj|�}tj|�}tjj||�S(N(toststattpathtsamestat(tpath1tpath2ts1ts2((s3/usr/lib/python2.7/site-packages/slip/util/files.pyt_issamefile#scCs?|tkrt}nyt||�SWn|k
r:tSXdS(sECheck whether two paths point to the same file (i.e. are hardlinked).N(tTruet	ExceptionR
tFalse(R	R
tcatch_stat_exceptions((s3/usr/lib/python2.7/site-packages/slip/util/files.pyR*s	
cCs�t||dt�rdStjj|�}tjj|�}tjj|�}t}xtt	j
�D]n}t	jd|tjd|�}ytj
||�Wn+tk
r�}|jtjkr�q��qeXt}PqeW|r�tj||�ndS(sUHardlink srcpath to dstpath.

    Attempt to atomically replace dstpath if it exists.RNtprefixtdir(RtOSErrorRRtabspathtdirnametbasenameRtxrangettempfiletTMP_MAXtmktemptextseptlinkterrnotEEXISTRtrename(tsrcpathtdstpathtdstdnametdstbnamet
hardlinkedtattemptt_dsttmpte((s3/usr/lib/python2.7/site-packages/slip/util/files.pyR6s$c
Cs�t||dt�rdStjj|�}tjj|�}tjj|�}t|d�}tj	d|tjj
d|dt�}t}|r�ytj
||j�t}Wq�tjtfk
r�q�Xn|s�tj
||j�nd}	xa|	dkrT|jt�}	y|j|	�Wq�|j�|j�tj|j��q�Xq�W|j�|j�tj|j|�|r�tj�dkr�tj|�ndS(	s�Copy srcpath to dstpath.

    Abort operation if e.g. not enough space is available.  Attempt to
    atomically replace dstpath if it exists.RNtrbRRtdeleteti(RRRRRRRtopenRtNamedTemporaryFileRRtshutiltcopymodetnameRtErrortNonetreadt	BLOCKSIZEtwritetclosetunlinkR tselinuxtis_selinux_enabledt
restorecon(
R!R"tcopy_mode_from_dsttrun_restoreconR#R$tsrcfilet
dsttmpfiletmode_copiedtdata((s3/usr/lib/python2.7/site-packages/slip/util/files.pyRWs@




cCsiyt||�dSWn:tk
rQ}|jtjtjtjfkrR�qRnXt||||�dS(stFirst attempt to hardlink srcpath to dstpath, if hardlinking isn't
    possible, attempt copying srcpath to dstpath.N(RRRtEMLINKtEPERMtEXDEVR(R!R"R;R<R(((s3/usr/lib/python2.7/site-packages/slip/util/files.pyR�s
!c
Cstjj|�}tjj|�}t}d}|rQtj�dkrQt}nly8tj|�\}}|dkr�t	d|��nWn1t
k
r�}	|	jtjkr�t
}q��nX|s�tj||�|r�tj|�q�nd}
x�ttj�D]q}tjd|tjd|�}ytj||�Wn.t
k
rk}	|	jtjkreqn�qX|}
PqW|
dkr�ttjd��n|r�|r�tj|
|�nytj|
|�Wntj|
��nX|r�tj|�ndS(spCreate a symlink, optionally replacing dstpath atomically, optionally
    setting or preserving SELinux context.isgetfilecon(%r) failedRRs/No suitable temporary symlink could be created.N(RRRRRR2R8R9tlgetfilecontRuntimeErrorRRtENOENTRtsymlinkR:RRRRRRtIOErrortlsetfileconR tremove(
R!R"tforcetpreserve_contextR#R$R<tctxtretR(tdsttmpR&R'((s3/usr/lib/python2.7/site-packages/slip/util/files.pytsymlink_atomically�sR			

cCs�tjj|�}tjj|�}tjj|�}d}d}d}tjj|�}	|r{tj�dkr{t	}nzt
jd|tjjd|�\}}|	r�|r�t
j||�n|	r|rtj|�\}
}|
dkrtd|��qntj|d�}d}|j|�|j�d}tj||�|r||	rltj||�q|tj|�nWd|r�|j�n|r�tj|�n|r�tjj|�r�ytj|�Wq�q�XnXdS(s�Safely overwrite a file by creating a temporary file in the same
    directory, writing it, moving it over the original file, eventually
    preserving file mode and SELinux context.iRRsgetfilecon(%r) failedtwN(RRtrealpathRRR2texistsR8R9RRtmkstempRR.R/t
getfileconREtfdopenR5R6R t
setfileconR:tisfileR7(Rtcontentt
preserve_modeRLtdir_tbasetfdtfttmpnameRSRNRM((s3/usr/lib/python2.7/site-packages/slip/util/files.pyR�sJ	


(t__doc__t__all__RR8R.RRR4R
RRRRRRRPR(((s3/usr/lib/python2.7/site-packages/slip/util/files.pyt<module>s 			!6;

Filemanager

Name Type Size Permission Actions
.__init__.pyo.40009 File 195 B 0644
.files.pyo.40009 File 5.85 KB 0644
__init__.py File 54 B 0644
__init__.pyc File 195 B 0644
__init__.pyo File 195 B 0644
files.py File 7.34 KB 0644
files.pyc File 5.85 KB 0644
files.pyo File 5.85 KB 0644
hookable.py File 4.61 KB 0644
hookable.pyc File 6.23 KB 0644
hookable.pyo File 6.18 KB 0644