ok

Mini Shell

Direktori : /opt/alt/python311/lib64/python3.11/http/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/http/__pycache__/server.cpython-311.opt-2.pyc

�

�f_���x�	dZgd�ZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlmZdZdZGd�dej��ZGd	�d
eje��ZGd�dej��ZGd
�de��Zd�Z da!d�Z"d�Z#Gd�de��Z$d�Z%eedddfd�Z&e'dkr�ddl(Z(ddl)Z)e(j*��Z+e+�,ddd���e+�,dddd �!��e+�,d"d#ej-��d$�%��e+�,d&d'd(dd)�*��e+�,d+de.d,d-�.��e+�/��Z0e0j1re$Z2neZ2Gd/�d0e��Z3e&e2e3e0j4e0j5e0j6�1��dSdS)2z0.6)�
HTTPServer�ThreadingHTTPServer�BaseHTTPRequestHandler�SimpleHTTPRequestHandler�CGIHTTPRequestHandler�N)�
HTTPStatusaD<!DOCTYPE HTML>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Error response</title>
    </head>
    <body>
        <h1>Error response</h1>
        <p>Error code: %(code)d</p>
        <p>Message: %(message)s.</p>
        <p>Error code explanation: %(code)s - %(explain)s.</p>
    </body>
</html>
ztext/html;charset=utf-8c��eZdZdZd�ZdS)r�c��	tj�|��|jdd�\}}t	j|��|_||_dS)N�)�socketserver�	TCPServer�server_bind�server_address�socket�getfqdn�server_name�server_port)�self�host�ports   �2/opt/alt/python311/lib64/python3.11/http/server.pyrzHTTPServer.server_bind�sQ��<���*�*�4�0�0�0��(��!��,�
��d�!�>�$�/�/��������N)�__name__�
__module__�__qualname__�allow_reuse_addressr�rrrr�s)�������� � � � � rrc��eZdZdZdS)rTN)rrr�daemon_threadsrrrrr�s�������N�N�Nrrc
���eZdZ	dej���dzZdezZe	Z
eZdZ
d�Zd�Zd�Zd�Zd"d
�Zd#d�Zd#d�Zd
�Zd�Zd�Zd$d�Zd�Ze�d�ejed��edd����D����Zdee d��<d�Z!d�Z"d#d�Z#d�Z$gd�Z%gd�Z&d�Z'd Z(e)j*j+Z,d!�e-j.�/��D��Z0d	S)%rzPython/rz	BaseHTTP/�HTTP/0.9c���	d|_|jx|_}d|_t	|jd��}|�d��}||_|���}t|��dkrdSt|��dk�rp|d}	|�
d��st�|�d	d
��d
}|�d��}t|��dkrt�td
�|D����rtd���td�|D����rtd���t|d��t|d
��f}n;#ttf$r'|�t jd|z��YdSwxYw|dkr|jdkrd|_|dkr%|�t jd|z��dS||_dt|��cxkrdks'n|�t jd|z��dS|dd�\}}t|��dkr2d|_|dkr%|�t jd|z��dS||c|_|_|j�
d��r"d	|j�d	��z|_	t,j�|j|j���|_n�#t,jj$r9}|�t jdt	|����Yd}~dSd}~wt,jj$r9}|�t jdt	|����Yd}~dSd}~wwxYw|j�dd��}	|	� ��dkrd|_n*|	� ��d kr|jdkrd|_|j�d!d��}
|
� ��d"kr,|jdkr!|jdkr|�!��sdSdS)#NTz
iso-8859-1�
rF����zHTTP/�/r
�.rc3�@K�|]}|���V��dS�N)�isdigit��.0�	components  r�	<genexpr>z7BaseHTTPRequestHandler.parse_request.<locals>.<genexpr>/s1����O�O�9�9�,�,�.�.�.�O�O�O�O�O�Orznon digit in http versionc3�<K�|]}t|��dkV��dS)�
N)�lenr,s  rr/z7BaseHTTPRequestHandler.parse_request.<locals>.<genexpr>1s-����K�K�y�s�9�~�~��*�K�K�K�K�K�Krz unreasonable length http versionzBad request version (%r))r
r
zHTTP/1.1)rrzInvalid HTTP version (%s)zBad request syntax (%r)�GETzBad HTTP/0.9 request type (%r)z//)�_classz
Line too longzToo many headers�
Connection��close�
keep-alive�Expectz100-continue)"�command�default_request_version�request_version�close_connection�str�raw_requestline�rstrip�requestline�splitr2�
startswith�
ValueError�any�int�
IndexError�
send_errorr�BAD_REQUEST�protocol_version�HTTP_VERSION_NOT_SUPPORTED�path�lstrip�http�client�
parse_headers�rfile�MessageClass�headers�LineTooLong�REQUEST_HEADER_FIELDS_TOO_LARGE�
HTTPException�get�lower�handle_expect_100)r�versionrA�words�base_version_number�version_numberr:rL�err�conntype�expects           r�
parse_requestz$BaseHTTPRequestHandler.parse_requests���		����)-�)E�E���w� $����$�.��=�=��!�(�(��0�0��&����!�!�#�#���u�:�:��?�?��5��u�:�:��?�?��B�i�G�
��)�)�'�2�2�%�$�$�&-�m�m�C��&;�&;�A�&>�#�!4�!:�!:�3�!?�!?���~�&�&�!�+�+�$�$��O�O��O�O�O�O�O�B�$�%@�A�A�A��K�K�N�K�K�K�K�K�I�$�%G�H�H�H�!$�^�A�%6�!7�!7��^�A�=N�9O�9O�!O�����
�+�
�
�
�����*�.��8�:�:�:��u�u�	
����
��'�'�D�,A�Z�,O�,O�(-��%���'�'�����9�/�2E�E�G�G�G��u�#*�D� ��C��J�J�#�#�#�#�!�#�#�#�#��O�O��&�)�K�7�
9�
9�
9��5��b�q�b�	�
����u�:�:��?�?�$(�D�!��%�������*�4�w�>�@�@�@��u�")�4����d�i��9����%�%�	4��d�i�.�.�s�3�3�3�D�I�	��;�4�4�T�Z�<@�<M�5�O�O�D�L�L���{�&�	�	�	��O�O��:���C���
�
�
��5�5�5�5�5������{�(�	�	�	��O�O��:�"��C���
�
�
�
�5�5�5�5�5�����
	�����<�#�#�L�"�5�5���>�>���w�&�&�$(�D�!�!��n�n���,�.�.��#�z�1�1�$)�D�!���!�!�(�B�/�/���L�L�N�N�n�,�,��%��3�3��$�
�2�2��)�)�+�+�
��u��ts7�C!E7�74F/�.F/�0L�N$� .M�N$�+.N�N$c�n�	|�tj��|���dS�NT)�send_response_onlyr�CONTINUE�end_headers�rs rrYz(BaseHTTPRequestHandler.handle_expect_100ys7��	�	
���
� 3�4�4�4��������trc��		|j�d��|_t|j��dkr6d|_d|_d|_|�tj	��dS|js	d|_
dS|���sdSd|jz}t||��s*|�tj
d|jz��dSt||��}|��|j���dS#t"$r(}|�d|��d|_
Yd}~dSd}~wwxYw)Niir6T�do_zUnsupported method (%r)zRequest timed out: %r)rQ�readliner?r2rAr<r:rHr�REQUEST_URI_TOO_LONGr=ra�hasattr�NOT_IMPLEMENTED�getattr�wfile�flush�TimeoutError�	log_error)r�mname�method�es    r�handle_one_requestz)BaseHTTPRequestHandler.handle_one_request�sd��	�	�#'�:�#6�#6�u�#=�#=�D� ��4�'�(�(�5�0�0�#%�� �')��$�!������
� ?�@�@�@����'�
�(,��%����%�%�'�'�
����D�L�(�E��4��'�'�
�����.�-���<�>�>�>����T�5�)�)�F��F�H�H�H��J����������	�	�	��N�N�2�A�6�6�6�$(�D�!��F�F�F�F�F�����		���s1�A+D�0D�D�AD�3D�
E�D<�<Ec��	d|_|���|js|���|j�dSdSrc)r=rvrgs r�handlezBaseHTTPRequestHandler.handle�s]��4� $������!�!�!��'�	&��#�#�%�%�%��'�	&�	&�	&�	&�	&rNc���		|j|\}}n#t$rd\}}YnwxYw|�|}|�|}|�d||��|�||��|�dd��d}|dkr�|t
jt
jt
jfvr�|j	|tj|d���tj|d���d�z}|�d	d
��}|�d|j
��|�dtt|������|���|jd
kr|r|j�|��dSdSdS)N)�???rzzcode %d, message %sr5r7��F��quote)�code�message�explainzUTF-8�replacezContent-Type�Content-Length�HEAD)�	responses�KeyErrorrr�
send_response�send_headerr�
NO_CONTENT�
RESET_CONTENT�NOT_MODIFIED�error_message_format�html�escape�encode�error_content_typer>r2rfr:ro�write)rr~rr��shortmsg�longmsg�body�contents        rrHz!BaseHTTPRequestHandler.send_error�s���	�"	-� $��t� 4��H�g�g���	-�	-�	-� ,��H�g�g�g�	-�����?��G��?��G����,�d�G�<�<�<����4��)�)�)�����w�/�/�/�
���C�K�K���.�#�1�#�0�2�
2�
2�
�0���;�w�e�<�<�<��;�w�e�<�<�<�4�4��G�
�>�>�'�9�5�5�D����^�T�-D�E�E�E����-�s�3�t�9�9�~�~�>�>�>��������<�6�!�!�d�!��J���T�"�"�"�"�"�"�!�!�!s��&�&c��	|�|��|�||��|�d|�����|�d|�����dS)N�Server�Date)�log_requestrdr��version_string�date_time_string�rr~rs   rr�z$BaseHTTPRequestHandler.send_response�s}��	�	
�����������g�.�.�.�����4�#6�#6�#8�#8�9�9�9������!6�!6�!8�!8�9�9�9�9�9rc��	|jdkrs|�||jvr|j|d}nd}t|d��sg|_|j�d|j||fz�dd����dSdS)Nr"rr6�_headers_bufferz
%s %d %s
�latin-1�strict)r<r�rlr��appendrJr�r�s   rrdz)BaseHTTPRequestHandler.send_response_only�s���,���:�-�-����4�>�)�)�"�n�T�2�1�5�G�G� �G��4�!2�3�3�
*�')��$�� �'�'���*�D�'�:�*;�<B�F�!�8�=-�=-�
.�
.�
.�
.�
.�.�-rc�l�	|jdkrKt|d��sg|_|j�|�d|�d��dd����|���dkrB|���dkr	d	|_dS|���d
krd|_dSdSdS)Nr"r�z: r$r�r��
connectionr7Tr8F)r<rlr�r�r�rXr=)r�keyword�values   rr�z"BaseHTTPRequestHandler.send_headers���7���:�-�-��4�!2�3�3�
*�')��$�� �'�'�!(���%�%�%�0�8�8��H�M�M�
O�
O�
O��=�=�?�?�l�*�*��{�{�}�}��'�'�(,��%�%�%������,�.�.�(-��%�%�%�	+�*�/�.rc�~�	|jdkr0|j�d��|���dSdS)Nr"s
)r<r�r��
flush_headersrgs rrfz"BaseHTTPRequestHandler.end_headerssJ��:���:�-�-�� �'�'��0�0�0���� � � � � �.�-rc��t|d��r;|j�d�|j����g|_dSdS)Nr�r)rlror��joinr�rgs rr�z$BaseHTTPRequestHandler.flush_headerssR���4�*�+�+�	&��J���S�X�X�d�&:�;�;�<�<�<�#%�D� � � �	&�	&r�-c��	t|t��r|j}|�d|jt|��t|����dS)Nz
"%s" %s %s)�
isinstancerr��log_messagerAr>)rr~�sizes   rr�z"BaseHTTPRequestHandler.log_request!sa��	�
�d�J�'�'�	��:�D������)�3�t�9�9�c�$�i�i�	A�	A�	A�	A�	Arc�$�	|j|g|�R�dSr*)r�)r�format�argss   rrrz BaseHTTPRequestHandler.log_error,s*��		�	����'�$�'�'�'�'�'�'rc��i|]	}|d|d����
S)z\x�02xr)r-�cs  r�
<dictcomp>z!BaseHTTPRequestHandler.<dictcomp><s"��V�V�V�!�Q�
�a�
�
�
�V�V�Vr� ��z\\�\c	���	||z}tj�|����d|����d|�|j���d���dS)Nz - - [z] �
)�sys�stderrr��address_string�log_date_time_string�	translate�_control_char_table)rr�r�rs    rr�z"BaseHTTPRequestHandler.log_message?s���	�&�4�-���
����-�-�/�/�/�/��3�3�5�5�5�5�!�+�+�D�,D�E�E�E�E�G�	H�	H�	H�	H�	Hrc�(�	|jdz|jzS)N� )�server_version�sys_versionrgs rr�z%BaseHTTPRequestHandler.version_stringYs��8��"�S�(�4�+;�;�;rc�p�	|�tj��}tj�|d���S)NT)�usegmt)�time�email�utils�
formatdate)r�	timestamps  rr�z'BaseHTTPRequestHandler.date_time_string]s1��N����	���I��{�%�%�i��%�=�=�=rc	��	tj��}tj|��\	}}}}}}}}	}
d||j|||||fz}|S)Nz%02d/%3s/%04d %02d:%02d:%02d)r��	localtime�	monthname)r�now�year�month�day�hh�mm�ss�x�y�z�ss            rr�z+BaseHTTPRequestHandler.log_date_time_stringcsZ��<��i�k�k��04��s�0C�0C�-��e�S�"�b�"�a��A�*��T�^�E�*�D�"�b�"�.>�
>���r)�Mon�Tue�Wed�Thu�Fri�Sat�Sun)
N�Jan�Feb�Mar�Apr�May�Jun�Jul�Aug�Sep�Oct�Nov�Decc��	|jdS�Nr)�client_addressrgs rr�z%BaseHTTPRequestHandler.address_stringqs��(��"�1�%�%r�HTTP/1.0c�,�i|]}||j|jf��Sr)�phrase�description)r-�vs  rr�z!BaseHTTPRequestHandler.<dictcomp>�s3�����
�	
�A�H�a�m�$���r)NNr*)r�r�)1rrrr�rZrBr��__version__r��DEFAULT_ERROR_MESSAGEr��DEFAULT_ERROR_CONTENT_TYPEr�r;rarYrvrxrHr�rdr�rfr�r�rrr>�	maketrans�	itertools�chain�ranger��ordr�r�r�r��weekdaynamer�r�rJrNrO�HTTPMessagerRr�__members__�valuesr�rrrrr�s7������d�N�c�k�/�/�1�1�!�4�4�K�
!�;�.�N�0��3��)��l�l�l�\���$#�#�#�J&�&�&�3#�3#�3#�3#�j:�:�:�:�.�.�.�.�.�.�.�!�!�!�&�&�&�
	A�	A�	A�	A�(�(�(��-�-�V�V��y��u�u�T�{�{�E�E�$�t�DT�DT�'U�'U�V�V�V�X�X��%*����D�	�	�"�H�H�H�4<�<�<�>�>�>�>����D�C�C�K�;�;�;�I�&�&�&�"���;�*�L����'�.�.�0�0����I�I�Irrc�l��eZdZ	dezZddddd�xZZdd��fd	�
Zd
�Zd�Z	d�Z
d
�Zd�Zd�Z
d�Z�xZS)rzSimpleHTTP/zapplication/gzip�application/octet-streamzapplication/x-bzip2zapplication/x-xz)z.gzz.Zz.bz2z.xzN��	directoryc���|�tj��}tj|��|_t	��j|i|��dSr*)�os�getcwd�fspathr�super�__init__)rrr��kwargs�	__class__s    �rr
z!SimpleHTTPRequestHandler.__init__�sG������	���I���9�-�-��������$�)�&�)�)�)�)�)rc���	|���}|rK	|�||j��|���dS#|���wxYwdSr*)�	send_head�copyfileror7�r�fs  r�do_GETzSimpleHTTPRequestHandler.do_GET�sd��"��N�N�����	�
��
�
�a���,�,�,����	�	�	�	�	�����	�	�	�	����		�	s�A
�
A c�`�	|���}|r|���dSdSr*)rr7rs  r�do_HEADz SimpleHTTPRequestHandler.do_HEAD�s7��#��N�N�����	�
�G�G�I�I�I�I�I�	�	rc�f�	|�|j��}d}tj�|���rCtj�|j��}|j�d��s�|�tj
��|d|d|ddz|d|df}tj�|��}|�d|��|�dd	��|�
��dSd
D]E}tj�||��}tj�|��r|}n�F|�|��S|�|��}|�d��r"|�tjd��dS	t)|d��}n1#t*$r$|�tjd��YdSwxYw	tj|�����}d
|jv�r6d|jv�r,	t2j�|jd
��}	|	j�%|	�t<jj ���}	|	jt<jj ur�t<j�!|j"t<jj ��}
|
�d���}
|
|	krI|�tj#��|�
��|�$��dSn##tJtLtNtPf$rYnwxYw|�tj)��|�d|��|�dtU|d����|�d|�+|j"����|�
��|S#|�$���xYw)Nr'rr
rr%��Locationr��0)z
index.htmlz	index.htmzFile not found�rbzIf-Modified-Sincez
If-None-Match)�tzinfo)�microsecond�Content-type�z
Last-Modified),�translate_pathrLr�isdir�urllib�parse�urlsplit�endswithr�r�MOVED_PERMANENTLY�
urlunsplitr�rfr��isfile�list_directory�
guess_typerH�	NOT_FOUND�open�OSError�fstat�filenorSr�r��parsedate_to_datetimerr��datetime�timezone�utc�
fromtimestamp�st_mtimer�r7�	TypeErrorrG�
OverflowErrorrD�OKr>r�)rrLr�parts�	new_parts�new_url�index�ctype�fs�ims�
last_modifs           rrz"SimpleHTTPRequestHandler.send_head�s���		��"�"�4�9�-�-����
�7�=�=����	1��L�)�)�$�)�4�4�E��:�&�&�s�+�+�	
��"�"�:�#?�@�@�@�"�1�X�u�Q�x��q��C��"�1�X�u�Q�x�1�	� �,�1�1�)�<�<��� � ��W�5�5�5�� � �!1�3�7�7�7�� � �"�"�"��t�2�
1�
1������T�5�1�1���7�>�>�%�(�(�� �D��E���*�*�4�0�0�0�����%�%���=�=����	��O�O�J�0�2B�C�C�C��4�	��T�4� � �A�A���	�	�	��O�O�J�0�2B�C�C�C��4�4�	����'	���!�(�(�*�*�%�%�B�#�t�|�3�3�'�t�|�;�;�(��+�;�;���%8�9�;�;�C��z�)�"�k�k��1B�1F�k�G�G���z�X�%6�%:�:�:�%-�%6�%D�%D��K��):�)>�&@�&@�
�&0�%7�%7�A�%7�%F�%F�
�%��,�,� �.�.�z�/F�G�G�G� �,�,�.�.�.��G�G�I�I�I�#'�4���'"�:�}�j�I�����D�����*
���z�}�-�-�-����^�U�3�3�3����-�s�2�a�5�z�z�:�:�:����_��%�%�b�k�2�2�
4�
4�
4��������H��	�
�G�G�I�I�I����sJ�G�*H
�H
�:P�*M�6CP�P�M4�1P�3M4�4B$P�P0c
��		tj|��}n1#t$r$|�tjd��YdSwxYw|�d����g}	tj�	|j
d���}n4#t$r'tj�	|j
��}YnwxYwtj
|d���}tj��}d|��}|�d	��|�d
��|�d��|�d|�d
���|�d|�d���|�d|�d���|�d��|D]�}tj
�||��}|x}	}
tj
�|��r
|dz}	|dz}
tj
�|��r|dz}	|�dtj�|
d����d
tj
|	d����d�����|�d��d�|���|d��}t-j��}|�|��|�d��|�tj��|�dd|z��|�dt;t=|������|���|S)NzNo permission to list directoryc�*�|���Sr*)rX)�as r�<lambda>z9SimpleHTTPRequestHandler.list_directory.<locals>.<lambda>s�����	�	�r)�key�
surrogatepass��errorsFr|zDirectory listing for z<!DOCTYPE HTML>z<html lang="en">z<head>z<meta charset="z">z<title>z</title>
</head>z<body>
<h1>z</h1>z	<hr>
<ul>r'�@z
<li><a href="z	</a></li>z</ul>
<hr>
</body>
</html>
r��surrogateescaperrztext/html; charset=%sr�) r�listdirr+rHrr)�sortr r!�unquoterL�UnicodeDecodeErrorr�r�r��getfilesystemencodingr�r�r�islinkr}r��io�BytesIOr��seekr�r6r�r>r2rf)
rrL�list�r�displaypath�enc�title�name�fullname�displayname�linkname�encodedrs
             rr'z'SimpleHTTPRequestHandler.list_directorys_��	�	��:�d�#�#�D�D���	�	�	��O�O��$�1�
3�
3�
3��4�4�		����
	
�	�	�)�)�	�*�*�*���	:� �,�.�.�t�y�6E�/�G�G�K�K��!�	:�	:�	:� �,�.�.�t�y�9�9�K�K�K�	:�����k�+�U�;�;�;���'�)�)��6��6�6��	���"�#�#�#�	���#�$�$�$�	�������	���*�3�*�*�*�+�+�+�	���3�5�3�3�3�4�4�4�	���,��,�,�,�-�-�-�	��������
	?�
	?�D��w�|�|�D�$�/�/�H�%)�)�K�(��w�}�}�X�&�&�
&�"�S�j���#�:���w�~�~�h�'�'�
)�"�S�j��
�H�H�H��|�)�)�(�1@�*�B�B�B�B��{�;�e�<�<�<�<�<�>�
?�
?�
?�
?�	
���2�3�3�3��)�)�A�,�,�%�%�c�+<�=�=���J�L�L��	�������	���q�	�	�	����:�=�)�)�)�����)@�3�)F�G�G�G����)�3�s�7�|�|�+<�+<�=�=�=��������s!��*A�A�#&B
�
.B;�:B;c��	|�dd��d}|�dd��d}|����d��}	tj�|d���}n/#t$r"tj�|��}YnwxYwtj|��}|�d��}td|��}|j
}|D]\}tj�
|��s|tjtjfvr�<tj�||��}�]|r|dz
}|S)N�?r
r�#r'rDrE)rBr@r#r r!rKrL�	posixpath�normpath�filterrrrL�dirname�curdir�pardirr�)rrL�trailing_slashr[�words     rrz'SimpleHTTPRequestHandler.translate_pathAsF��	��z�z�#�a� � ��#���z�z�#�a� � ��#�������/�/��4�4��	.��<�'�'��_�'�E�E�D�D��!�	.�	.�	.��<�'�'��-�-�D�D�D�	.�����!�$�'�'���
�
�3�����t�U�#�#���~���	,�	,�D��w���t�$�$�
����B�I�0F�(F�(F���7�<�<��d�+�+�D�D��	��C�K�D��s�"!B�)B0�/B0c�2�	tj||��dSr*)�shutil�copyfileobj)r�source�
outputfiles   rrz!SimpleHTTPRequestHandler.copyfile_s"��	�	��6�:�.�.�.�.�.rc���	tj|��\}}||jvr
|j|S|���}||jvr
|j|St	j|��\}}|r|SdS)Nr)r_�splitext�extensions_maprX�	mimetypesr()rrL�base�ext�guess�_s      rr(z#SimpleHTTPRequestHandler.guess_typeos���	��&�t�,�,�	��c��$�%�%�%��&�s�+�+��i�i�k�k���$�%�%�%��&�s�+�+��'��-�-���q��	��L�)�)r)rrrr�r�rn�_encodings_map_defaultr
rrrr'rrr(�
__classcell__�rs@rrr�s��������	�#�[�0�N�!�(�%�!�	/�/��N�+�)-�*�*�*�*�*�*�*�������V�V�V�p7�7�7�r���</�/�/� *�*�*�*�*�*�*rrc�@�	|�d��\}}}tj�|��}|�d��}g}|dd�D]:}|dkr|����|r|dkr|�|���;|r<|���}|r%|dkr|���d}n|dkrd}nd}|rd�||f��}dd�|��z|f}d�|��}|S)Nr]r'r&z..r(r6)�	partitionr r!rKrB�popr�r�)	rLrs�query�
path_parts�
head_parts�part�	tail_part�	splitpath�collapsed_paths	         r�_url_collapse_pathr��sJ����^�^�C�(�(�N�D�!�U��<����%�%�D����C���J��J��3�B�3��&�&���4�<�<��N�N�����
�	&�d�c�k�k����t�%�%�%���	��N�N�$�$�	��	��D� � ���� � � ��	�	��c�!�!��	���	��1��H�H�i��/�0�0�	��s�x�x�
�+�+�+�Y�7�I��X�X�i�(�(�N��rc��	trtS	ddl}n#t$rYdSwxYw	|�d��dan>#t$r1dtd�|���D����zaYnwxYwtS)Nrr&�nobodyrr
c3�&K�|]}|dV��
dS)rNr)r-r�s  rr/znobody_uid.<locals>.<genexpr>�s&����6�6�!��1��6�6�6�6�6�6r)r��pwd�ImportError�getpwnamr��max�getpwall)r�s r�
nobody_uidr��s���.�
���
���
�
�
�
�������r�r�����7����h�'�'��*�����7�7�7��S�6�6�s�|�|�~�~�6�6�6�6�6�6����7�����Ms��
$�$�A�8A?�>A?c�B�	tj|tj��Sr*)r�access�X_OK)rLs r�
executabler��s��#�
�9�T�2�7�#�#�#rc�X�eZdZ	eed��ZdZd�Zd�Zd�Z	ddgZ
d�Zd	�Zd
�Z
dS)r�forkrc��	|���r|���dS|�tjd��dS)NzCan only POST to CGI scripts)�is_cgi�run_cgirHrrmrgs r�do_POSTzCGIHTTPRequestHandler.do_POST�sS��	��;�;�=�=�	0��L�L�N�N�N�N�N��O�O��*�.�
0�
0�
0�
0�
0rc��	|���r|���St�|��Sr*)r�r�rrrgs rrzCGIHTTPRequestHandler.send_head�s7��;��;�;�=�=�	<��<�<�>�>�!�+�5�5�d�;�;�;rc�:�	t|j��}|�dd��}|dkrA|d|�|jvr0|�d|dz��}|dkr|d|�|jv�0|dkr"|d|�||dzd�}}||f|_dSdS)Nr'r
rTF)r�rL�find�cgi_directories�cgi_info)rr��dir_sep�head�tails     rr�zCGIHTTPRequestHandler.is_cgi�s���
	�,�D�I�6�6�� �%�%�c�1�-�-����k�k�.��'��":�d�>R�"R�"R�$�)�)�#�w�q�y�9�9�G���k�k�.��'��":�d�>R�"R�"R��Q�;�;�'����1�>�'�!�)�*�*�3M�$�D� �$�J�D�M��4��urz/cgi-binz/htbinc�"�	t|��Sr*)r�)rrLs  r�
is_executablez#CGIHTTPRequestHandler.is_executables��?��$���rc�t�	tj�|��\}}|���dvS)N)z.pyz.pyw)rrLrmrX)rrLr�r�s    r�	is_pythonzCGIHTTPRequestHandler.is_pythons1��<��W�%�%�d�+�+�
��d��z�z�|�|��.�.rc�R�	|j\}}|dz|z}|�dt|��dz��}|dkr}|d|�}||dzd�}|�|��}tj�|��r+||}}|�dt|��dz��}nn|dk�}|�d��\}}}	|�d��}|dkr|d|�||d�}}
n|d}}
|dz|
z}|�|��}tj�|��s%|�	tjd|z��dStj�|��s%|�	tj
d|z��dS|�|��}
|js|
s:|�|��s%|�	tj
d|z��dSt#jtj��}|���|d	<|jj|d
<d|d<|j|d
<t1|jj��|d<|j|d<t6j�|��}||d<|�|��|d<||d<|	|d<|jd|d<|j� d��}|r�|�!��}t|��dkr�ddl"}ddl#}|d|d<|d�$��dkr�	|d�%d��}|�&|���'d��}|�!d��}t|��dkr|d|d<n#|j(tRf$rYnwxYw|j� d���|j�*��|d<n|jd|d<|j� d��}|r||d<|j� d ��}|r||d!<|j�+d"d#��}d$�,|��|d%<|j� d&��}|r||d'<t[d|j�+d(g����}d)�,|��}|r||d*<d+D]}|�.|d���|�/tj0d,��|�1��|	�2d-d.��}|j�r�|
g}d/|vr|�3|��ti��}|j5�6��t	j7��}|dkr�t	j8|d��\}}tsj9|j:gggd��dr>|j:�;d��sn#tsj9|j:gggd��d�>t	j<|��}|r|�=d0|����dS		t	j>|��n#t~$rYnwxYwt	j@|j:�A��d��t	j@|j5�A��d��t	jB|||��dS#|j�C|jD|j��t	jEd1��YdSxYwddlF} |g}!|�|��rOt�jH}"|"�$���Id2��r|"dd3�|"d4d�z}"|"d5g|!z}!d/|	vr|!�3|	��|�Jd6| �K|!����	t�|��}#n#t�t�f$rd}#YnwxYw| �O|!| jP| jP| jP|�7��}$|j�$��d8kr!|#dkr|j:�;|#��}%nd}%tsj9|j:jQgggd��drH|j:jQ�Rd��sn(tsj9|j:jQgggd��d�H|$�S|%��\}&}'|j5�T|&��|'r|�=d9|'��|$jU�V��|$jW�V��|$jX}(|(r|�=d:|(��dS|�Jd;��dS)<Nr'r
rr]r6zNo such CGI script (%r)z#CGI script is not a plain file (%r)z!CGI script is not executable (%r)�SERVER_SOFTWARE�SERVER_NAMEzCGI/1.1�GATEWAY_INTERFACE�SERVER_PROTOCOL�SERVER_PORT�REQUEST_METHOD�	PATH_INFO�PATH_TRANSLATED�SCRIPT_NAME�QUERY_STRING�REMOTE_ADDR�
authorizationr�	AUTH_TYPE�basic�ascii�:�REMOTE_USERzcontent-type�CONTENT_TYPEzcontent-length�CONTENT_LENGTH�referer�HTTP_REFERER�acceptr�,�HTTP_ACCEPTz
user-agent�HTTP_USER_AGENT�cookiez, �HTTP_COOKIE)r��REMOTE_HOSTr�r�r�r�zScript output follows�+r��=zCGI script exit code r�zw.exe������z-uzcommand: %s)�stdin�stdoutr��env�postz%szCGI script exit status %#xzCGI script exited OK)Yr�r�r2rrrLrrx�existsrHrr)r&�	FORBIDDENr��	have_forkr��copy�deepcopy�environr��serverrrJr>rr:r r!rKr�rSrWrB�base64�binasciirXr��decodebytes�decode�Error�UnicodeError�get_content_type�get_allr�ra�
setdefaultr�r6r�r�r�r�rorpr��waitpid�selectrQ�read�waitstatus_to_exitcoderr�setuidr+�dup2r-�execve�handle_error�request�_exit�
subprocessr�r�r#r��list2cmdlinerFr4rD�Popen�PIPE�_sock�recv�communicater�r�r7r��
returncode))r�dir�restrL�i�nextdir�nextrest�	scriptdirrsrz�script�
scriptname�
scriptfile�ispyr��uqrestr�r�r��lengthr�r��ua�co�
cookie_str�k�
decoded_queryr�r��pid�sts�exitcoder��cmdline�interp�nbytes�p�datar�r��statuss)                                         rr�zCGIHTTPRequestHandler.run_cgis
��#��M�	��T��S�y�4����I�I�c�3�s�8�8�A�:�&�&���1�f�f��2�A�2�h�G��A�a�C�D�D�z�H��+�+�G�4�4�I��w�}�}�Y�'�'�
�#�X�T���I�I�c�3�s�8�8�A�:�.�.�����1�f�f�����,�,���a��
�I�I�c�N�N����6�6�����8�T�!�"�"�X�D�F�F���D�F��3�Y��'�
��(�(��4�4�
��w�~�~�j�)�)�	��O�O��$�)�J�6�
8�
8�
8�
�F��w�~�~�j�)�)�	��O�O��$�5�
�B�
D�
D�
D�
�F��~�~�j�)�)���>�	��	��%�%�j�1�1�
�����(�7�*�D�F�F�F����m�B�J�'�'��!%�!4�!4�!6�!6����!�[�4��M��#,��� �!%�!6���� ���!8�9�9��M�� $�������%�%�d�+�+��!��K��!%�!4�!4�V�!<�!<����'��M��#��N��!�0��3��M����(�(��9�9�
��	B�)�/�/�1�1�M��=�!�!�Q�&�&�'�'�'�'�'�'�'�'�#0��#3��K� � ��#�)�)�+�+�w�6�6�	B�(5�a�(8�(?�(?��(H�(H�
�(.�(:�(:�=�(I�(I�(.��w���&�
)6�(;�(;�C�(@�(@�
��}�-�-��2�2�1>�q�1A�C�
�.���%�N�L�9�����������<���N�+�+�3�"&�,�"?�"?�"A�"A�C����"&�,�~�">�C�����!�!�"2�3�3���	+�$*�C� �!��,�"�"�9�-�-���	*�")�C�����%�%�h��3�3�� �X�X�f�-�-��M��
�\�
�
�l�
+�
+��
�	(�%'�C�!�"�
�D�$�,�.�.�x��<�<�
=�
=���Y�Y�r�]�]�
��	,�!+�C�
��D�	"�	"�A��N�N�1�b�!�!�!�!����:�=�*A�B�B�B��������
�
�c�3�/�/�
��>�I	9��8�D��-�'�'����M�*�*�*��\�\�F��J�������'�)�)�C��a�x�x��:�c�1�-�-���S��m�T�Z�L�"�b�!�<�<�Q�?���:�?�?�1�-�-����m�T�Z�L�"�b�!�<�<�Q�?���4�S�9�9���G��N�N�#E�8�#E�#E�F�F�F���

���I�f�%�%�%�%�������D��������
�)�)�+�+�Q�/�/�/����
�)�)�+�+�Q�/�/�/��	�*�d�C�0�0�0�0�0��
���(�(���t�7J�K�K�K����
�
�
�
�
�
����
����!�l�G��~�~�j�)�)�
3�����<�<�>�>�*�*�7�3�3�7�#�C�R�C�[�6�"�#�#�;�6�F�!�4�.�7�2���%������u�%�%�%����]�J�,C�,C�G�,L�,L�M�M�M�
��V�������z�*�
�
�
�����
����� � ��'1��(2��(2��'*�	!�#�#�A��|�!�!�#�#�v�-�-�&�1�*�*��z���v�.�.������-���!1� 2�B��A�>�>�q�A�
��z�'�,�,�Q�/�/����-���!1� 2�B��A�>�>�q�A�
��]�]�4�0�0�N�F�F��J���V�$�$�$��
-����t�V�,�,�,�
�H�N�N����
�H�N�N�����\�F��
9����;�V�D�D�D�D�D�� � �!7�8�8�8�8�8sP�AO�O�O�/Z�\�
Z�\�Z�A1\�;]�3`�`�`N)rrrrlrr��rbufsizer�rr�r�r�r�r�rrrrr�s�����������F�#�#�I��H�0�0�0�<�<�<����4"�8�,�O� � � �/�/�/�
x9�x9�x9�x9�x9rrc��tj|tjtjd��}t	t|����\}}}}}||fS)N)�type�flags)r�getaddrinfo�SOCK_STREAM�
AI_PASSIVE�next�iter)�address�infos�familyr�proto�	canonname�sockaddrs       r�_get_best_familyr�sS����	�
�
���
�
�
�E�
04�D��K�K�/@�/@�,�F�D�%��H��8��rr�i@c��	t||��\|_}||_|||��5}|j���dd�\}}d|vrd|�d�n|}td|�d|�d|�d|�d�	��	|���n3#t$r&td	��tj	d
��YnwxYwddd��dS#1swxYwYdS)Nrr��[�]zServing HTTP on z port z	 (http://z/) ...z&
Keyboard interrupt received, exiting.r)
r�address_familyrJr�getsockname�print�
serve_forever�KeyboardInterruptr��exit)	�HandlerClass�ServerClass�protocolr�bind�addr�httpdr�url_hosts	         r�testr"�sw���
(8��d�'C�'C�$�K���$,�L�!�	��T�<�	(�	(��E��\�-�-�/�/����3�
��d�"%��+�+�;�t�;�;�;�;�4��
�
/�t�
/�
/�4�
/�
/��
/�
/�"&�
/�
/�
/�	
�	
�	
�	����!�!�!�!�� �	�	�	��;�<�<�<��H�Q�K�K�K�K�K�	������������������������s6�A
C�;B�C�-C�=C�?C�C�C�C�__main__z--cgi�
store_truezrun as CGI server)�action�helpz-bz--bind�ADDRESSz.bind to this address (default: all interfaces))�metavarr&z-dz--directoryz1serve this directory (default: current directory))�defaultr&z-pz
--protocol�VERSIONz3conform to this HTTP version (default: %(default)s))r(r)r&rr]z(bind to this port (default: %(default)s))r)r�nargsr&c�$��eZdZ�fd�Zd�Z�xZS)�DualStackServerc���tjt��5|j�tjtjd��ddd��n#1swxYwYt�����Sr�)	�
contextlib�suppress�	Exceptionr�
setsockopt�IPPROTO_IPV6�IPV6_V6ONLYr	r)rrs �rrzDualStackServer.server_binds�����$�Y�/�/�
@�
@���&�&��'��);�Q�@�@�@�
@�
@�
@�
@�
@�
@�
@�
@�
@�
@�
@����
@�
@�
@�
@��7�7�&�&�(�(�(s�1A�A�Ac�L�|�|||tj���dS)Nr)�RequestHandlerClassr�r)rr�r�s   r�finish_requestzDualStackServer.finish_requests4���$�$�W�n�d�/3�~�
%�
?�
?�
?�
?�
?r)rrrrr7rurvs@rr-r-sG�������	)�	)�	)�	)�	)�	?�	?�	?�	?�	?�	?�	?rr-)rrrrr)7r��__all__r�r/�email.utilsr�r��http.clientrNrOr�rorr_r�rhrr
r�r��urllib.parser rr�r�rr�ThreadingMixInr�StreamRequestHandlerrrr�r�r�r�rrr"r�argparser/�ArgumentParser�parser�add_argumentrrF�
parse_argsr��cgi�
handler_classr-rrrrrr�<module>rEs����d������
��������������������	�	�	�	���������	�	�	�	�����
�
�
�
�
�
�
�
�
�
�
�
�����
�
�
�
����������������� 7��	 �	 �	 �	 �	 ��'�	 �	 �	 ������,�5�z����q�q�q�q�q�\�>�q�q�q�h@*�@*�@*�@*�@*�5�@*�@*�@*�J,�,�,�`
��
�
�
� $�$�$�
C9�C9�C9�C9�C9�4�C9�C9�C9�L���-�(��4�d�����.�z����O�O�O�����
$�X�
$�
&�
&�F�
�����0��2�2�2�
����h�	�9��:�:�:�����m�Y�R�Y�[�[�<��=�=�=�����l�I� *�6��7�7�7������3�c�6��7�7�7������D��x�1�-�
�
�0�
�?�?�?�?�?�-�?�?�?�	�D�"�#�
�Y�
�Y���������Q�r

Zerion Mini Shell 1.0