%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/samba/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/samba/__pycache__/safe_tarfile.cpython-312.pyc

�

��d���b�ddlZddlZddlmZddlmZmZmZGd�de�ZejZy)�N)�Path)�ExtractError�TarInfo�TarFilec���eZdZdZ	eej�Z�xZS#e$r*ddd��fd�Z	d
dd��fd�Z
d�Zd�Zd�Z
d	�Zd
�Zd�ZY�xZSwxYw)rz�This TarFile implementation is trying to ameliorate CVE-2007-4559,
    where tarfile.TarFiles can step outside of the target directory
    using '../../'.
    F��
numeric_ownerc�L��|j�t�|�	||||��y)N)�	set_attrsr	)�_safetarfile_check�super�extract)�self�member�pathrr	�	__class__s     ��4/usr/lib/python3/dist-packages/samba/safe_tarfile.pyrzTarFile.extract$s)����#�#�%��G�O�F�D�I�*7�
�
9�c�J��|j�t�|�	|||��y)Nr)rr
�
extractall)rr�membersr	rs    �rrzTarFile.extractall*s(����#�#�%��G��t�W�-:�
�
<rc�*�|j�D]�}|j|��rtd|j����|j	|��rtd|j
����|j
|��s�jtd|j
����y)N)�tarinfoz*Attempted directory traversal for member: z6Attempted directory traversal via symlink for member: z3Attempted directory traversal via link for member: )�__iter__�_is_traversal_attemptr�name�_is_unsafe_symlink�linkname�_is_unsafe_link�rrs  rrzTarFile._safetarfile_check/s����=�=�?�
7���-�-�g�-�>�&�#�#*�<�<�.�2�3�3��*�*�7�*�;�&�#�#*�#3�#3�"4�6�7�7��'�'��'�8�&�#�#*�#3�#3�"4�6�7�7�
7rc�z�tjjtjj|��S�N)�osr�realpath�abspath)rrs  r�
_resolve_pathzTarFile._resolve_path>s$���7�7�#�#�B�G�G�O�O�D�$9�:�:rc�~�|jtjj||��j	|�Sr")r&r#r�join�
startswith)rr�basedirs   r�_is_path_in_dirzTarFile._is_path_in_dirAs4���%�%�b�g�g�l�l�7�&*�',�-�-7�Z��-@�
Arc��|jjtj�sdtjz|jvryy)Nz..TF)rr)r#�sepr s  rrzTarFile._is_traversal_attemptEs2�����'�'����/�����-�7�<�<�/��rc�2�|j�r�ttjj	tjjtj�|j���}|j|tj��syy�NTF)	�issymrr#r�normpathr(�getcwdrr+)rr�symlink_files   rrzTarFile._is_unsafe_symlinkKse���}�}��#��G�G�$�$�R�W�W�\�\�"�)�)�+�%,�%5�%5�&7�8� 9���+�+�L�"�)�)�+�F��rc�2�|j�r�ttjj	tjjtj�|j���}|j|tj��syyr/)	�islnkrr#rr1r(r2rr+)rr�	link_files   rrzTarFile._is_unsafe_linkTsh���}�}�� ��G�G�$�$�R�W�W�\�\�"�)�)�+�29�2B�2B�&D�E�F�	��+�+�I�r�y�y�{�C��r)�Tr")�__name__�
__module__�__qualname__�__doc__�staticmethod�tarfile�
tar_filter�extraction_filter�AttributeErrorrrrr&r+rrr�
__classcell__)rs@rrrsh����
=�)��);�);�<����8�	9�"'�	9�	<�%�	<�

	7�	;�	A�	�	�	�c8�s��)A�
Ar)	r#r=�pathlibrrrr�
UnsafeTarFile�open�rr�<module>rFs0��$
���C�C�C�m�C�L�|�|�r

Zerion Mini Shell 1.0