HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.52.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 15 06:39:08 EDT 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/lib/python3.9/site-packages/setroubleshoot/__pycache__/server.cpython-39.opt-1.pyc
a

U+ee��@s*ddlmZgd�ZddlmZmZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlmZmZedd�Zedd�ZiZe
jd	kr�d
ed<e	jfeed�e��e	jeed
d
�Zz
ejZWney�ej	ZYn0ddlmZddlm Z m!Z!m"Z"m#Z#ddl$TddlmZddl$m%Z%ddl&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-ddl.m/Z/m0Z0m1Z1m2Z2ddl3m4Z4m5Z5m6Z6ddl7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>e<d�dd�Z?dd�Z@dd�ZAdd�ZBed d!�ZCed d"�ZDed d#�ZEe�F�ZGeG�HeC�d$d%�ZIdaJdaKdaLed&d'�ZMedd(�aNedd)�ZOedd*�ZPeA�ZQGd+d,�d,eR�ZSeS�ZTGd-d.�d.e �ZUGd/d0�d0e/�ZVGd1d2�d2eVe4e5e6�ZWGd3d4�d4eR�ZXddlYTddl7ZZGd5d6�d6ej[j\�Z]d7d8�Z^Gd9d:�d:�Z_ddl`Z`ddlambZbd;d<�Zce�d�Zed=d>�ZfdCd@dA�ZgehdBk�r&eg�dS)D�)�absolute_import)�RunFaultServer�ClientConnectionHandler�get_host_database�send_alert_notification�ConnectionPool)�GObject�GLibN)�parse_config_setting�
get_configZgeneralZi18n_text_domainZi18n_locale_dir)�TZunicode)�domain�	localedir)r
r�fallback)�ServerAccess)�PluginReportReceiver�SETroubleshootDatabase�TestPluginReportReceiver�
AnalyzeThread)�*)r)�AuditRecordReceiver)�ProgramError�ERR_NOT_AUTHENTICATED�ERR_USER_LOOKUP�ERR_USER_PROHIBITED�ERR_USER_PERMISSION�
ERR_FILE_OPEN�ERR_DATABASE_NOT_FOUND)�
RpcChannel�ConnectionState�get_socket_list_from_config�ListeningServer)�SETroubleshootServerInterface�%SETroubleshootDatabaseNotifyInterface�SEAlertInterface)�get_hostname�make_database_filepath�!assure_file_ownership_permissions�get_identity�log_init�	log_debug�syslog_trace�setroubleshootd_logcCs:td|�ddlm}|tjkr6td�|��dSdS)N�received signal=%srzreloading configuration file)r*�setroubleshoot.config�config�signal�SIGHUPZconfig_init)�signum�framer/�r4�9/usr/lib/python3.9/site-packages/setroubleshoot/server.py�
sighandlerms
r6cCs(td|�t�tjd�t�d�dS)Nr-z=/sys/fs/selinux/policy is in use by another process. Exiting!�)r*�syslog�LOG_ERR�os�_exit�r2r3r4r4r5�polling_failed_handlervsr=cCs0ddl}t�}t��}t|���}d|||fS)Nrz%s:%s:%s)�timer%r:�getpid�str)r>�hostname�pidZstampr4r4r5�make_instance_id}s
rCcCstS�N)�
host_databaser4r4r4r5r�srZsystem_dbusZbus_name�object_pathZ	interfacecCsPtj�ttd�}|�|j�|�|j�t�	|�t
�d�D]}|�|�q<dS)N�alert�sealert)
�dbusZlowlevelZ
SignalMessage�dbus_system_object_path�dbus_system_interface�append�level�local_id�
system_busZsend_message�connection_pool�clientsrG)�siginforG�clientr4r4r5r�s
rZemailZrecipients_filepath�pkg_name�pkg_version�rpc_versionc@s8eZdZdd�Zdd�Zdd�Zddd	�Zd
d
d�ZdS)rcCs
i|_dSrD)�client_pool��selfr4r4r5�__init__�szConnectionPool.__init__cCs(||jvrtd|�dSd|j|<dS)Nz.add_client: client (%s) already in client pool�rWr*�rYZhandlerr4r4r5�
add_client�s
zConnectionPool.add_clientcCs&||jvrtd|�dS|j|=dS)Nz-remove_client: client (%s) not in client poolr[r\r4r4r5�
remove_client�s
zConnectionPool.remove_clientNccs0|jD]$}|dur|Vq|j|kr|VqdSrD)rW�channel_type�rYr_rSr4r4r5rQ�s


zConnectionPool.clientscCs"|jD]}|j|kr|��qdSrD)rWr_Zclose_connectionr`r4r4r5�	close_all�s

zConnectionPool.close_all)N)N)�__name__�
__module__�__qualname__rZr]r^rQrar4r4r4r5r�s

rcs(eZdZ�fdd�Z�fdd�Z�ZS)�AlertPluginReportReceivercstt|��|�dSrD)�superrerZ)rY�database��	__class__r4r5rZ�sz"AlertPluginReportReceiver.__init__csXtt|��|�}tdur�g}tjD]>}d|j}|�||j�}|dkr"td|j	�|�
|j�q"t|�r�ddlm
}|||�|j��td�ddlm}t�tj|��td�|j�|jjD]}|jd	kr�|jd
}	q�q�tddt��rtjj|� �|	t!d
�|j"D]<}
|
j#dd�dk�r*�q|�|
j#�}|dk�r|S�qt$|�|S)Nzemail:%s�ignorezEmail: siginfo.sig=%sr)�email_alertzsending alert to all clients)�html_to_textz1 For complete SELinux messages run: sealert -l %s�AVCrBr,Zlog_full_report)Z
OBJECT_PIDZSYSLOG_IDENTIFIER�zemail:)%rfre�report_problem�email_recipientsZrecipient_listZaddress�evaluate_filter_for_user�filter_typer*�sigrL�lenZsetroubleshoot.email_alertrkrgZ
mark_modifiedZsetroubleshoot.html_utilrlr8r9�summary�_rN�audit_event�records�record_type�fieldsr�bool�systemdZjournal�sendZformat_textrTZusers�usernamer)rYrRZto_addrsZ	recipientr~�actionrkrl�audit_recordrB�urhr4r5ro�s<



 



z(AlertPluginReportReceiver.report_problem)rbrcrdrZro�
__classcell__r4r4rhr5re�srec@s$eZdZdd�Zdd�Zdd�ZdS)rcCs*t�|d�|��|_|j�d|j�dS)NrHZchanged)rrZ�copy�socket_address�connection_stateZconnect�on_connection_state_change�rYr�r4r4r5rZ�s
z ClientConnectionHandler.__init__cCsTtd|jj||�|�|�|�|jf�|tj@r<t�|�|tj@rPt�	|�dS)N�]%s.on_connection_state_change: connection_state=%s flags_added=%s flags_removed=%s address=%s)
r*rirb�flags_to_stringr�r�OPENrPr^r]�rYr��flagsZflags_addedZ
flags_removedr4r4r5r�s
(


z2ClientConnectionHandler.on_connection_state_changecCs8|jjtj@rdS||j_|j�tj�|�|j�dS�NT�	r�r�rr�r��socket�updateZio_watch_addZhandle_client_io�rYr�r�r4r4r5�opens
zClientConnectionHandler.openN)rbrcrdrZr�r�r4r4r4r5r�s	rc@s~eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zddd�Zdd�ZdS) �&SetroubleshootdClientConnectionHandlercCsJt�||�t�|_|�d|�|�d|�t�|_d|_d|_d|_	dS)NZSETroubleshootServerr)
rrZrrgZconnect_rpc_interfacer�accessr~�uid�gidr�r4r4r5rZsz/SetroubleshootdClientConnectionHandler.__init__cCs�td|jj||�|�|�|�|jf�|tj@r<t�|�|tj@r�|j	�
|jj�\|_|_
td|jj|j|j
f�t�|�dS)Nr�zF%s.on_connection_state_change: open, socket credentials: uid=%s gid=%s)r*rirbr�r�rr�rPr^r�Zget_credentialsr�r�r�r]r�r4r4r5r�(s(


zASetroubleshootdClientConnectionHandler.on_connection_state_changecCs8|jjtj@rdS||j_|j�tj�|�|j�dSr�r�r�r4r4r5r�3s
z+SetroubleshootdClientConnectionHandler.opencCsB|jjtj@stt��t�}|jj|kr0|jgStt	d|��dS)Nzdatabase (%s) not found)
r�r�r�
AUTHENTICATEDrrr�
properties�namer)rYZ
database_namerEr4r4r5�
database_bind<sz4SetroubleshootdClientConnectionHandler.database_bindcCs�td|||f�|t|j�kr6ttd|j|fd��|dkrDd}nd}|j�||�s^tt��||_||_	||_
|j�|�|_
|j
dur�|j�|�|j�tj�ttgS)Nzlogon(%s) type=%s username=%sz)uid=%s does not match logon username (%s)�ZdetailrHrS)r*r(r�rrr�Zuser_allowedrr_Zchannel_namer~rgZget_user�userZadd_userr�r�rr�rUrV)rY�typer~�passwordZ	privileger4r4r5�logonEs 
z,SetroubleshootdClientConnectionHandler.logoncCs|jjtj@stt��tgSrD)r�r�rr�rrrprXr4r4r5�query_email_recipients]sz=SetroubleshootdClientConnectionHandler.query_email_recipientscCs4td|�|jjtj@s"tt��|at�t	�dS)Nzset_email_recipients: %s)
r*r�r�rr�rrrpZwrite_recipient_file�email_recipients_filepath)rYZ
recipientsr4r4r5�set_email_recipientscs
z;SetroubleshootdClientConnectionHandler.set_email_recipientscCs2td|�|jjtj@s"tt��|j�|�}dS)Nzdelete_signature: sig=%s)	r*r�r�rr�rrrg�delete_signature)rYrsrRr4r4r5r�ps
z7SetroubleshootdClientConnectionHandler.delete_signaturecCs.td�|jjtj@stt��|j��}|gS)N�get_properties)	r*r�r�rr�rrrgr�)rYr�r4r4r5r�ys

z5SetroubleshootdClientConnectionHandler.get_propertiescCs:td||f�|jjtj@s&tt��|j�||�}|gS)Nz)evaluate_alert_filter: username=%s sig=%s)	r*r�r�rr�rrrg�evaluate_alert_filter)rYrsr~rr4r4r5r��s
z<SetroubleshootdClientConnectionHandler.evaluate_alert_filtercCs4td|�|jjtj@s"tt��|j�|�}|gS)Nzlookup_local_id: %s)	r*r�r�rr�rrrg�lookup_local_id)rYrNrRr4r4r5r��s
z6SetroubleshootdClientConnectionHandler.lookup_local_idcCs4td|�|jjtj@s"tt��|j�|�}|gS)Nzquery_alerts: criteria=%s)	r*r�r�rr�rrrg�query_alerts)rYZcriteria�sigsr4r4r5r��s
z3SetroubleshootdClientConnectionHandler.query_alerts�cCsbtd|||f�|jjtj@s(tt��||jkrLttt	d�|j|fd��|j
�||||�dS)Nz.set_filter: username=%s filter_type=%s sig=
%sz)The user (%s) cannot modify data for (%s)r�)r*r�r�rr�rrr~rrvrg�
set_filter)rYrsr~rr�datar4r4r5r��s
z1SetroubleshootdClientConnectionHandler.set_filtercCs@td||||f�|jjtj@s*tt��|j�||||�dS)Nz2set_user_data: username=%s item=%s data=%s sig=
%s)	r*r�r�rr�rrrg�
set_user_data)rYrsr~�itemr�r4r4r5r��s
z4SetroubleshootdClientConnectionHandler.set_user_dataN)r�)rbrcrdrZr�r�r�r�r�r�r�r�r�r�r�r�r�r4r4r4r5r�s
		
					
r�c@seZdZdd�Zdd�ZdS)�ClientNotifiercCs
||_dSrD)rP)rYrPr4r4r5rZ�szClientNotifier.__init__cCs"|j�d�D]}|�||�qdS)NrH)rPrQ�signatures_updated)rYr�r�rSr4r4r5r��sz!ClientNotifier.signatures_updatedN)rbrcrdrZr�r4r4r4r5r��sr�c@sleZdZd2dd�Zdd�Zej�e�dd��Z	ejjedd	�d
d��Z
ej�e�dd
��Zejjedddd�dd��Z
d3dd�Zejjedddd�dd��Zejjedddd�dd��Zejjedddd�dd��Zd d!�Zejjeddd"d�d#d$��Zejjeddd%d�d&d'��Zejjeddd%d�d(d)��Zejjeddd*�d+d,��Zej�e�d-d.��Zd4d/d0�Zd1S)5�SetroubleshootdDBusObject�
cCs^tjj�|t��|�d|_||_|�|j�td|�||_	||_
ttj�|_
t�|_dS)Nrzdbus __init__ %s called)rI�service�ObjectrZ�	SystemBus�conn_ctr�timeout�alarmr*�queue�receiverZAuditRecordReaderZTEXT_FORMAT�
record_readerr�record_receiver)rYrF�analysis_queue�alert_receiverr�r4r4r5rZ�sz"SetroubleshootdDBusObject.__init__cCszt��d}dt��|fd|fD]$}tj�|�r$t�tjd�dSq$t|�}|D]}t	|�rV|j
�||jf�qVdS)Nr7z%%s%s/modules/active/disable_dontauditz,/var/lib/selinux/%s/active/disable_dontauditzsSetroubleshoot can not analyze AVCs while dontaudit rules are disabled, 'semodule -B' will turn on dontaudit rules.)
�selinuxZselinux_getpolicytypeZselinux_pathr:�path�existsr8r9Zcompute_avcsZ
verify_avcr�Zputr�)rYrwZpolicy_typeZ
store_pathZavcs�avcr4r4r5�add_audit_event�s�z)SetroubleshootdDBusObject.add_audit_eventcCsdSrDr4)rY�reasonr4r4r5�restart�sz!SetroubleshootdDBusObject.restart�ss)Z	signaturecCsdSrDr4)rYrMrNr4r4r5rG�szSetroubleshootdDBusObject.alertcCs.|�d�|jd7_td|j�td�S)Nrr7z)dbus iface start() called: %d ConnectionsZStarted)r�r�r*rvrXr4r4r5�start�s
zSetroubleshootdDBusObject.start�sender�s�ii)Zsender_keyword�in_signature�
out_signaturecCs�t|j�|��}t�}d}g}|�d���D] }|�|�}|dkr,|�|�q,|jt	d�d}	d}
|D]0}|	d7}	|j
dkr�|
d7}
|j|krfd}
d}	qf|	|
fS)Nr�rrj)�keyrr7�red)r(�
connection�
get_unix_userrr��siginfosrqrL�sort�compare_sigrMrN)rYZlast_seen_idr�r~rgr�Z
signaturesrsr�countr�r4r4r5�
check_for_new�s&


z'SetroubleshootdDBusObject.check_for_new�displayc
Cszt|j�|��}t�}tj�t|d��}|�d�j	}g}|D]6}	|	j
|krNq>|	�|�|kr>|�|	j
|	��|	jf�q>|S)N�@Br)r(r�r�r�setroubleshoot�utilZ	TimeStamp�floatr��signature_list�last_seen_daterqrLrNru�report_count)
rY�sincer��alert_actionr~rgZsince_alerts�database_alertsZalertsrGr4r4r5�_get_all_alerts_sinces
z/SetroubleshootdDBusObject._get_all_alerts_since�tza(ssi)cCs|�||�SrD�r�)rYr�r�r4r4r5�get_all_alerts_sincesz.SetroubleshootdDBusObject.get_all_alerts_sincer�cCs|�d|�S)a�
        Return array of *local_id*'s, *summary*'s, and *report_count*'s of all current alerts in a setroubleshoot database

        returns list of:
        * `local_id(s)`: a report id in a setroubleshoot database
        * `summary(s)`: a brief description of an alert. E.g. `"SELinux is preventing /usr/bin/bash from ioctl access on the unix_stream_socket unix_stream_socket."`
        * `report_count(i)`: count of reports of this alert
rr��rYr�r4r4r5�get_all_alertss
z(SetroubleshootdDBusObject.get_all_alertscCs|jd|dd�S)a�
        Return array of *local_id*'s, *summary*'s, and *report_count*'s of all alerts which a user set to be ignored by a user

        returns list of:
        * `local_id(s)`: a report id in a setroubleshoot database
        * `summary(s)`: a brief description of an alert. E.g. `"SELinux is preventing /usr/bin/bash from ioctl access on the unix_stream_socket unix_stream_socket."`
        * `report_count(i)`: count of reports of this alert
rrj)r�r�r�r4r4r5�get_all_alerts_ignored(s
z0SetroubleshootdDBusObject.get_all_alerts_ignoredc
CsHz|�|�}Wn(ty6}z|�WYd}~n
d}~00|����}|SrD)r�rr��__next__)rYrNrgr��erGr4r4r5�
_get_alert4sz$SetroubleshootdDBusObject._get_alertzssiasa(ssssbbi)ttsc
Cs�t|j�|��}t�}|�||�}|��|jj}dd�|D�}|��\}}	g}
|	D]R\}}|
�	|�
|�||��|�
|�||��|�
|�
||��|j|j|j|jf�qT|j|��|j||
t|j�d��dt|j�d��d|jp�dfS)ar
Return an alert with summary, audit events, fix suggestions

##### arguments

* `local_id(s)`: an alert id

##### return values

* `local_id(s)`: an alert id
* `summary(s)`: a brief description of an alert. E.g. `"SELinux is preventing /usr/bin/bash from
  ioctl access on the unix_stream_socket unix_stream_socket."`
* `report_count(i)`: count of reports of this alert
* `audit_event(as)`: an array of audit events (AVC, SYSCALL) connected to the alert
* `plugin_analysis(a(ssssbb)`: an array of plugin analysis structure
 * `if_text(s)`:
 * `then_text(s)`
 * `do_text(s)`
 * `analysis_id(s)`: plugin id. It can be used in `org.fedoraproject.SetroubleshootFixit.run_fix()`
 * `fixable(b)`: True when an alert is fixable by a plugin
 * `report_bug(b)`: True when an alert should be reported to bugzilla
 * `priority(i)`:  An analysis priority. Typically the value is between 1 - 100.
* `first_seen_date(t)`: when the alert was seen for the first time, number of microseconds since the Epoch
* `last_seen_date(t)`: when the alert was seen for the last time, number of microseconds since the Epoch
* `level(s)`: "green", "yellow" or "red"
cSsg|]}|���qSr4)Zto_text)�.0Zeventr4r4r5�
<listcomp>^�z7SetroubleshootdDBusObject.get_alert.<locals>.<listcomp>z%sr�r�)r(r�r�rr�Z%update_derived_template_substitutionsrwrxZget_pluginsrLZ
substituteZget_if_textZ
get_then_textZget_do_textZanalysis_idZfixableZ
report_bug�priorityrNrur��intZfirst_seen_date�formatr�rM)
rYrNr�r~rgrGr�Zaudit_eventsZtotal_priorityZ
alert_pluginsZpluginsZplugin�argsr4r4r5�	get_alert<s0�
�z#SetroubleshootdDBusObject.get_alert�bcCs^zJt|j�|��}t�}|�||�}ddlm}|�|j|||d�WdSYdS0dS)z�
Sets a filter on an alert. The alert can be "always" filtered, "never" filtered or "after_first" filtered.

##### arguments

* `local_id(s)`: an alert id
* `filter_type(s)`: "always", "never", "after_first"

##### return values

* `success(b)`:
r)�map_filter_name_to_valueNTF)	r(r�r�rr��setroubleshoot.signaturer�r�rs)rYrNrrr�r~rgrGr�r4r4r5r�tsz$SetroubleshootdDBusObject.set_filtercCs8z$t�}|�||�}|�|j�WdSYdS0dS)zz
Deletes an alert from the database.

##### arguments

* `local_id(s)`: an alert id

##### return values

* `success(b)`:
TFN)rr�r�rs)rYrNr�rgrGr4r4r5�delete_alert�s
z&SetroubleshootdDBusObject.delete_alert)r�r�c		Cs�t|�}z�|jd7_|�d�td||jf�|j�|�D]B\}}}}}t|||||�}|��|j�|�D]}|�	|�qrq@|j�
d�D]}|�	|�q�W|jd8_|�|j�n|jd8_|�|j�0td�S)Nr7rz#dbus avc(%s) called: %d Connectionsrm)
r@r�r�r*r�ZfeedZAuditRecordZaudispd_rectifyr�r��flushr�rv)	rYr�ryZevent_idZ	body_textrzZline_numberr�rwr4r4r5r��s"
�zSetroubleshootdDBusObject.avccCs,|jd8_td|j�|�|j�dS)Nr7z*dbus iface finish() called: %d Connectionsr�)r�r*r�r�rXr4r4r5�finish�sz SetroubleshootdDBusObject.finishcCs |jdks|dkrt�|�dS)Nr)r�r0r�)rYr�r4r4r5r��szSetroubleshootdDBusObject.alarmN)r�)r�)r�)rbrcrdrZr�rIr�r0rKr�rG�methodr�r�r�r�r�r�r�r�r�r�r�r�r�r4r4r4r5r��s:












7




r�cCs|jSrD)r�)�ar4r4r5r��sr�c@seZdZdd�Zdd�ZdS)�SetroubleshootdDBusc
Csfz&tdtttf�tt|||�|_Wn:ty`}z"t�tjd|�|�WYd}~n
d}~00dS)Nz=creating system dbus: bus_name=%s object_path=%s interface=%sz$cannot start system DBus service: %s)	r*�dbus_system_bus_namerJrKr��dbus_obj�	Exceptionr8r9)rYr�r�r�r�r4r4r5rZ�szSetroubleshootdDBus.__init__cCs|j�d�dS)Nzdaemon requestT)r�r�rXr4r4r5�
do_restart�szSetroubleshootdDBus.do_restartN)rbrcrdrZr�r4r4r4r5r��sr�cCs|��t��dSrD)�save�	audit2whyr�)rgr4r4r5�goodbye�srcCstd�t��dS)Nz SIGALRM raised in RunFaultServer)r*�	main_loop�quitr<r4r4r5�
alarm_handler�srr�c
Cst�|�t�tjt�zt��t�d�Wq�Wqtyr}z(dt|�vrZWYd}~q|�WYd}~qd}~0ty�}z0dtt	|dd��vr�WYd}~q|�WYd}~qd}~00qt�tjt
�t�tjt��z�t
�t�tt�}tdd�}t|�}t|dd�t||td	�d
�at�|�t�tt�d}tjjD�]}t�t|jj �t|jj!�t|jj"�|jj#�\}}|tj$tj%tj&tj'tj(tj)fv�r@|tj$k�r�d}	nv|tj%k�r�d
}	nd|tj&k�r�d|jj }	nJ|tj'k�r�d|jj!}	n0|tj(k�rd|jj"}	}	ndd�*|jj#�}	t
�
t
j+d|j,|	f�d}t�-|j��q@|�r^tj.dd�tddt/��svt0t�}
nt1t�}
ddl2}|j3j4�5d�a6t7t6|�}|�8d�|�9�ddl:m;}
|
�a<tt=dd�zt<�>t=�WnBt?�y}z(|j@tAk�rtB|jC�n|�WYd}~n
d}~00tDd�}|D]}tE|tF�}|�G��q,tHjI�J�tKt6|
|�}tL�M�Wn�tN�y�}ztBd�WYd}~n�d}~0tO�y�}ztBd�WYd}~n`d}~0tP�y}z>ddlQ}tR|�S��t
�
t
jTd|jUjVt|�f�WYd}~n
d}~00dS)Nrz%unable to open /sys/fs/selinux/policy�__context__r�rg�filenamei�r�zAudit Listener)Z
friendly_nameFz
it is allowedzit is dontaudit'dzsource context %s is undefinedztarget context %s is undefinedzsecurity class %s is undefinedzpermission %s is undefined�,z'Deleting alert %s, %s in current policyT)Zprune�test�analyze)�SEEmailRecipientSetZlisten_for_clientz#KeyboardInterrupt in RunFaultServerz$raising SystemExit in RunFaultServerzexception %s: %s)Wr0r��SIGALRMr=r�init�
ValueErrorr@�SystemError�getattrrr1r6r8ZopenlogrTr�rPrr&r'rrvrEZ
set_notify�atexit�registerrr�r�r	rsZscontextZtcontextZtclassr�ZALLOWZ	DONTAUDITZBADSCONZBADTCONZ	BADTCLASSZBADPERM�joinZ
LOG_NOTICErNr�r�r{rerZsix.moves.queueZmovesr�ZQueuer�r�	setDaemonr�r�r
rpr�Zparse_recipient_filer�errnorr*�strerrorr r!r�r�rIZglibZinit_threadsr�r�run�KeyboardInterrupt�
SystemExitr��	tracebackr+�
format_excr9rirb)r�r�Zclient_notifierZdatabase_filenameZdatabase_filepathZdeleted�i�whyZboolsr�r�ZsixZanalyze_threadr
Zlisten_addressesZlisten_addressZlistening_serverZsetroubleshootd_dbusrr4r4r5r�s�



�
0"





r�__main__)r�)iZ
__future__r�__all__Z
gi.repositoryrr	rIZdbus.serviceZ	dbus.glib�gettextr:r0r�sysr8Zsystemd.journalr|r.r
rr
r�kwargs�version_info�install�translationZugettextrv�AttributeErrorZsetroubleshoot.access_controlrZsetroubleshoot.analyzerrrrZsetroubleshoot.avc_auditrZsetroubleshoot.errcoderrrrrrrZsetroubleshoot.rpcrrr r!Zsetroubleshoot.rpc_interfacesr"r#r$Zsetroubleshoot.utilr%r&r'r(r)r*r+r6r=rCrr�rJrKr�rOZrequest_namerrEr�rpr�rTrUrVZinstance_id�objectrrPrerr�r�Zsetroubleshoot.audit_datar�r�r�r�r�r�r�Zselinux.audit2whyrrZMainLooprrrrbr4r4r4r5�<module>s�


���
$	$	







0�!