]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
py/dnsserver: replace obsolete comments with useful ones
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Fri, 26 Mar 2021 07:42:49 +0000 (20:42 +1300)
committerDouglas Bagnall <dbagnall@samba.org>
Thu, 8 Apr 2021 21:54:35 +0000 (21:54 +0000)
The replaced comment was about a long fixed Python reference counting bug.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
python/samba/dnsserver.py

index 4f965a1ec9e182e74f8e7ec7353854c3c72e068b..5f891663245a1f0689bb53b83f08e4debebe68cd 100644 (file)
 
 from samba.dcerpc import dnsserver, dnsp
 
+# Note: these are not quite the same as similar looking classes in
+# provision/sambadns.py -- those ones are based on
+# dnsp.DnssrvRpcRecord, these are based on dnsserver.DNS_RPC_RECORD.
+# They encode the same information in slightly different ways.
 #
-# Always create a copy of strings when creating DNS_RPC_RECORDs
-# to overcome the bug in pidl generated python bindings.
+# DNS_RPC_RECORD structures ([MS-DNSP]2.2.2.2.5 "DNS_RPC_RECORD") are
+# used on the wire by DnssrvEnumRecords2. The dnsp.DnssrvRpcRecord
+# versions have the in-database version of the same information, where
+# the flags field is unpacked, and the struct ordering is different.
+# See [MS-DNSP] 2.3.2.2 "DnsRecord".
 #
+# In both cases the structure and contents of .data depend on .wType.
+# For example, if .wType is DNS_TYPE_A, .data is an IPv4 address. If
+# the .wType is changed to DNS_TYPE_CNAME, the contents of .data will
+# be interpreted as a cname blob, but the bytes there will still be
+# those of the IPv4 address. If you don't also set the .data you may
+# encounter stability problems. These DNS_RPC_RECORD subclasses
+# attempt to hide that from you, but are only pretending -- any of
+# them can represent any type of record.
+
 
 
 class ARecord(dnsserver.DNS_RPC_RECORD):