HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/self/root/lib/python3/dist-packages/apport/crashdb_impl/__pycache__/debian.cpython-38.pyc
U

Z�8d��@sHdZddlZddlZddlmZddlZddlZGdd�dejj�ZdS)z Debian crash database interface.�N)�MIMETextc@s2eZdZdZdd�Zdd�Zddd�Zd	d
�ZdS)�
CrashDatabasezk
    Debian crash database
    This is a Apport CrashDB implementation for interacting with Debian BTS
    cCsHtjj�|||�||_|j�d�s.d|jd<|j�d�sDd|jd<dS)z�
        Initialize crash database connection.

        Debian implementation is pretty basic as most of its bug management
        processes revolve around the email interface
        �smtphostzreportbug.debian.org�	recipientzsubmit@bugs.debian.orgN)�apport�crashdbr�__init__�options�get)�selfZ	auth_filer	�r�</usr/lib/python3/dist-packages/apport/crashdb_impl/debian.pyrs
zCrashDatabase.__init__cCsD|j�d�sd|krd|d<d|kr4|��s4d|d<tjj�||�S)zz
        Check if this report can be uploaded to this database.
        Checks for the proper settings of apport.
        �senderZUnreportableReasonz<Please configure sender settings in /etc/apport/crashdb.confZ
Stacktracez>Incomplete backtrace. Please install the debug symbol packages)r	r
Zhas_useful_stacktracerrr�accepts)r�reportrrr
r(s
zCrashDatabase.acceptsNc	Csj|�|�st�z|d�d�\}}Wnttfk
r>YdSXt��}|j�d|d�	d��|j�d|d�	d��|j�d	�	d��z
|d
=Wntk
r�YnX|�|�|j�
d�t|j���
d��}|d|d
<|jd|d<|jd|d<|�d|jd�|�dd|d���t�|jd�}|�|jd|jd|���	d��|��dS)z�Upload given problem report return a handle for it.

        In Debian, we use BTS, which is heavily email oriented
        This method crafts the bug into an email report understood by Debian BTS
        ZPackage� Fz	Package: �
zUTF-8z	Version: z


z=============================

ZCoreDumprZTitleZSubjectrZFromrZTozX-Debbugs-CCZUsertagz	apport-%sZProblemTyperN)r�AssertionError�split�KeyError�
ValueError�tempfileZNamedTemporaryFile�file�write�encode�seekr�read�decoder	Z
add_header�lower�smtplibZSMTPZsendmailZ	as_string�quit)rrZprogress_callbackZbuggyPackageZbuggyVersionZtemp�msg�srrr
�upload6s0

$zCrashDatabase.uploadcCsdS)aA
        Return an URL that should be opened after report has been uploaded
        and upload() returned handle.

        Should return None if no URL should be opened (anonymous filing without
        user comments); in that case this function should do whichever
        interactive steps it wants to perform.
        Nr)rrZhandlerrr
�get_comment_urlhs	zCrashDatabase.get_comment_url)N)�__name__�
__module__�__qualname__�__doc__rrr#r$rrrr
rs

2r)	r(rrZemail.mime.textrrZapport.crashdbrrrrrr
�<module>s