HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/samba/provision/__pycache__/common.cpython-310.pyc
o

�/a�@sldZdZddlZddlmZddlmZdZdZdZ	d	Z
d
d�Zddgfd
d�Zddgfdd�Z
dd�ZdS)z/Functions for setting up a Samba configuration.�restructuredText�N)�read_and_sub_file)�	setup_dir�FULL�	SUBDOMAIN�NT4SYNC�DRScCstj�t�|�S)zGReturn an absolute path to the provision tempate file specified by file)�os�path�joinr)�file�r
�8/usr/lib/python3/dist-packages/samba/provision/common.py�
setup_path(srzrelax:0cCs(t|t�sJ�t||�}|�||�dS)aSetup a ldb in the private dir.

    :param ldb: LDB file to import data into
    :param ldif_path: Path of the LDIF file to load
    :param subst_vars: Optional variables to subsitute in LDIF.
    :param nocontrols: Optional list of controls, can be None for no controls
    N)�
isinstance�strr�add_ldif��ldb�	ldif_path�
subst_vars�controls�datar
r
r�setup_add_ldif-s
rcCst||�}|�||�dS)z�Modify a ldb in the private dir.

    :param ldb: LDB object.
    :param ldif_path: LDIF file path.
    :param subst_vars: Optional dictionary with substitution variables.
    N)r�modify_ldifrr
r
r�setup_modify_ldif:s
rcCsB|dusJ�|��zt|||�Wn|���|��dS)a6Import a LDIF a file into a LDB handle, optionally substituting
    variables.

    :note: Either all LDIF data will be added or none (using transactions).

    :param ldb: LDB file to import into.
    :param ldif_path: Path to the LDIF file.
    :param subst_vars: Dictionary with substitution variables.
    N)�transaction_startr�transaction_cancel�transaction_commit)rrrr
r
r�	setup_ldbEs
r)�__doc__�
__docformat__r	�sambar�samba.paramr�	FILL_FULL�FILL_SUBDOMAIN�FILL_NT4SYNC�FILL_DRSrrrrr
r
r
r�<module>s