관리-도구
편집 파일: server.cpython-39.opt-1.pyc
a ����U+ee�����������������������@���s*��d�dl�mZ�g�d�Zd�dlmZmZ�d�dlZd�dlZd�dlZd�dl Z d�dl Z d�dlZd�dlZd�dl Z d�dlZd�dlZd�dlmZmZ�edd�Zedd�Zi�Ze jd k�r�d ed<�e jf�eed�e���e jeed d �Zz ejZW�n�ey����ej ZY�n0�d�dlmZ�d�dlm Z m!Z!m"Z"m#Z#�d�dl$T�d�dlmZ�d�dl$m%Z%�d�dl&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-�d�dl.m/Z/m0Z0m1Z1m2Z2�d�dl3m4Z4m5Z5m6Z6�d�dl7m8Z8m9Z9m: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��ZQG�d+d,��d,eR�ZSeS��ZTG�d-d.��d.e �ZUG�d/d0��d0e/�ZVG�d1d2��d2eVe4e5e6�ZWG�d3d4��d4eR�ZXd�dlYT�d�dl7ZZG�d5d6��d6ej[j\�Z]d7d8��Z^G�d9d:��d:�Z_d�dl`Z`d�dlambZb�d;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_logc�����������������C���s:���t�d|����dd�lm}�|�tjkr6t�d��|����d�S�d�S�)N�received signal=%sr���zreloading configuration file)r*����setroubleshoot.config�config�signal�SIGHUPZconfig_init)�signum�framer/�����r4����9/usr/lib/python3.9/site-packages/setroubleshoot/server.py� sighandlerm���s���� r6���c�����������������C���s(���t�d|����t�tjd��t�d��d�S�)Nr-���z=/sys/fs/selinux/policy is in use by another process. Exiting!����)r*����syslog�LOG_ERR�os�_exit�r2���r3���r4���r4���r5����polling_failed_handlerv���s����r=���c������������������C���s0���dd�l�}�t��}t���}t|������}d|||f�S�)Nr���z%s:%s:%s)�timer%���r:����getpid�str)r>����hostname�pidZstampr4���r4���r5����make_instance_id}���s ����rC���c�������������������C���s���t�S��N)� host_databaser4���r4���r4���r5���r�������s����r���Zsystem_dbusZbus_name�object_pathZ interfacec�����������������C���sP���t�j�ttd�}|�|�j��|�|�j��t� |��t �d�D�]}|�|���q<d�S�)N�alert�sealert) �dbusZlowlevelZ SignalMessage�dbus_system_object_path�dbus_system_interface�append�level�local_id� system_busZsend_message�connection_pool�clientsrG���)�siginforG����clientr4���r4���r5���r�������s���� r���ZemailZrecipients_filepath�pkg_name�pkg_version�rpc_versionc�������������������@���s8���e�Zd�Zdd��Zdd��Zdd��Zddd �Zd d d�ZdS�)r���c�����������������C���s ���i�|�_�d�S�rD���)�client_pool��selfr4���r4���r5����__init__����s����zConnectionPool.__init__c�����������������C���s(���||�j�v�rtd|���d�S�d�|�j�|<�d�S�)Nz.add_client: client (%s) already in client pool�rW���r*����rY���Zhandlerr4���r4���r5���� add_client����s���� zConnectionPool.add_clientc�����������������C���s&���||�j�vrtd|���d�S�|�j�|=�d�S�)Nz-remove_client: client (%s) not in client poolr[���r\���r4���r4���r5���� remove_client����s���� zConnectionPool.remove_clientNc�����������������c���s0���|�j�D�]$}|d�u�r|V��q|j|kr|V��qd�S�rD���)rW����channel_type�rY���r_���rS���r4���r4���r5���rQ�������s ���� zConnectionPool.clientsc�����������������C���s"���|�j�D�]}|j|kr|����qd�S�rD���)rW���r_���Zclose_connectionr`���r4���r4���r5���� close_all����s���� zConnectionPool.close_all)N)N)�__name__� __module__�__qualname__rZ���r]���r^���rQ���ra���r4���r4���r4���r5���r�������s ��� r���c�����������������������s(���e�Zd�Z��fdd�Z��fdd�Z���ZS�)�AlertPluginReportReceiverc��������������������s���t�t|���|��d�S�rD���)�superre���rZ���)rY����database�� __class__r4���r5���rZ�������s����z"AlertPluginReportReceiver.__init__c��������������������sX��t�t|���|�}td�ur�g�}tjD�]>}d|j�}|�||j�}|dkr"td|j ���|� |j��q"t|�r�ddlm }�|||��|�j����td��ddlm}�t�tj|���td�|j����|jjD�]}|jd kr�|jd �} �q�q�tddt��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�AVCrB���r,���Zlog_full_report)Z OBJECT_PIDZSYSLOG_IDENTIFIER����zemail:)%rf���re����report_problem�email_recipientsZrecipient_listZaddress�evaluate_filter_for_user�filter_typer*����sigrL����lenZsetroubleshoot.email_alertrk���rg���Z mark_modifiedZsetroubleshoot.html_utilrl���r8���r9����summary�_rN����audit_event�records�record_type�fieldsr����bool�systemdZjournal�sendZformat_textrT���Zusers�usernamer���)rY���rR���Zto_addrsZ recipientr~����actionrk���rl����audit_recordrB����urh���r4���r5���ro�������s<���� z(AlertPluginReportReceiver.report_problem)rb���rc���rd���rZ���ro���� __classcell__r4���r4���rh���r5���re�������s���re���c�������������������@���s$���e�Zd�Zdd��Zdd��Zdd��ZdS�)r���c�����������������C���s*���t��|�d��|���|�_|�j�d|�j��d�S�)NrH���Zchanged)r���rZ����copy�socket_address�connection_stateZconnect�on_connection_state_change�rY���r����r4���r4���r5���rZ�������s���� z ClientConnectionHandler.__init__c�����������������C���sT���t�d|�jj||�|�|�|�|�jf���|tj@�r<t�|���|tj@�rPt� |���d�S�)N�]%s.on_connection_state_change: connection_state=%s flags_added=%s flags_removed=%s address=%s) r*���ri���rb����flags_to_stringr����r����OPENrP���r^���r]����rY���r�����flagsZflags_addedZ flags_removedr4���r4���r5���r������s ����( z2ClientConnectionHandler.on_connection_state_changec�����������������C���s8���|�j�jtj@�rdS�||�j_|�j��tj��|��|�j��d�S��NT� r����r����r���r����r�����socket�updateZio_watch_addZhandle_client_io�rY���r����r����r4���r4���r5����open��s ����zClientConnectionHandler.openN)rb���rc���rd���rZ���r����r����r4���r4���r4���r5���r�������s��� r���c�������������������@���s~���e�Zd�Zdd��Zdd��Zdd��Zdd��Zd d ��Zdd��Zd d��Z dd��Z dd��Zdd��Zdd��Z dd��Zddd�Zdd��ZdS�) �&SetroubleshootdClientConnectionHandlerc�����������������C���sJ���t��|�|��t��|�_|��d|���|��d|���t��|�_d�|�_d�|�_d�|�_ d�S�)NZSETroubleshootServerr���) r���rZ���r���rg���Zconnect_rpc_interfacer����accessr~����uid�gidr����r4���r4���r5���rZ�����s����z/SetroubleshootdClientConnectionHandler.__init__c�����������������C���s����t�d|�jj||�|�|�|�|�jf���|tj@�r<t�|���|tj@�r�|�j � |�jj�\|�_|�_ t�d|�jj|�j|�j f���t�|���d�S�)Nr����zF%s.on_connection_state_change: open, socket credentials: uid=%s gid=%s)r*���ri���rb���r����r����r���r����rP���r^���r����Zget_credentialsr����r����r����r]���r����r4���r4���r5���r����(��s����( zASetroubleshootdClientConnectionHandler.on_connection_state_changec�����������������C���s8���|�j�jtj@�rdS�||�j_|�j��tj��|��|�j��d�S�r����r����r����r4���r4���r5���r����3��s ����z+SetroubleshootdClientConnectionHandler.openc�����������������C���sB���|�j�jtj@�stt��t��}|jj|kr0|jgS�tt d|���d�S�)Nzdatabase (%s) not found) r����r����r���� AUTHENTICATEDr���r���r���� properties�namer���)rY���Z database_namerE���r4���r4���r5���� database_bind<��s����z4SetroubleshootdClientConnectionHandler.database_bindc�����������������C���s����t�d|�||f���|t|�j�kr6ttd|�j|f�d��|dkrDd}nd�}|�j�||�s^tt��||�_||�_ ||�_ |�j�|�|�_ |�j d�u�r�|�j�|��|�j�tj��ttgS�)Nzlogon(%s) type=%s username=%sz)uid=%s does not match logon username (%s)�ZdetailrH���rS���)r*���r(���r����r���r���r����Zuser_allowedr���r_���Zchannel_namer~���rg���Zget_user�userZadd_userr����r����r���r����rU���rV���)rY����typer~����passwordZ privileger4���r4���r5����logonE��s ���� z,SetroubleshootdClientConnectionHandler.logonc�����������������C���s���|�j�jtj@�stt��tgS�rD���)r����r����r���r����r���r���rp���rX���r4���r4���r5����query_email_recipients]��s����z=SetroubleshootdClientConnectionHandler.query_email_recipientsc�����������������C���s4���t�d|���|�jjtj@�s"tt��|at�t ��d�S�)Nzset_email_recipients: %s) r*���r����r����r���r����r���r���rp���Zwrite_recipient_file�email_recipients_filepath)rY���Z recipientsr4���r4���r5����set_email_recipientsc��s ����z;SetroubleshootdClientConnectionHandler.set_email_recipientsc�����������������C���s2���t�d|���|�jjtj@�s"tt��|�j�|�}d�S�)Nzdelete_signature: sig=%s) r*���r����r����r���r����r���r���rg����delete_signature)rY���rs���rR���r4���r4���r5���r����p��s ����z7SetroubleshootdClientConnectionHandler.delete_signaturec�����������������C���s.���t�d��|�jjtj@�stt��|�j���}|gS�)N�get_properties) r*���r����r����r���r����r���r���rg���r����)rY���r����r4���r4���r5���r����y��s ���� z5SetroubleshootdClientConnectionHandler.get_propertiesc�����������������C���s:���t�d||f���|�jjtj@�s&tt��|�j�||�}|gS�)Nz)evaluate_alert_filter: username=%s sig=%s) r*���r����r����r���r����r���r���rg����evaluate_alert_filter)rY���rs���r~���r���r4���r4���r5���r�������s ����z<SetroubleshootdClientConnectionHandler.evaluate_alert_filterc�����������������C���s4���t�d|���|�jjtj@�s"tt��|�j�|�}|gS�)Nzlookup_local_id: %s) r*���r����r����r���r����r���r���rg����lookup_local_id)rY���rN���rR���r4���r4���r5���r�������s ����z6SetroubleshootdClientConnectionHandler.lookup_local_idc�����������������C���s4���t�d|���|�jjtj@�s"tt��|�j�|�}|gS�)Nzquery_alerts: criteria=%s) r*���r����r����r���r����r���r���rg����query_alerts)rY���Zcriteria�sigsr4���r4���r5���r�������s ����z3SetroubleshootdClientConnectionHandler.query_alerts��c�����������������C���sb���t�d|||f���|�jjtj@�s(tt��||�jkrLttt d�|�j|f�d��|�j �||||��d�S�)Nz.set_filter: username=%s filter_type=%s sig= %sz)The user (%s) cannot modify data for (%s)r����)r*���r����r����r���r����r���r���r~���r���rv���rg���� set_filter)rY���rs���r~���rr����datar4���r4���r5���r�������s���� z1SetroubleshootdClientConnectionHandler.set_filterc�����������������C���s@���t�d||||f���|�jjtj@�s*tt��|�j�||||��d�S�)Nz2set_user_data: username=%s item=%s data=%s sig= %s) r*���r����r����r���r����r���r���rg���� set_user_data)rY���rs���r~����itemr����r4���r4���r5���r�������s ����z4SetroubleshootdClientConnectionHandler.set_user_dataN)r����)rb���rc���rd���rZ���r����r����r����r����r����r����r����r����r����r����r����r����r����r4���r4���r4���r5���r������s��� r����c�������������������@���s���e�Zd�Zdd��Zdd��ZdS�)�ClientNotifierc�����������������C���s ���||�_�d�S�rD���)rP���)rY���rP���r4���r4���r5���rZ������s����zClientNotifier.__init__c�����������������C���s"���|�j��d�D�]}|�||��qd�S�)NrH���)rP���rQ����signatures_updated)rY���r����r����rS���r4���r4���r5���r�������s����z!ClientNotifier.signatures_updatedN)rb���rc���rd���rZ���r����r4���r4���r4���r5���r�������s���r����c�������������������@���sl��e�Zd�Zd2dd�Zdd��Zej�e�dd���Z ejjedd �d d���Z ej�e�dd ���Zejjedddd�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� ���c�����������������C���s^���t�jj�|�t����|��d|�_||�_|��|�j��td|���||�_ ||�_ ttj�|�_ t��|�_d�S�)Nr���zdbus __init__ %s called)rI����service�ObjectrZ���� SystemBus�conn_ctr�timeout�alarmr*����queue�receiverZAuditRecordReaderZTEXT_FORMAT� record_readerr����record_receiver)rY���rF����analysis_queue�alert_receiverr����r4���r4���r5���rZ������s����z"SetroubleshootdDBusObject.__init__c�����������������C���sz���t����d�}dt����|f�d|�fD�]$}tj�|�r$t�tjd���d�S�q$t|�}|D�]}t |�rV|�j �||�jf��qVd�S�)Nr7���z%%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_getpolicytypeZselinux_pathr:����path�existsr8���r9���Zcompute_avcsZ verify_avcr����Zputr����)rY���rw���Zpolicy_typeZ store_pathZavcs�avcr4���r4���r5����add_audit_event���s�����z)SetroubleshootdDBusObject.add_audit_eventc�����������������C���s���d�S�rD���r4���)rY����reasonr4���r4���r5����restart���s����z!SetroubleshootdDBusObject.restart�ss)Z signaturec�����������������C���s���d�S�rD���r4���)rY���rM���rN���r4���r4���r5���rG������s����zSetroubleshootdDBusObject.alertc�����������������C���s.���|���d��|��jd7��_td|�j���td�S�)Nr���r7���z)dbus iface start() called: %d ConnectionsZStarted)r����r����r*���rv���rX���r4���r4���r5����start���s���� zSetroubleshootdDBusObject.start�sender�s�ii)Zsender_keyword�in_signature� out_signaturec�����������������C���s����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����r���rj���)�keyr���r7����red)r(���� connection� get_unix_userr���r�����siginfosrq���rL����sort�compare_sigrM���rN���)rY���Zlast_seen_idr����r~���rg���r����Z signaturesrs���r����countr����r4���r4���r5���� check_for_new���s&���� z'SetroubleshootdDBusObject.check_for_new�displayc����������� ������C���sz���t�|�j�|��}t��}tj�t|d���}|�d�j }g�}|D�]6} | j |k�rNq>| �|�|kr>|�| j | ���| jf��q>|S�)N�@B�r���)r(���r����r����r����setroubleshoot�utilZ TimeStamp�floatr�����signature_list�last_seen_daterq���rL���rN���ru����report_count) rY����sincer�����alert_actionr~���rg���Zsince_alerts�database_alertsZalertsrG���r4���r4���r5����_get_all_alerts_since��s���� z/SetroubleshootdDBusObject._get_all_alerts_since�tza(ssi)c�����������������C���s���|���||�S�rD����r����)rY���r����r����r4���r4���r5����get_all_alerts_since��s����z.SetroubleshootdDBusObject.get_all_alerts_sincer����c�����������������C���s���|���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 r���r�����rY���r����r4���r4���r5����get_all_alerts��s���� z(SetroubleshootdDBusObject.get_all_alertsc�����������������C���s���|�j�d|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 r���rj���)r����r����r����r4���r4���r5����get_all_alerts_ignored(��s���� z0SetroubleshootdDBusObject.get_all_alerts_ignoredc�������������� ���C���sH���z|��|�}W�n(�ty6�}�z|�W�Y�d�}~n d�}~0�0�|������}|S�rD���)r����r���r�����__next__)rY���rN���rg���r�����erG���r4���r4���r5���� _get_alert4��s����z$SetroubleshootdDBusObject._get_alertzssiasa(ssssbbi)ttsc����������� ������C���s����t�|�j�|��}t��}|��||�}|����|jj}dd��|D��}|���\}} g�} | D�]R\}}| � |� |�||��|� |�||��|� |� ||��|j|j|j|jf��qT|j|���|j|| t|j�d��d�t|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" c�����������������S���s���g�|�]}|�����qS�r4���)Zto_text)�.0Zeventr4���r4���r5���� <listcomp>^�������z7SetroubleshootdDBusObject.get_alert.<locals>.<listcomp>z%sr����r����)r(���r����r����r���r����Z%update_derived_template_substitutionsrw���rx���Zget_pluginsrL���Z substituteZget_if_textZ get_then_textZget_do_textZanalysis_idZfixableZ report_bug�priorityrN���ru���r�����intZfirst_seen_date�formatr����rM���) rY���rN���r����r~���rg���rG���r����Zaudit_eventsZtotal_priorityZ alert_pluginsZpluginsZplugin�argsr4���r4���r5���� get_alert<��s0����� �z#SetroubleshootdDBusObject.get_alert�bc�����������������C���s^���zJt�|�j�|��}t��}|��||�}ddlm}�|�|j|||�d��W�dS����Y�dS�0�dS�)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����r���r�����setroubleshoot.signaturer����r����rs���)rY���rN���rr���r����r~���rg���rG���r����r4���r4���r5���r����t��s����z$SetroubleshootdDBusObject.set_filterc�����������������C���s8���z$t���}|��||�}|�|j��W�dS����Y�dS�0�dS�)zz Deletes an alert from the database. ##### arguments * `local_id(s)`: an alert id ##### return values * `success(b)`: TFN)r���r����r����rs���)rY���rN���r����rg���rG���r4���r4���r5����delete_alert���s���� z&SetroubleshootdDBusObject.delete_alert)r����r����c����������� ��� ���C���s����t�|�}z�|��jd7��_|��d��td||�jf���|�j�|�D�]B\}}}}}t|||||�}|����|�j�|�D�]}|�� |��qrq@|�j� d�D�]}|�� |��q�W�|��jd8��_|��|�j��n|��jd8��_|��|�j��0�td�S�)Nr7���r���z#dbus avc(%s) called: %d Connectionsrm���) r@���r����r����r*���r����ZfeedZAuditRecordZaudispd_rectifyr����r�����flushr����rv���) rY���r����ry���Zevent_idZ body_textrz���Zline_numberr����rw���r4���r4���r5���r�������s"���� �zSetroubleshootdDBusObject.avcc�����������������C���s,���|��j�d8��_�td|�j����|��|�j��dS�)Nr7���z*dbus iface finish() called: %d Connectionsr����)r����r*���r����r����rX���r4���r4���r5����finish���s����z SetroubleshootdDBusObject.finishc�����������������C���s ���|�j�dks|dkrt�|��d�S�)Nr���)r����r0���r����)rY���r����r4���r4���r5���r�������s����zSetroubleshootdDBusObject.alarmN)r����)r����)r����)rb���rc���rd���rZ���r����rI���r����r0���rK���r����rG����methodr����r����r����r����r����r����r����r����r����r����r����r����r����r4���r4���r4���r5���r�������s:��� 7 r����c�����������������C���s���|�j�S�rD���)r����)�ar4���r4���r5���r�������s����r����c�������������������@���s���e�Zd�Zdd��Zdd��ZdS�)�SetroubleshootdDBusc�������������� ���C���sf���z&t�dtttf���tt|||�|�_W�n:�ty`�}�z"t�tjd|���|�W�Y�d�}~n d�}~0�0�d�S�)Nz=creating system dbus: bus_name=%s object_path=%s interface=%sz$cannot start system DBus service: %s) r*����dbus_system_bus_namerJ���rK���r�����dbus_obj� Exceptionr8���r9���)rY���r����r����r����r����r4���r4���r5���rZ������s����zSetroubleshootdDBus.__init__c�����������������C���s���|�j��d��dS�)Nzdaemon requestT)r����r����rX���r4���r4���r5���� do_restart���s����zSetroubleshootdDBus.do_restartN)rb���rc���rd���rZ���r����r4���r4���r4���r5���r�������s���r����c�����������������C���s���|������t����d�S�rD���)�save� audit2whyr����)rg���r4���r4���r5����goodbye���s����r��c�����������������C���s���t�d��t����d�S�)Nz SIGALRM raised in RunFaultServer)r*���� main_loop�quitr<���r4���r4���r5���� alarm_handler���s����r��r����c�������������� ���C���s��t��|���t���t�jt��zt����t��d��W�q�W�q�tyr�}�z(dt|�v�rZW�Y�d�}~q|�W�Y�d�}~qd�}~0��ty��}�z0dtt |dd��v�r�W�Y�d�}~q|�W�Y�d�}~qd�}~0�0�qt���t�jt ��t���t�jt���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�} dd�l2}|j3j4�5d�a6t7t6|��}|�8d��|�9���ddl:m;} �| ��a<tt=dd��zt<�>t=��W�nB�t?�y�}�z(|j@tAk�rtB|jC��n|�W�Y�d�}~n d�}~0�0�tDd�}|D�]}tE|tF�}|�G����q,tHjI�J���tKt6| |��}tL�M���W�n��tN�y��}�ztBd��W�Y�d�}~n�d�}~0��tO�y��}�ztBd��W�Y�d�}~n`d�}~0��tP�y�}�z>dd�lQ}tR|�S����t � t jTd|jUjVt|�f���W�Y�d�}~n d�}~0�0�d�S�)Nr���z%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)Wr0���r�����SIGALRMr=���r����init� ValueErrorr@����SystemError�getattrr��r1���r6���r8���ZopenlogrT���r����rP���r���r&���r'���r���rv���rE���Z set_notify�atexit�registerr��r����r����r ��rs���ZscontextZtcontextZtclassr����ZALLOWZ DONTAUDITZBADSCONZBADTCONZ BADTCLASSZBADPERM�joinZ LOG_NOTICErN���r����r����r{���re���r���Zsix.moves.queueZmovesr����ZQueuer����r���� setDaemonr����r����r ��rp���r����Zparse_recipient_filer����errnor���r*����strerrorr ���r!���r����r����rI���ZglibZinit_threadsr����r���run�KeyboardInterrupt� SystemExitr����� tracebackr+���� format_excr9���ri���rb���)r����r����Zclient_notifierZdatabase_filenameZdatabase_filepathZdeleted�i�whyZboolsr����r����ZsixZanalyze_threadr ��Zlisten_addressesZlisten_addressZlistening_serverZsetroubleshootd_dbusr��r4���r4���r5���r������s����� � 0" r����__main__)r����)iZ __future__r����__all__Z gi.repositoryr���r ���rI���Zdbus.serviceZ dbus.glib�gettextr:���r0���r���sysr8���Zsystemd.journalr|���r.���r ���r���r ���r����kwargs�version_info�install�translationZugettextrv����AttributeErrorZsetroubleshoot.access_controlr���Zsetroubleshoot.analyzer���r���r���r���Zsetroubleshoot.avc_auditr���Zsetroubleshoot.errcoder���r���r���r���r���r���r���Zsetroubleshoot.rpcr���r���r ���r!���Zsetroubleshoot.rpc_interfacesr"���r#���r$���Zsetroubleshoot.utilr%���r&���r'���r(���r)���r*���r+���r6���r=���rC���r���r����rJ���rK���r����rO���Zrequest_namer���rE���r����rp���r����rT���rU���rV���Zinstance_id�objectr���rP���re���r���r����r����Zsetroubleshoot.audit_datar����r����r����r����r����r����r����Zselinux.audit2whyr���r��ZMainLoopr��r��r���rb���r4���r4���r4���r5����<module>���s���� ��� $ $ 0��! �� �