| Server IP : 146.190.157.162 / Your IP : 216.73.217.110 Web Server : Apache System : Linux ubuntu-s-2vcpu-4gb-amd-sfo3-01-KIT-DIGITAL 6.5.0-44-generic #44-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 7 15:10:09 UTC 2024 x86_64 User : businessweek ( 639) PHP Version : 8.2.10-2ubuntu2.2 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_signal,pcntl_signal_dispatch,pcntl_getpriority,pcntl_setpriority,dl,putenv,parse_ini_file,show_source MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/lib/python3/dist-packages/apport/__pycache__/ |
Upload File : |
�
��d�V � �J � d Z ddlZddlZddlZddlZddlZddlZddlZddl Z ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlmZ ddlmZ ddlmZ e
j � dd� � Ze
j � dd � � Zd
ZdZdZ G d
� dej j � � Z!d� Z"d� Z#d� Z$d� Z%d� Z&d� Z'd� Z(d� Z)d� Z*d� Z+ ej, d� � Z-dej. dej/ e0e0f fd�Z1ej2 dej/ e0e0f fd�� � Z3de4fd�Z5de4fd�Z6d � Z7d!� Z8d"� Z9d#� Z:d$� Z;d%� Z<d&ed'e0ddfd(�Z=d=d)�Z>d*� Z?ej2 d+e0dej@ fd,�� � ZAd>d.�ZBd/e0de4fd0�ZCd1� ZDd2� ZEd3� ZFd4e4deGe0e0f fd5�ZHd=d6�ZId?d7�ZJd8� ZKd9� ZLd:� ZMd&ed'e0dee0 fd;�ZNd<� ZOdS )@z0Functions to manage apport problem report files.� N)�Optional)�impl)�
ProblemReport�APPORT_REPORT_DIRz
/var/crash�APPORT_COREDUMP_DIRz/var/lib/apport/coredump� z~/.config/apport/settingsz/run/snapd.socketc � � e Zd Zd� Zd� ZdS )�UHTTPConnectionc �^ � t j j � | d� � || _ d S )N� localhost)�http�client�HTTPConnection�__init__�path)�selfr s �2/usr/lib/python3/dist-packages/apport/fileutils.pyr zUHTTPConnection.__init__1 s( � ���"�+�+�D�+�>�>�>��� � � � c � � t j t j t j � � }|� | j � � || _ d S �N)�socket�AF_UNIX�SOCK_STREAM�connectr �sock)r r s r r zUHTTPConnection.connect5 s7 � ��}�V�^�V�-?�@�@�����T�Y������ � � r N)�__name__�
__module__�__qualname__r r � r r r
r
0 s2 � � � � � �� � �� � � � r r
c � � t j dt j � � sdS g d�} t j | � � dk S # t
$ r Y dS w xY w)z)Check whether crash reporting is enabled.z/usr/bin/whoopsieT)z/bin/systemctlz-qz
is-enabledz
whoopsie.pathr F)�os�access�X_OK�
subprocess�call�OSError)�cmds r �allowed_to_reportr( ; se � �
�9�(�"�'�2�2� ��t��E�E�E����s�#�#�q�(�(��� � � ��u�u����s �? �
A
�A
c � � | sdS | � d� � sdS d| v rdS dD ] }|| v r dS �
| � d� � }t |� � dk rdS |d S )z'Extract the socket from a DBus address.Nzunix:path=/run/user/z../)�%�,�;�=� � )�
startswith�split�len)� dbus_addr�search�partss r �get_dbus_socketr6 G s� � �� ��t� ��� 6�7�7� ��t�
� ����t� "� � ���Y����4�4� �
�O�O�C� � �E�
�5�z�z�Q����t���8�Or c �n � | �dS d}t j | � � D ]�}|� d� � r�|� d� � s|� d� � s�B|r dS t |d� � 5 }d|� � � vr|}ddd� � n# 1 swxY w Y ��# t $ r Y ��w xY w��|S )z�Return a package's .desktop file.
If given package is installed and has a single .desktop file, return the
path to it, otherwise return None.
Nz.desktopz/etc/xdg/autostartz/usr/share/applications/�rbs NoDisplay=true)� packaging� get_files�endswithr0 �open�read�FileNotFoundError)�package�desktopfile�line�fs r �find_package_desktopfilerC a s3 � � ���t��K��#�G�,�,� � ���=�=��$�$� ��?�?�#7�8�8�
����*�B� B�
� ��
��t�t�
��$��%�%� +��(������8�8�&*��+� +� +� +� +� +� +� +� +� +� +���� +� +� +� +��� %�
�
�
���
���� �$ �s6 �#B$�3B�B$�B �B$�B � B$�$
B1�0B1c � � g d�}d}|D ]}| � |� � rd} n�|o+| � d� � o| � d� � S )a2 Check whether the given file is likely to belong to a package.
This is semi-decidable: A return value of False is definitive, a True value
is only a guess which needs to be checked with find_file_package().
However, this function is very fast and does not access the package
database.
) z/bin/z/bootz/etc/z/initrdz/libz/sbin/z/optz/usr/z/varFTz/usr/local/z /var/lib/)r0 )�file�
pkg_allowlist�allowlist_match�is r �likely_packagedrI � s� � �
�
�
�M� �O�
� � ���?�?�1��� �"�O��E� � � -����
�.�.�.� -�����,�,�,�r c �L � t j � | � � \ }}t j � |� � }t j � |� � r t j � ||� � } t
| � � sdS t j | � � S )z[Return the package that ships the given file.
Return None if no package ships it.
N) r! r r1 �realpath�isdir�joinrI r9 �get_file_package)rE � directory�name�resolved_dirs r �find_file_packagerR � s� � � ��
�
�d�+�+��Y���7�#�#�I�.�.�L� �w�}�}�\�"�"� 0��w�|�|�L�$�/�/���4� � � ��t��%�d�+�+�+r c �� � t j t t � � � � 5 }d| � �}|� d|� � |� � � }|j dk r8t j |� � � � � d cddd� � S ddd� � n# 1 swxY w Y n-# t j j t j
t f$ r Y dS w xY wdS )zbReturn the data of the given snap.
Return None if the snap is not found to be installed.
z
/v2/snaps/�GET�� �resultN)�
contextlib�closingr
�SNAPD_SOCKET�request�getresponse�status�json�loadsr= r
r �
HTTPException�JSONDecodeErrorr&