관리-도구
편집 파일: watcher.cpython-311.pyc
� ��g� � �� � d Z ddlZddlZddlmZ ddlmZmZ ddlm Z ddl mZ ddlm Z ddlmZ dd lmZ dd lmZ dd lmZ ddlmZmZ ee� � Z G d� d e � � ZdS )u This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. Copyright © 2019 Cloud Linux Software Inc. This software is also available under ImunifyAV commercial license, see <https://www.imunify360.com/legal/eula> � N)� getLogger)�Inotify�Watcher)� inactivity)�MyImunifyConfig)� MessageSource)�$is_native_feature_management_enabled)� sync_users)� hosting_panel)�finally_happened�recurring_checkc �r � e Zd ZdZdZej Zdd�Zd� Z de fd�Zde fd�Z e d � � d � � � ZdS )� PasswdWatchers /etcs passwdNc � �� K � || _ || _ t j � � | _ |�t | j � � | _ n|| _ | j � | j | j � � t � � � d {V ��s| � � � � d {V �� t j r| � � � � d {V �� | j � | � � � � � | _ d S �N)�_loop�_sinkr �HostingPanel�_hosting_panelr �_watcher�watch� WATCH_PATH� WATCH_MASKr �update_users_permissionsr �ENABLED�update_myimunify_users�create_task�_process_events�_watch_task)�self�loop�sink�watchers �\/opt/imunify360/venv/lib/python3.11/site-packages/imav/feature_management/plugins/watcher.py� create_sourcezPasswdWatcher.create_source1 s� � � � ��� ��� �+�8�:�:����?�#�D�J�/�/�D�M�M�#�D�M�� ���D�O�T�_�=�=�=�9�;�;�;�;�;�;�;�;� 2��/�/�1�1�1�1�1�1�1�1�1��"� 0��-�-�/�/�/�/�/�/�/�/�/��:�1�1�$�2F�2F�2H�2H�I�I����� c � � K � | j � � � t j t j � � 5 | j � d {V �� d d d � � n# 1 swxY w Y | j o| j � � � d S d S r )r �cancel� contextlib�suppress�asyncio�CancelledErrorr �close�r s r$ �shutdownzPasswdWatcher.shutdownD s� � � � �����!�!�!� � ��!7� 8� 8� #� #��"�"�"�"�"�"�"�"� #� #� #� #� #� #� #� #� #� #� #���� #� #� #� #� � �/�$�-�-�-�/�/�/�/�/�/�/�/s �A�A�A�returnc � �j K � t | j � � � � d {V ��� � � d {V ��S r )�sync_feature_management_usersr � get_usersr. s r$ r z&PasswdWatcher.update_users_permissionsK sZ � � � �2��%�/�/�1�1�1�1�1�1�1�1� � � � � � � � � r&