%PDF- %PDF-
| Direktori : /lib/python3/dist-packages/samba/netcmd/__pycache__/ |
| Current File : //lib/python3/dist-packages/samba/netcmd/__pycache__/dns.cpython-312.pyc |
�
�I�d�� � � � d dl mZ d dlmZ d dlmZ d dlmZ d dlm Z m
Z
d dlmZ d dlmZ d dlZd dl
Z
d dlZd dlmZmZ d dlZd d lmZmZ d d
lmZ d dlmZ d dlmZmZmZmZ d d
lmZm Z d dl!m"Z"m#Z#m$Z$ d dl!m%Z% d� Z& G d� d� Z'd� Z(d� Z)d� Z*d� Z+d� Z,d� Z-d� Z.d� Z/d� Z0d� Z1d� Z2d� Z3d� Z4d � Z5d!� Z6d"� Z7d#� Z8d$� Z9d%� Z:d&� Z;d'� Z<d(� Z= G d)� d*e� Z>d+� Z? G d,� d-e� Z@ G d.� d/e� ZA G d0� d1e� ZB G d2� d3e� ZC G d4� d5e� ZD G d6� d7e� ZE G d8� d9e� ZF G d:� d;e� ZG G d<� d=e� ZH G d>� d?e� ZI G d@� dAe� ZJ G dB� dCe� ZKy)D� N)�WERRORError)�werror)�pack)� inet_ntop� inet_pton)�AF_INET)�AF_INET6)�
ndr_unpack�ndr_pack)� remove_dc�dsdb_dns)�SamDB)�system_session)�Command�CommandError�Option�SuperCommand)�dnsp� dnsserver)�record_from_string�
DNSParseError�flag_from_string)�dns_record_matchc � � | j � dk( rd} d| z } t j |||� }|S # t $ r}t d| �d|��� �d }~ww xY w)N� localhostz 127.0.0.1zncacn_ip_tcp:%s[sign]zConnecting to DNS RPC server z
failed with )�lowerr �RuntimeErrorr )�server�lp�creds�binding_str�dns_conn�es �2/usr/lib/python3/dist-packages/samba/netcmd/dns.py�dns_connectr% / se � �
�|�|�~��$���)�F�2�K�[��&�&�{�B��>�� �O�� � [��v�WX�Y�Z�Z��[�s �5 � A�A�Ac
� � e Zd ZdZej
dej dej dej dej diZ
d� Zd� Zy )
�DnsConnWrappera^ A wrapper around a dnsserver.dnsserver connection that makes it
harder not to report friendly messages.
If, rather than
dns_conn = dns_connect(server, lp, creds)
you use
dns_conn = DnsConnWrapper(server, lp, creds)
then various common errors (for example, misspelled zones) on
common operations will raise CommandErrors that turn into
relatively nice messages (when compared to tracebacks).
In addition, if you provide a messages keyword argument, it will
override the defaults. Note that providing None will turn off the
default, letting the original exception shine through.
messages = {
werror.WERR_DNS_ERROR_ZONE_DOES_NOT_EXIST: (
f'Zone {zone} does not exist and so could not be deleted.'),
werror.WERR_DNS_ERROR_NAME_DOES_NOT_EXIST: None
}
res = dns_conn.DnssrvOperation2( # ...
messages=messages)
This example changes the message for ZONE_DOES_NOT_EXIST and
avoids catching NAME_DOES_NOT_EXIST.
Only WERRORErrors are intercepted.
zCould not contact RPC serverzZone already existszThe record does not existzThe zone does not existzInsufficient permissionsc �( � t |||� | _ y �N)r% r"