403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib64/python3.9/site-packages/hgext/lfs/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/hgext/lfs/__pycache__/wireprotolfsserver.cpython-39.opt-1.pyc
a

�+�b
/�@s�ddlmZddlZddlZddlZddlZddlmZddl	m
Z
mZmZm
Z
ddlmZejZejZejZejZejZejZejZe
�
�Ze�e
d�dd	��Zdd
d�Zdd
�Zdd�Zdd�Zdd�ZdS)�)�absolute_importN)�common)�	exthelper�pycompat�util�wireprotoserver�)�	blobstoreshandlewsgirequestc
s|��|��rdS�jj�dd�s&dSt��jjd�s:dS�jsDdSzV�jdkrl���d�t�j�|�WS�j�d�r�t	�j�|���fd	d
��WSWdSt
j�y}zR|jD]\}}||j|<q�t
�
|jt�|��|_|�dt�|��WYd}~dSd}~00dS)
z�Wrap wireprotoserver.handlewsgirequest() to possibly process an LFS
    request if it is left unprocessed by the wrapped method.
    Tsexperimentals	lfs.serveF�lfslocalblobstores.git/info/lfs/objects/batch�pulls.hg/lfs/objectscs���|�S)N�)Zperm��	checkperm�rctx�reqr�B/usr/lib64/python3.9/site-packages/hgext/lfs/wireprotolfsserver.py�<lambda>>�z#handlewsgirequest.<locals>.<lambda>s0
%s
N)�repoZuiZ
configboolrZsafehasattr�svfs�dispatchpath�_processbatchrequest�
startswith�_processbasictransfer�hgwebcommonZ
ErrorResponse�headers�
statusmessage�coder�bytestr�status�setbodybytes)Zorigrr�resr�e�k�vrr
r�handlewsgirequest%s.
�r%cCs(tj||d�|_d|jd<|�d�dS)N��message�text/plain; charset=utf-8�Content-Typer)rrrrr )r!rr'rrr�
_sethttperrorLs
r*cCsPt�t���}|jd}d}|jr,||j7}|d|j7}|�d||f�dS)z=Write information about the current exception to wsgi.errors.swsgi.errorsr�/s4Exception happened while processing request '%s':
%sN)rZsysbytes�	traceback�
format_excZrawenv�apppathr�write)r�tbZerrorlogZurirrr�
_logexceptionRs


�r1cCs|jdkrt|t�dS|jddkr4t|t�dS|jddkrPt|t�dSt�|j�	��}d|�
ddg�vr�t|td�dS|�
d	�}t�|�}|d
vr�t|td|�dS|j
j}dd
�t||�
dg�||�D�}d|d�}t�t�|_d|jd<|�t�t�|���dS)z�Handle a request for the Batch API, which is the gateway to granting file
    access.

    https://github.com/git-lfs/git-lfs/blob/master/docs/api/batch.md
    sPOSTTr)sapplication/vnd.git-lfs+jsonsAcceptZbasicZ	transferss0Only the basic LFS transfer handler is supported�	operation)�upload�downloads&Unsupported LFS transfer operation: %scSsg|]}|�qSrr)�.0�prrr�
<listcomp>�s�z(_processbatchrequest.<locals>.<listcomp>�objects)Ztransferr8)�methodr*�HTTP_METHOD_NOT_ALLOWEDr�HTTP_UNSUPPORTED_MEDIA_TYPE�HTTP_NOT_ACCEPTABLErZ
json_loads�bodyfh�read�get�HTTP_BAD_REQUESTrrr
�_batchresponseobjectsrr�HTTP_OKrr �json�dumps)rrr!Zlfsreqr2�
localstorer8�rsprrrrasN



�

����
rc
#st|D�]h}|�d�}|�d�}||�d�d�}d}d}	z$|�|�}	|	rX|dkrX|�|�Wnbty�}
zJ|
jtjkr�t��d|
jp�d	d
�|d<|VWYd}
~
qd}WYd}
~
n
d}
~
00|d
kr�|s�ddd
�|d<|Vqn|	s�ddd
�|d<|Vqn|	�r|Vqt	j	�
�t	jdd�}�fdd�}dt�
|�t�
d�j�j|f�|�d�|�d�i|d<|VqdS)a4Yield one dictionary of attributes for the Batch API response for each
    object in the list.

    req: The parsedrequest for the Batch API request
    objects: The list of objects in the Batch API object request list
    action: 'upload' or 'download'
    store: The local blob store for servicing requests�oid�ascii�size)rGrITFr3i�zInternal Server Server)rr'�errorNr4i�zThe object does not exist�zThe object is corrupt�
)Zminutescs2ddi}�j�dd�}|�d�r.t�|�|d<|S)NZAcceptzapplication/vnd.git-lfss
AuthorizationrsBasic Z
Authorization)rr?rr�strurl)ZhdrZauth�rrr�_buildheaders

z+_batchresponseobjects.<locals>._buildheaderz%ss%s%s/.hg/lfs/objects/%sz%Y-%m-%dT%H:%M:%SZ)ZhrefZ
expires_at�header�actions)r?�encodeZverifyZlinkfromusercache�IOError�errno�ENOENTr1�strerror�datetimeZnowZ	timedeltarrMZbaseurlr.�strftime)
rr8�action�store�objZsoidrGrF�existsZverifies�instZ	expiresatrOrrNrrA�sd


�	
�
�
�

����rAc	CsT|j}|jd}|jj}t|j�dkr4t|t�dS|dkr�|d�|�|�}tj	}z,|�
||j|jd�||rvt
nt�|_Wn(tjy�t|�|dd�|_Yn0d	|jd
<|�d�dS|dk�r:|d
�t�	t
�|_d|jd
<z|�|�|��Wn6tj�y4t|�t�	dd�|_|�d�Yn0dSt|td|d�dSdS)apHandle a single file upload (PUT) or download (GET) action for the Basic
    Transfer Adapter.

    After determining if the request is for an upload or download, the access
    must be checked by calling ``checkperm()`` with either 'pull' or 'upload'
    before accessing the files.

    https://github.com/git-lfs/git-lfs/blob/master/docs/api/basic-transfers.md
    ����TsPUTr3sContent-LengthrKscorrupt blobr(r)rsGETrsapplication/octet-streams#Unsupported LFS transfer method: %sr&N)r9Z
dispatchpartsrr
�lenr*�HTTP_NOT_FOUNDZhasrrZdownloadr=rrB�HTTP_CREATEDrr	ZLfsCorruptionErrorr1r r>r:)	rrr!rr9rGrEZexistedrrrrr*sH






�r)N)Z
__future__rrWrTrCr,Zmercurial.hgwebrrZ	mercurialrrrr�r	rBrbr@rar:r<r;ZehZwrapfunctionr%r*r1rrArrrrr�<module>s,

&
Rw

Youez - 2016 - github.com/yon3zu
LinuXploit