%PDF- %PDF-
Mini Shell

Mini Shell

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

�

i��d�l����ddlZddlZddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZddl
mZ	ddlZdZdZdZd	ZGd
�de�ZGd�d
e�ZGd�de�Zy#e$rY�1wxYw)�N)�datetime)�Lock)�	find_spec)�sos_get_command_output�file�link�node�dirc���eZdZdZed��Zejd�ZdZ	dZ
e�Zd�Z
d�Zd�Zd	�Zd
�Zd�Zdd
�Zdd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zy)�Archivez!Abstract base class for archives.c��|jS)z6Returns the archive class's name as a string.
        )�__name__)�clss �-/usr/lib/python3/dist-packages/sos/archive.py�archive_typezArchive.archive_type(s���|�|���sos�unsetFc�.�d|j��d|��S)Nz	[archive:z] )r��self�msgs  r�_format_msgzArchive._format_msg5s��$(�$5�$5�$7��=�=rc��||_y�N)�_debug)r�debugs  r�	set_debugzArchive.set_debug8s	����rc�X�|jj|j|��yr)�log�errorrrs  r�	log_errorzArchive.log_error;s�������t�'�'��,�-rc�X�|jj|j|��yr)r �warningrrs  r�log_warnzArchive.log_warn>s��������)�)�#�.�/rc�X�|jj|j|��yr)r �inforrs  r�log_infozArchive.log_infoAs�����
�
�d�&�&�s�+�,rc�r�|jsy|jj|j|��yr)rr rrrs  r�	log_debugzArchive.log_debugDs'���{�{�������t�'�'��,�-rNc��t�r��NotImplementedError)r�src�dest�forces    r�add_filezArchive.add_fileL���!�!rc��t�rr,)r�contentr/�modes    r�
add_stringzArchive.add_stringOr2rc��t�rr,)rr4r/s   r�
add_binaryzArchive.add_binaryRr2rc��t�rr,)r�source�	link_names   r�add_linkzArchive.add_linkUr2rc��t�rr,�r�paths  r�add_dirzArchive.add_dirXr2rc��t�rr,)rr?r5�devices    r�add_nodezArchive.add_node[r2rc��t�)z�Return a temporary directory that clients of the archive may
        use to write content to. The content of the path is guaranteed
        to be included in the generated archive.r,�rs r�get_tmp_dirzArchive.get_tmp_dir^�
��"�!rc��t�)z�Return the maximum file name length this archive can support.
        This is the lesser of the name length limit of the archive
        format and any temporary file system based cache.r,rEs r�name_maxzArchive.name_maxdrGrc��y)aTReturn a string representing the path to the temporary
        archive. For archive classes that implement in-line handling
        this will be the archive file itself. Archives that use a
        directory based cache prior to packaging should return the
        path to the temporary directory where the report content is
        locatedN�rEs r�get_archive_pathzArchive.get_archive_pathjs��	
rc��y)z:Clean up any temporary resources used by an Archive class.NrKrEs r�cleanupzArchive.cleanupss��rc�$�|j�y)aFinalize an archive object via method. This may involve creating
        An archive that is subsequently compressed or simply closing an
        archive that supports in-line handling. If method is automatic then
        the following methods are tried in order: xz, gzipN)�close)r�methods  r�finalizezArchive.finalizews
��	
�
�
�r�NF��w)r�
__module__�__qualname__�__doc__�classmethodr�logging�	getLoggerr �_namerr�
_path_lockrrr"r%r(r*r1r6r8r<r@rCrFrIrLrNrRrKrrrr%s���+�����
�'�
�
�E�
"�C��E�
�F���J�>��.�0�-�.�"�"�"�"�"�"�"�"�
�
�rrc��eZdZdZdZdZdZ	dd�Zd�Zd�Z	dd�Z
dd�Zd	�Zdd
�Z
dd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zdd�Zd�Zd�Zd�Zd�Zd�Zd�Zy)�FileCacheArchivezd Abstract superclass for archive types that use a temporary cache
    directory in the file system. �Nc��||_tjj|j|g�|k(r%tjj	||�|_||_||_||_||_|xsd|_	||_
tjj||�|_|j5tj|jd�ddd�|jd|j�d��y#1swY�)xYw)N�/�z'initialised empty FileCacheArchive at '�')r\�osr?�commonprefix�relpath�_tmp_dir�_policy�_threads�enc_opts�sysroot�manifest�join�
_archive_rootr]�makedirsr()r�name�tmpdir�policy�threadsrkrlrms        r�__init__zFileCacheArchive.__init__�s�����
�
�7�7������V� 4�5��?�������v�6�D�J���
������
� ��
��~�#��� ��
��W�W�\�\�&�$�7���
�_�_�	3��K�K��*�*�E�2�	3��
�
��)�)�,�	-�	3�	3�s�:!D�Dc���tjj|�r|jtj�}tjj|j|�Sr)rer?�isabs�lstrip�seprnro)rrqs  r�	dest_pathzFileCacheArchive.dest_path�s?��
�7�7�=�=����;�;�r�v�v�&�D������T�/�/��6�7rc���|jr|j|j�r|S|dtjk(r|dd}tjj|j|�S)Nr�)rl�
startswithreryr?rnr>s  r�join_sysrootzFileCacheArchive.join_sysroot�sQ���|�|�t���t�|�|�<��K���7�b�f�f�����8�D��w�w�|�|�D�L�L�$�/�/rc���|jd|z�|j�|}�fd�}|jd�s|}nRtjj|j
|��r|n!tjj|�d}|}g}|dk7rE|dk7r@tjj|�\}}	|j|	�|}|dk7r|dk7r�@|j��}
d}|D�]�}tjj|
|�}
||
�s�-tjj||�}tjj|
�r�m|jd|
z�tjj|��rtjj|�r�tj|�}
tjj|�d}tjj||
�}|j||��}tjj|�}tjj!|
�r tjj#|
|�}
|jd|
�d	|
�d
��tj$|
|
����|jd|
z�tj&|
|�|}���|S)a�Create leading path components

            The standard python `os.makedirs` is insufficient for our
            needs: it will only create directories, and ignores the fact
            that some path components may be symbolic links.

            :param src: The source path in the host file system for which
                        leading components should be created, or the path
                        to an sos_* virtual directory inside the archive.

                        Host paths must be absolute (initial '/'), and
                        sos_* directory paths must be a path relative to
                        the root of the archive.

            :param mode: An optional mode to be used when creating path
                         components.
            :returns: A rewritten destination path in the case that one
                      or more symbolic links in intermediate components
                      of the path have altered the path destination.
        zMaking leading paths for %sc�b��|jtjj�d��S)z>Test whether path ``path`` is inside the archive.
            r`)r}rer?rn)r?�roots �r�
in_archivez8FileCacheArchive._make_leading_paths.<locals>.in_archive�s#����?�?�2�7�7�<�<��b�#9�:�:rrbrr`zMaking path %s�r5zMaking symlink '�' -> 'rdzMaking directory %s)r*ror}rer?�isdirr~�split�append�reversern�exists�islink�readlink�_make_leading_paths�normpathrwrg�symlink�mkdir)rr.r5r/r��src_dirr?�
path_comps�head�tail�abs_path�src_path�comp�target�
target_dir�
target_srcr�s                @rr�z$FileCacheArchive._make_leading_paths�sH���*	
���4�s�:�;��!�!����	;�
�~�~�c�"��G�!�g�g�m�m�D�,=�,=�c�,B�C�s��G�G�M�M�#�.�q�1�
����
��c�k�d�b�j������t�,�J�D�$����d�#��D��c�k�d�b�j�	���������%	$�D��w�w�|�|�H�d�3�H��h�'���w�w�|�|�H�d�3�H��7�7�>�>�(�+����/�(�:�;��7�7�>�>�(�+����
�
�h�0G��[�[��2�F�"$�����x�!8��!;�J�"$�����j�&�!A�J� �3�3�J�T�3�J�D��7�7�+�+�D�1�D��w�w�}�}�V�,�!#�������!D���N�N�$,�f�$6�7��J�J�v�x�0��N�N�#8�8�#C�D��H�H�X�t�,�#�D�K%	$�N�rc��|xs|j|�}|tk(r|}n"tjj	|�d}|s|Stjj|�r-tjj
|�std|z��tjj|�s>|tk(r|n!tjj	|�d}|j|�d�}|r|Stjj|�r�tj|�}d}	|tk(r/tj|j�st|	|dfz��|tk(r/tj|j�st|	|dfz��|t k(r"||j�st|	|dfz��|tk(r/tj"|j�st|	|dfz��y	|S)
a4Check a new destination path in the archive.

            Since it is possible for multiple plugins to collect the same
            paths, and since plugins can now run concurrently, it is possible
            for two threads to race in archive methods: historically the
            archive class only needed to test for the actual presence of a
            path, since it was impossible for another `Archive` client to
            enter the class while another method invocation was being
            dispatched.

            Deal with this by implementing a locking scheme for operations
            that modify the path structure of the archive, and by testing
            explicitly for conflicts with any existing content at the
            specified destination path.

            It is not an error to attempt to create a path that already
            exists in the archive so long as the type of the object to be
            added matches the type of object already found at the path.

            It is an error to attempt to re-create an existing path with
            a different path type (for example, creating a symbolic link
            at a path already occupied by a regular file).

            :param src: the source path to be copied to the archive
            :param path_type: the type of object to be copied
            :param dest: an optional destination path
            :param force: force file creation even if the path exists
            :returns: An absolute destination path if the path should be
                      copied now or `None` otherwise
        rz'path '%s' exists and is not a directoryc��ttj|�tj|�tj|�tj
|�g�Sr)�any�stat�S_ISBLK�S_ISCHR�S_ISFIFO�S_ISSOCKr�s r�
is_specialz/FileCacheArchive.check_path.<locals>.is_special1sD������T�"����T�"��
�
�d�#��
�
�d�#�	��
rz path '%s' exists and is not a %szregular filez
symbolic linkzspecial file�	directoryN)rz�P_DIRrer?r�r�r��
ValueErrorr��lstat�P_FILEr��S_ISREG�st_mode�P_LINK�S_ISLNK�P_NODE�S_ISDIR)
rr.�	path_typer/r0�dest_dirr�r��st�ve_msgs
          r�
check_pathzFileCacheArchive.check_paths���>�*�t�~�~�c�*������H��w�w�}�}�T�*�1�-�H���K��7�7�>�>�(�#�B�G�G�M�M�(�,C��F�%�&�'�
'�������)�&�%�/�c�R�W�W�]�]�3�5G��5J�G��$�$�W�-�	���K��7�7�>�>�$�����$��B�7�F��F�"�4�<�<��
�
�+C� ��4��*@�!@�A�A��F�"�4�<�<��
�
�+C� ��4��*A�!A�B�B��F�"�:�b�j�j�+A� ��4��*@�!@�A�A��E�!�$�,�,�r�z�z�*B� ��4��*=�!=�>�>���rc���	tj|�}|jd�s|jd�rDtj||�tj
||j|jf��ntj||�tj||j|j�y#t$r"}|jd|�d|�d��Yd}~yd}~wwxYw)N�/sys/�/proc/)�nszcaught 'z' setting attributes of 'rd)rer�r}�shutil�copymode�utime�st_atime_ns�st_mtime_ns�copystat�chown�st_uid�st_gid�	Exceptionr*)rr.r/r��es     r�_copy_attributesz!FileCacheArchive._copy_attributesMs���
	(��7�7�3�<�D��~�~�g�&�#�.�.��*B�����T�*�����4�#3�#3�T�5E�5E�"F�G�����T�*��H�H�T�4�;�;����4���	(��N�N���'�
(�
(��	(�s�B<B?�?	C*�C%�%C*c	��|j5|s|}|j|t|��}|s
	ddd�yt|dd�s/	t	j
||�|j||�d|z}nA|jd	�t|d
�5}|D]}|j|��	ddd�d}|jd|�d
|j�d��ddd�y#t$rE}|jd�s|jd�rn|jd|�d|�d��Yd}~��d}~wwxYw#1swY��xYw#1swYyxYw)N�r0�readr�r�zFile z not collected: 'rdz'%s'rrUz	open filezadded z to FileCacheArchive ')r]r�r��getattrr��copy�OSErrorr}r(r��seek�open�writer*ro)rr.r/r0r��	file_name�f�lines        rr1zFileCacheArchive.add_file[s7��
�_�_�!	<�����?�?�4��u�?�=�D���
!	<�!	<��3���-�P��K�K��T�*��%�%�c�4�0�"�S�L�	�������$��_�&�� #�&������
�&�&�(�	��N�N�%�t�'9�'9�;�
<�A!	<�!	<���P��~�~�g�.�#�.�.��2J���
�
�s�A�&N�O���P��&�&��7!	<�!	<�sR� D;�
D;�C�5D;�D/�),D;�	D,�';D'�"D;�'D,�,D;�/D8	�4D;�;Ec��|j5|}|j|td��}tj||d��}t|t�r|jdd�}|j|�tjj|�r|j||�|jd|�d|j�d	��ddd�y#1swYyxYw)
NTr��utf-8��encoding�utf8�ignorezadded string at 'z' to FileCacheArchive 'rd)r]r�r��codecsr��
isinstance�bytes�decoder�rer?r�r�r*ro)rr4r/r5r.r�s      rr6zFileCacheArchive.add_strings���
�_�_�	8��C��?�?�4��t�?�<�D����D�$��9�A��'�5�)�!�.�.���:��
�G�G�G���w�w�~�~�c�"��%�%�c�4�0��N�N�!�4�#5�#5�7�
8�	8�	8�	8�s�B9C�Cc� �|j5|j|t�}|s
	ddd�ytj|dd��}|j|�|j
d|�d|j�d��ddd�y#1swYyxYw)N�wbr�zadded binary content at 'z' to archive 'rd)r]r�r�r�r�r�r*ro)rr4r/r�s    rr8zFileCacheArchive.add_binary�sz��
�_�_�	9��?�?�4��0�D���	9�	9�
���D�$��6�A�
�G�G�G���N�N�"�D�$6�$6�8�
9�	9�	9�	9�s�B�AB�B
c
���|jd|�d|�d��|j5|j|t�}|s
	ddd�ytj
j
|�s;t	j||�|jd|�d|�d|j�d��ddd�|jd|�d|�d	���tj
j|�}tj
jtj
j||��}|j|�}d
�}tj
j|��s�tj
j|�r�|}tj
j|�}tj
j|t	j|��}tj
j!||�}|||�r|jd|�d|�d
��y|jd|�d|�d��|j#||�ytj
j%|�r&|jd|z�|j'|�ytj
j)|�r&|jd|z�|j+|�y|jd|�d|���yy#1swY��7xYw)Nzadding symlink at 'r�rdzadded symlink at 'z' to 'z' in archive 'zLink follow up: source=z link_name=z dest=c��tjj|�}tjj|�s=tjj	tjj||��}tjj	|�}||k(ry	tj|�y#t$r}|jdk(rYd}~y�d}~wwxYw)z�Return ``True`` if the symbolic link ``link_name`` is part
                of a file system loop, or ``False`` otherwise.
            T�(NF)	rer?�dirnamerw�realpathrnr�r��errno)r;r:�link_dirr�s    r�is_loopz*FileCacheArchive.add_link.<locals>.is_loop�s����w�w���y�1�H��7�7�=�=��(����)�)�"�'�'�,�,�x��*H�I�����(�(��3�I��F�"��
����	�"�
��	�
��7�7�b�=����
�s�"B8�8	C�C�C�CzLink 'z' - 'z' loops: skipping...zAdding link z -> z for link follow upz Adding dir %s for link follow upz!Adding file %s for link follow upzNo link follow up: source=)r*r]r�r�rer?�lexistsr�ror�r�rnrzr�r�r�rgr<r�r@�isfiler1)	rr:r;r/�
source_dir�host_path_name�dest_path_namer�r�s	         rr<zFileCacheArchive.add_link�s"�����9�f�M�N�
�_�_�	E��?�?�9�f�5�D���	E�	E�
�7�7�?�?�4�(��
�
�6�4�(����"&���0B�0B� D�E�	E�	
����	�4�1�	2��W�W�_�_�Y�/�
����)�)�"�'�'�,�,�z�6�*J�K������7��	�.�w�w�~�~�n�-��w�w�~�~�n�-�*�	��7�7�?�?�9�5�������h����N�0K�L���������:���9�f�-��N�N�$-�v�$7�8����� )�6� 3�4��
�
�f�i�0������~�.����A�F�J�K����^�,�������/����B�V�K�L��
�
�n�-���� &�	� 3�4�/.�W	E�	E�s�K�AK�K!c�r�|j5|j|t�ddd�y#1swYyxYw)zmCreate a directory in the archive.

            :param path: the path in the host file system to add
        N)r]r�r�r>s  rr@zFileCacheArchive.add_dir�s.���_�_�	)��O�O�D�%�(�	)�	)�	)�s�-�6c�h�|j|t�}|sytjj	|�s+	tj
|||�|j||�yy#t$rC}|jtjk(rd}|jd|�d|�d��Yd}~y|�d}~wwxYw)NzOperation not permittedz
add_node: z
 - mknod 'rd)r�r�rer?r��mknodr�r��EPERMr(r�)rr?r5rBr/r�rs       rrCzFileCacheArchive.add_node�s������t�V�,�����w�w�~�~�d�#�
�����t�V�,�
�!�!�$��-�$���
��7�7�e�k�k�)�3�C��M�M��d�"K�L�����
�s�A%�%	B1�.7B,�*B,�,B1c��dtjvr3tjd}tj|j|�Sy)N�PC_NAME_MAX�)re�pathconf_names�pathconfro)r�pc_name_maxs  rrIzFileCacheArchive.name_max�s:���B�-�-�-��+�+�M�:�K��;�;�t�1�1�;�?�?�rc��|jSr�rorEs rrFzFileCacheArchive.get_tmp_dir����!�!�!rc��|jSrr�rEs rrLz!FileCacheArchive.get_archive_pathr�rc���tjtjj|j|�|��|jd|�d|j�d��y)zsCreate path, including leading components.

            Used by sos.sosreport to set up sos_* directories.
        r�zcreated directory at 'z' in FileCacheArchive 'rdN)rerpr?rnror*)rr?r5s   rrpzFileCacheArchive.makedirs
sC��
	���B�G�G�L�L��!3�!3�T�:��F������ 2� 2�4�	5rc�V�|j|�}tj|ddd��S)N�rr�r�)r��errors)rzr�r�r>s  r�	open_filezFileCacheArchive.open_files%���~�~�d�#���{�{�4��w�x�H�Hrc��tjj|j�r t	j
|j�yyr)rer?r�ror��rmtreerEs rrNzFileCacheArchive.cleanups/��
�7�7�=�=��+�+�,��M�M�$�,�,�-�-rc��tj�}|jj}||z
}|jj	d|�|jj	d|�|jj	d|�|j|jj
d��tjjdd��y)	z�Adds component-agnostic data to the manifest so that individual
        SoSComponents do not need to redundantly add these manually
        �end_time�run_time�compression�)�indent�sos_reportsz
manifest.jsonN)
r�nowrm�
start_time�	add_fieldr6�get_jsonrer?rn)rrQ�end�startr�s     r�add_final_manifest_dataz(FileCacheArchive.add_final_manifest_datas����l�l�n���
�
�(�(����;���
�
���
�C�0��
�
���
�H�5��
�
���
�v�6�����
�
�.�.�a�.�8������]�O�D�	Frc�t�|j|j�|_tjj	|j
|j�}tj|j|�||_tjj	|j
|j��|_	y)zeRename the archive to an obfuscated version using an initialized
        SoSCleaner instance
        N)
�obfuscate_stringr\rer?rnrh�renamerorq�
_archive_name)r�cleaner�	_new_roots   r�rename_archive_rootz$FileCacheArchive.rename_archive_root(ss���-�-�d�j�j�9��
��G�G�L�L�����
�
�;�	�
�	�	�$�$�$�i�0�&����W�W�\�\�$�-�-�����E��rc�2�|jd|j�d|�d��	|j|�}|j
�|jd|jtj|j�jfz�|jdr	|j|�S|S#t$r.}|j	d|z�|j�cYd}~Sd}~wwxYw#t$r$}d}|j	|�d|���|cYd}~Sd}~wwxYw)	Nzfinalizing archive 'z' using method 'rdz-An error occurred compressing the archive: %szbuilt archive at '%s' (size=%d)�encryptz)An error occurred encrypting the archive:� )
r(ro�_build_archiver�r"rqrNrrer��st_sizerk�_encrypt)rrQ�res�errr��exp_msgs      rrRzFileCacheArchive.finalize2s���
�
��+�+�V�5�	6�	��%�%�f�-�C�	
�����
�
�7�4�;M�;M��g�g�d�0�0�1�9�9�;;�;�	<��=�=��#�
��}�}�S�)�)��J��#�	��N�N�J� �!�
"��9�9�;���	���
�E�����'�1�5�6��
��
�s;�B/�C)�/	C&�8#C!�C&�!C&�)	D�2D�D�Dc���|jdd�}|dz
}d|z}d}|jdr|d|jdzz
}||z
}|jdr5d	|jdjd
d�z}d|i}|d
z
}d|z}||z
}t|d|��}|ddk(r|S|ddk(r)|jdr
d}t|��d}t|��d|dz}t|��)a�Encrypts the compressed archive using GPG.

        If encryption fails for any reason, it should be logged by sos but not
        cause execution to stop. The assumption is that the unencrypted archive
        would still be of use to the user, and/or that the end user has another
        means of securing the archive.

        Returns the name of the encrypted archive, or raises an exception to
        signal that encryption failed and the unencrypted archive name should
        be used.
        z
sosreport-zsecured-sosreport-z.gpgzgpg --batch -o %s N�keyz--trust-model always -e -r %s �passwordz%sz'"r`�sos_gpgz-c --passphrase-fd 0 z!/bin/bash -c "echo $sos_gpg | %s"r)�timeout�env�status�zSpecified key not in keyringzCould not read passphrasezgpg exited with code %s)�replacerkrr�)r�archive�arc_name�enc_cmdr �passwdr�rs        rrzFileCacheArchive._encryptJs+���?�?�<�1E�F���F���&��1�����=�=���
�7�$�-�-��:N�N�N�G��w��G��=�=��$��D�M�M�*�5�=�=�e�R�H�H�F��f�%�C��.�.�G�;�g�E�G��w��G�"�7�A�3�?���X�;�!���O�
�x�[�A�
��}�}�U�#�4����n��2��
��n��,�a��k�9�C���n�rr)rcrSrT)rrVrWrXrhrorrurzr~r�r�r�r1r6r8r<r@rCrIrFrLrpr�rNr
rrRrrKrrr_r_�s���&��H��M��M��-�$8�
0�Z�xI�V(�"<�H8�&	9�E4�N)�.� �"�"�5�I�.�F�F��0)rr_c�X��eZdZdZdZdZ	d�fd�	Zdd�Zd�Zd�Z	d�Z
�fd	�Zd
�Z�xZ
S)�TarFileArchivez: archive class using python TarFile to create tar archivesNFc	���tt|�|||||||�d|_tj
j
||j��|_y)N�tar)	�superr)ru�_suffixrer?rnrqr)	rrqrrrsrtrkrlrm�	__class__s	        �rruzTarFileArchive.__init__|sI���
�n�d�,�T�6�6�7�-5�w��	J�����W�W�\�\��D�I�I�K�
��rc��|j|_d|jz|jd<d|jz|jd<|r||_n|j|_|j|_|j|_
y)Nz%.9f�atime�ctime)�st_mtime�mtime�st_atime�pax_headers�st_ctimer5r�r��uidr��gid)r�tar_info�fstatr5s    r�set_tarinfo_from_statz$TarFileArchive.set_tarinfo_from_stat�sj�������(.����(?����W�%�(.����(?����W�%�� �H�M�!�M�M�H�M��|�|����|�|��rc���|jttjj	|j
�d�d��s|j
�gd�}t
�fd�|D��ry	tj��}|jr"|j��}|r||jd<|j||�|S#t$r|cYSwxYw)N���)z
/version.txt$z/sos_logs(/.*)?z/sos_reports(/.*)?c3�J�K�|]}tj|�����y�wr)�re�match)�.0�skip�	orig_paths  �r�	<genexpr>z9TarFileArchive.copy_permissions_filter.<locals>.<genexpr>�s�����;�T�r�x�x��i�(�;�s� #zRHT.security.selinux)
rq�lenrer?r�ror�r�r��_with_selinux_context�get_selinux_contextr5r;)r�tarinfo�skipsr:�contextrCs     @r�copy_permissions_filterz&TarFileArchive.copy_permissions_filter�s�����L�L��R�W�W�]�]�4�3E�3E�%F�r�%J�!K�!L�M�	���*�*�I�J���;�U�;�;��	��G�G�I�&�E��%�%��.�.�y�9�G��>E��#�#�$:�;��"�"�7�E�2�����	��N�	�s�,C�C�Cc�V�	tj|�\}}|S#t$rYywxYwr)�selinux�
getfileconr�)rr?�rc�cs    rrGz"TarFileArchive.get_selinux_context�s2��	��(�(��.�G�R���H���	��	�s��	(�(c�8�|j�d|j��S)N�.)ror-rEs rrqzTarFileArchive.name�s���,�,�d�l�l�;�;rc�(��tt|��Sr)r,r)rI)rr.s �rrIzTarFileArchive.name_max�s����^�T�3�5�5rc���|dk(rtd��dnd}|jd�}|jd|zz|_|dk(rddi}nd	d
i}tj|jfdd|zi|��}d
D]�}t
jjt
jj|j|��s�K|jt
jj|j|�|j�d|������|j|j|j|j��|j�|xjd|zz
c_|j�S)N�auto�lzma�xz�gzip�ipz.%s�
compresslevel��preset�r5zw:%s)zversion.txtr�sos_logsrb)�arcname)r_�filter)r�stripr�tarfiler�rer?r�rnro�addr\rKrPr-rq)rrQ�
_comp_mode�kwargsr+�_contents      rrzTarFileArchive._build_archive�sO���V��&�v�.�:�T��F��\�\�$�'�
�!�/�/�%�*�2D�D����V��%�q�)�F���]�F��l�l�4�-�-�%�F�Z�4G�%�#�%��C�	�H��7�7�>�>�"�'�'�,�,�t�/A�/A�8�"L�M���G�G������T�/�/��:��:�:�,�a��z�2�
�
�	�	����"�"�D�J�J��3�3�	�	5��	�	������
�*�*���y�y�{�rr)rrVrWrXrQrFrur;rKrGrqrIr�
__classcell__)r.s@rr)r)vs9���D�
�F�!���
�	$��$�<�6�
rr))rerbr�rZr�r�r�r?r�	threadingr�importlib.utilr�
sos.utilitiesrrM�ImportErrorr�r�r�r��objectrr_r)rKrr�<module>rms���
��
��
���	���$�0�	��
��	��	��
��X�f�X�vs�w�s�lY�%�Y��u�	��	�s�A(�(A0�/A0

Zerion Mini Shell 1.0