
    gd                     x    S SK r S SKJrJrJrJr  S SKJr  S SKJ	r	J
r
  SrSr " S S\\5      r " S	 S
\\5      rg)    N)
gp_pol_extdrop_privilegesgp_file_appliergp_misc_applier)NamedTemporaryFile)fetch_crontabinstall_user_crontaba  
### autogenerated by samba
#
# This file is generated by the gp_centrify_crontab_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                   0    \ rS rSrS r SS jrSS jrSrg)	gp_centrify_crontab_ext%   c                     g)NzCentrify/CrontabEntries )selfs    B/usr/lib/python3/dist-packages/samba/gp/gp_centrify_crontab_ext.py__str__gp_centrify_crontab_ext.__str__&   s    (    Nc                   ^ U HM  u  pE[        U 5      U;   d  M  U[        U 5         R                  5        H  u  pgU R                  XFU5        M     MO     U GH+  nUR                  (       d  M  Sn	Sn
[        R
                  R                  UR                  U
5      nU R                  U5      nU(       d  M_  / nUR                   HQ  nUR                  U	:X  d  M  UR                  R                  5       (       d  M6  UR                  UR                  5        MS     U4S jnU R                  UR                  5      nU R                  " U6 nU R!                  UR                  UUUU5        U R#                  UR                  US9  GM.     g )N6Software\Policies\Centrify\UnixSettings\CrontabEntrieszMACHINE/Registry.polc                    > T(       d  SOTn[        SSSUS9 n[        nU  H  nUSU-  -  nM     U[        -  nUR                  U5        UR                  /sS S S 5        $ ! , (       d  f       g = f)Nz/etc/cron.dgp_zw+F)prefixmodedeletedirz%s
)r   introendwritename)entriescron_dirfcontentsentrycdirs        r   applier_funcBgp_centrify_crontab_ext.process_group_policy.<locals>.applier_func=   sk    48}dH+5t#(h8;<#(%,E$6H &- C) !x8 8 8s   >A!!
A/keep)stritemsunapplyfile_sys_pathospathjoinparser    keynamedatastripappendgenerate_attributer   generate_value_hashapplyclean)r   deleted_gpo_listchanged_gpo_listr%   guidsettings	attributescriptgposectionpol_filer/   pol_confr    er&   
value_hashs      `             r   process_group_policy,gp_centrify_crontab_ext.process_group_policy)   s7   .ND4yH$)1#d))<)B)B)D%ILL&9 *E /
 $C   P 1ww||C$5$5x@::d+!))AyyG+qvv. *	( !33CHH=	!55w?


388Y
L"$ 

388)
4; $r   c                    0 nSnSU-  nUR                   (       a  [        R                  R                  UR                   U5      nU R	                  U5      nU(       d  U$ UR
                   H  nUR                  U:X  d  M  UR                  R                  5       (       d  M6  [        U 5      UR                  5       ;  a  / U[        U 5      '   U[        U 5         R                  UR                  5        M     U$ )Nr   z%s/Registry.pol)r-   r.   r/   r0   r1   r    r2   r3   r4   r*   keysr5   )	r   r@   targetoutputrA   rB   r/   rC   rD   s	            r   rsopgp_centrify_crontab_ext.rsopO   s    N$v-77<< 1 18<Dzz$'H%%99'AFFLLNN4y5,.s4y)3t9%,,QVV4	 &
 r   r   N)MACHINE)__name__
__module____qualname____firstlineno__r   rF   rL   __static_attributes__r   r   r   r   r   %   s    ) #'$5Lr   r   c                   :   ^  \ rS rSrS rS rS rU 4S jrSrU =r	$ )gp_user_centrify_crontab_ext_   c                     [        U R                  5      u  pEX5;   a'  UR                  U5        [        U R                  XE5        U R	                  X5        g rN   )r   usernameremover	   cache_remove_attribute)r   r<   r>   r$   othersr    s         r   r,   $gp_user_centrify_crontab_ext.unapply`   s@    '6NN5! @##D4r   c                     U R                  X5      n[        U R                  5      u  pVU(       a  X6;  a:  UR                  U5        [	        U R                  XV5        U R                  XU5        g g rN   )cache_get_attribute_valuer   rY   r5   r	   cache_add_attribute)r   r<   r>   r$   old_valr\   r    s          r   r8   "gp_user_centrify_crontab_ext.applyg   sY    00A'6%.NN5! @$$Te< /r   c                    U HM  u  p4[        U 5      U;   d  M  U[        U 5         R                  5        H  u  pVU R                  X5U5        M     MO     U GH  nUR                  (       d  M  SnSn	[        R
                  R                  UR                  U	5      n
[        SU R                  U
5      nU(       d  Me  / nUR                   H  nUR                  U:X  d  M  UR                  R                  5       (       d  M6  U R                  UR                  5      nUR                  U5        U R                  UR                   X]R                  5        M     U R#                  UR                   US9  GM     g )Nr   zUSER/Registry.polrootr(   )r*   r+   r,   r-   r.   r/   r0   r   r1   r    r2   r3   r4   r6   r5   r8   r   r9   )r   r:   r;   r<   r=   r>   r$   r@   rA   rB   r/   rC   attrsrD   s                 r   rF   1gp_user_centrify_crontab_ext.process_group_policyo   s   .ND4yH$(0T(;(A(A(C$ILL%8 )D /
 $C   P .ww||C$5$5x@*64::tD!))AyyG+$($;$;AFF$C	Y/

388Y?	 *
 

388%
0 $r   c                     > [         TU ]  USS9$ )NUSER)rJ   )superrL   )r   r@   	__class__s     r   rL   !gp_user_centrify_crontab_ext.rsop   s    w|C|//r   r   )
rP   rQ   rR   rS   r,   r8   rF   rL   rT   __classcell__)rj   s   @r   rV   rV   _   s    5=1.0 0r   rV   )r.   samba.gp.gpclassr   r   r   r   tempfiler   samba.gp.gp_scripts_extr   r	   r   r   r   rV   r   r   r   <module>rp      sF   " 
  ' G		8j/ 8t(0#:O (0r   