%PDF- %PDF-
Direktori : /usr/lib/python3/dist-packages/samba/kcc/__pycache__/ |
Current File : //usr/lib/python3/dist-packages/samba/kcc/__pycache__/ldif_import_export.cpython-312.pyc |
� �I�d�6 � �f � d dl Z d dlmZmZmZ d dlmZ d dlmZm Z G d� de � Zd� Zd d�Z d � Zy)� N)�Ldb�ldb�read_and_sub_file)�system_session)�SamDB�dsdb_Dnc � � e Zd Zy)� LdifErrorN)�__name__� __module__�__qualname__� � �>/usr/lib/python3/dist-packages/samba/kcc/ldif_import_export.pyr r s � �r r c �z � |D ]6 }| j |t j � }|j d|z � �8 y )Nz%s)� write_ldifr �CHANGETYPE_NONE�write)�samdb�f�res�msg�lstrs r �write_search_resultr ! s9 � �� ������S�%8�%8�9�� ����t���r c �� � t j j | � rt d| z � �t | t � |dg�� }|j � t |d� }|j |d� |r|j d|z � |j d� |j � t | t � |� � }|S # t $ r&}|j � t d|�d|��� �d}~ww xY w) a� Routine to import all objects and attributes that are relevant to the KCC algorithms from a previously exported LDIF file. The point of this function is to allow a programmer/debugger to import an LDIF file with non-security relevant information that was previously extracted from a DC database. The LDIF file is used to create a temporary abbreviated database. The KCC algorithm can then run against this abbreviated database for debug or test verification that the topology generated is computationally the same between different OSes and algorithms. :param dburl: path to the temporary abbreviated db to create :param ldif_file: path to the ldif file to import z3Specify a database (%s) that doesn't already exist.zmodules:)�url�session_info�lp�optionsNzfdn: @ROOTDSE changetype: modify replace: dsServiceName dsServiceName: CN=NTDS Settings,%s zLdn: @MODULES @LIST: rootdse,extended_dn_in,extended_dn_out_ldb,objectguid - zFailed to import z: )r r r )�os�path�existsr r r �transaction_startr �add_ldif�modify_ldif� Exception�transaction_cancel�transaction_commitr )�dburlr � ldif_file�forced_local_dsa�tmpdb�data�estrr s r � ldif_to_samdbr/ '