%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/samba/gp/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/samba/gp/__pycache__/gp_scripts_ext.cpython-312.pyc

�

�I�d� ���ddlZddlZddlmZmZddlmZmZmZddl	m
Z
ddlmZddl
mZdZdZGd	�d
ee�Zd�Zd�ZGd
�de�Zy)�N)�Popen�PIPE)�
gp_pol_ext�drop_privileges�gp_file_applier)�blake2b)�NamedTemporaryFile)�loga

### autogenerated by samba
#
# This file is generated by the gp_scripts_ext Group Policy
# Client Side Extension. To modify the contents of this file,
# modify the appropriate Group Policy objects which apply
# to this machine. DO NOT MODIFY THIS FILE DIRECTLY.
#

z 
### autogenerated by samba ###
c�"�eZdZd�Zdd�Zdd�Zy)�gp_scripts_extc��y)NzUnix Settings/Scripts�)�selfs �9/usr/lib/python3/dist-packages/samba/gp/gp_scripts_ext.py�__str__zgp_scripts_ext.__str__'s��&�Nc
����|D]J\}}t|�|vs�|t|�j�D]\}}|j|||���L|D�]r}|js�d}	d|	zdd|	zdd|	zdd|	zd	i�d
}
tj
j
|j|
�}|j|�}|s�ii}
|jD]}|j�j�vs� |jj�s�;|j|
vrg|
|j<|
|jj|j�����fd�}|
j�D]6\}}|}|j|�}|j|j |||||��8|j#|j |
j�����uy)
N�%Software\Policies\Samba\Unix Settings�%s\Daily Scriptsz/etc/cron.daily�%s\Monthly Scriptsz/etc/cron.monthly�%s\Weekly Scriptsz/etc/cron.weekly�%s\Hourly Scriptsz/etc/cron.hourlyzMACHINE/Registry.polc�.��g}�s�|n�}|D]w}tddd|��5}dtz}|d|zz
}|j|�tj|j
d�|j
|j
�ddd��y|S#1swY��xYw)N�gp_zw+F)�prefix�mode�delete�dirz#!/bin/sh
%sz%s
i�)r	�intro�write�os�chmod�name�append)	�keyname�entries�ret�cron_dir�data�f�contents�cdir�sectionss	       ��r�applier_funcz9gp_scripts_ext.process_group_policy.<locals>.applier_funcBs�����C�8<�x��0�$�H� '�/��/�u�4�7<�(�L�/�OP�'6��'>�H�$���
�5�H��G�G�H�-��H�H�Q�V�V�U�3��J�J�q�v�v�.�
/�/�/��J�/�/�s�AB�B	)�keep)�str�items�unapply�
file_sys_pathr!�path�join�parser&r%�keysr)�stripr$�generate_value_hash�applyr#�clean)r�deleted_gpo_list�changed_gpo_listr,�guid�settings�	attribute�script�gpo�reg_key�pol_filer4�pol_conf�policies�er.r%r&�
value_hashr-s   `               @r�process_group_policyz#gp_scripts_ext.process_group_policy*s����.�	:�N�D�(��4�y�H�$�)1�#�d�)�)<�)B�)B�)D�:�%�I�v��L�L��y�&�9�:�	:�
$�*	;�C�� � �D��0�7�:�=N�2�W�<�?R�1�G�;�>P�1�G�;�>P�S��2���w�w�|�|�C�$5�$5�x�@���:�:�d�+������!�)�)�;�A��y�y�H�M�M�O�3��������9�9�H�4�24�H�Q�Y�Y�/� ����+�2�2�1�6�6�:�	;�
�)1���(8�	1�$�G�W�!(�I�":��!9�!9�7�!C�J��J�J�s�x�x��J��&��1�	1��
�
�3�8�8�(�-�-�/�
�:�U*	;rc���i}d|z}|jr�tjj|j|�}|j	|�}|s|S|j
D]�}|jjd�d}|jd�s�3|jj�s�N||j�vrg||<||j|j���|S)Nz%s/Registry.pol�\����Scripts)
r3r!r4r5r6r&r%�split�endswithr)r8r7r$)	rrB�target�outputrDr4rErG�keys	         r�rsopzgp_scripts_ext.rsop\s�����$�v�-������7�7�<�<�� 1� 1�8�<�D��z�z�$�'�H���
��%�%�
/���i�i�o�o�d�+�B�/���<�<�	�*�q�v�v�|�|�~��&�+�+�-�/�&(��s���3�K�&�&�q�v�v�.�
/��
r)N)�MACHINE)�__name__�
__module__�__qualname__rrIrSrrrrr&s��'�0;�drrc���tddd|gtt��}|j�\}}|jdk7rt	j
d|z�t
jt�dt��|j�tj�}t|�dk(r#|dj�jd	�}ng}t
jdt�d
t�d�|j�tj�}t|�dk(r4d	j|dD�cgc]}|j���c}�}||fS|j�}||fScc}w)N�crontabz-l�-u��stdout�stderrrzFailed to read the crontab: %sz(.*)��
z.*)rr�communicate�
returncoder
�warning�re�findallr�end�decode�DOTALL�lenr8rNr5)�username�p�out�err�mr&�l�otherss        r�
fetch_crontabrpls��
�y�$��h�/��T�J�A��}�}��H�C���|�|�q�����4�s�:�;�
�
�
���,�c�j�j�l�B�I�I�F�A�
�1�v��{��A�$�*�*�,�$�$�T�*����
�
�
�u�c�2�C�J�J�L�"�)�)�L�A�
�1�v��{����q��t�4�!�A�G�G�I�4�5���7�?��������7�?���5s�*E c��td|d|gtt��}|j�\}}|jdk7rt	d|z��y)NrYrZr[rzFailed to install crontab: %s)rrr`ra�RuntimeError)�fnamerirj�_rls     r�install_crontabru}sJ��
�y�%��x�0��d�K�A�
�]�]�_�F�A�s��|�|�q���:�S�@�A�A�rc�$��eZdZd�Z�fd�Z�xZS)�gp_user_scripts_extc��|D�]y\}}|jj|�t|�|v�r0t|j�\}}|t|�j�D]?\}}||vr|j
|�|jjt|�|��At�5}	t|�dkDrJ|	jdj|tdj|�tg�j��n|	j|j��|	j�t!|	j"|j�ddd�|jj%���||D�]^}
|
j&s�d}d|zdd|zdd|zd	d
|zdi}|jj|
j"�d}
t(j*j|
j&|
�}t-d
|j.|�}|s��|j0D�]�}|j2|j5�vs�!|j6j9�s�<||j2}|j2�dt;|j6j��j=���}|jj?t|�|�}|�d|j6��}t|j�\}}|r||vr�|jA|�t�5}	|	jdj|tdj|�tg�j��|	j�t!|	j"|j�ddd�|jjCt|�||�|jj%������ay#1swY���xYw#1swY�]xYw)Nrr_rrz@dailyrz@monthlyrz@weeklyrz@hourlyzUSER/Registry.pol�root�:� )"�gp_db�set_guidr0rprir1�removerr	rhr r5rre�encode�flushrur#�commitr3r!r4rr6r&r%r7r)r8r�	hexdigest�retriever$�store)rr<r=r>r?ror&r@�entryr*rBrCr-rDr4rErG�	cron_freq�old_vals                   rrIz(gp_user_scripts_ext.process_group_policy�s3��.�	 �N�D�(��J�J����%��4�y�H�$�"/��
�
�">����(0��T��(;�(A�(A�(C�<�$�I�u���'����u�-��J�J�%�%�c�$�i��;�<�(�)�;�Q��7�|�a�'�����	�	�6�5�#'�9�9�W�#5�s�+<�!=�=C�V�X�G�����
�
��0��G�G�I�#�A�F�F�D�M�M�:�;�
�J�J����!	 �$$�	,�C�� � �D��0�7�:�X�2�W�<�z�1�G�;�i�1�G�;�i�J���
�
�#�#�C�H�H�-�.���w�w�|�|�C�$5�$5�x�@��*�6�4�:�:�t�D����!�)�)�,�A��y�y�H�M�M�O�3�������$,�Q�Y�Y�$7�	�/0�y�y� '����
�
�� 8� B� B� D�%F�	�"&�*�*�"5�"5�c�$�i��"K��+4�a�f�f� =��*7��
�
�*F����&�%�w�*>�#�N�N�5�1�!3�!5�G�� !����	�	�6�5�+/�9�9�W�+=�s�3D�)E�EK�V�X�!O� !���	� /�����
�
� F�	G�
!�J�J�,�,�S��Y�	�5�I��
�
�)�)�+�!,�	,�;�;��BG�G�s�3B(O%�A:O2�%O/	�2O;c�&��t�|�|d��S)N�USER)rP)�superrS)rrB�	__class__s  �rrSzgp_user_scripts_ext.rsop�s����w�|�C��|�/�/r)rUrVrWrIrS�
__classcell__)r�s@rrwrw�s���0,�d0�0rrw)r!rc�
subprocessrr�samba.gp.gpclassrrr�hashlibr�tempfiler	�samba.gp.util.loggingr
rrerrprurwrrr�<module>r�sR��"�"�I�I��'�%�		����D�Z��D�L�"B�40�.�40r

Zerion Mini Shell 1.0