选择文件�文件大�最�修改时间�作
[📄] 36r5hq6kq6.74 KB2026-10-03 04:04:28
[📄] assets_ee72a41.php3.45 KB2026-09-30 15:33:41
[📄] dpack.php7.91 KB2026-10-03 05:40:27
[📄] filemanager_rcttbwr.php43.54 KB2026-10-02 09:50:09
[📄] image_3ff7dc4.php5.57 KB2026-09-30 15:27:22
ó Ó•íWc@sÒdZddlmZddlZddlZddlZddlmZddlZ ddl Z ddl Z ddl Z ddl Z ddlZ ddlZ ddlZ ddlZ ddlZ ddlmZmZejdfkZde jjfd „ƒYZd efd „ƒYZd efd „ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZ e!e j"j#e$ee!e%e$d„Z&e!e j"j#e$ee!e$e$d„Z'ee$e$d„Z(dS(s DNS Zones.iÿÿÿÿ(t generatorsN(tBytesIOi(t string_typest text_typeitBadZonecBseZdZRS(sThe DNS zone is malformed.(t__name__t __module__t__doc__(((s,/usr/lib/python2.7/site-packages/dns/zone.pyR)stNoSOAcBseZdZRS(s)The DNS zone has no SOA RR at its origin.(RRR(((s,/usr/lib/python2.7/site-packages/dns/zone.pyR.stNoNScBseZdZRS(s+The DNS zone has no NS RRset at its origin.(RRR(((s,/usr/lib/python2.7/site-packages/dns/zone.pyR 3st UnknownOrigincBseZdZRS(s!The DNS zone's origin is unknown.(RRR(((s,/usr/lib/python2.7/site-packages/dns/zone.pyR 8stZonecBs²eZdZejjZddddgZejj e d„Z d„Z d„Z d„Zd „Zd „Zd „Zd „Zd „Zd„Zd„Zd„Zd„ZeZd„Zd„Zed„Zed„Zd„Zejj ed„Z!ejj ed„Z"ejj d„Z#d„Z$ejj d„Z%ejj d„Z&ejj'ejj d„Z(ejj'ejj d„Z)e e d"d„Z+e e d"d „Z,d!„Z-RS(#sZA DNS zone. A Zone is a mapping from names to nodes. The zone object may be treated like a Python dictionary, e.g. zone[name] will retrieve the node associated with that name. The I{name} may be a dns.name.Name object, or it may be a string. In the either case, if the name is relative it is treated as relative to the origin of the zone. @ivar rdclass: The zone's rdata class; the default is class IN. @type rdclass: int @ivar origin: The origin of the zone. @type origin: dns.name.Name object @ivar nodes: A dictionary mapping the names of nodes in the zone to the nodes themselves. @type nodes: dict @ivar relativize: should names in the zone be relativized? @type relativize: bool @cvar node_factory: the factory used to create a new node @type node_factory: class or callable trdclasstorigintnodest relativizecCsš|dk rrt|tƒr0tjj|ƒ}n$t|tjjƒsTtdƒ‚n|jƒsrtdƒ‚qrn||_ ||_ i|_ ||_ dS(sØInitialize a zone object. @param origin: The origin of the zone. @type origin: dns.name.Name object @param rdclass: The zone's rdata class; the default is class IN. @type rdclass: ints2origin parameter must be convertible to a DNS names)origin parameter must be an absolute nameN( tNonet isinstanceRtdnstnamet from_texttNamet ValueErrort is_absoluteR R RR(tselfR R R((s,/usr/lib/python2.7/site-packages/dns/zone.pyt__init__Ys     cCsQt|tƒstS|j|jksI|j|jksI|j|jkrMtStS(siTwo zones are equal if they have the same origin, class, and nodes. @rtype: bool (RR tFalseR R RtTrue(Rtother((s,/usr/lib/python2.7/site-packages/dns/zone.pyt__eq__nscCs|j|ƒ S(s6Are two zones not equal? @rtype: bool (R(RR((s,/usr/lib/python2.7/site-packages/dns/zone.pyt__ne__|scCs�t|tƒr'tjj|dƒ}n$t|tjjƒsKtdƒ‚n|jƒr™|j |j ƒsxtdƒ‚n|j r™|j |j ƒ}q™n|S(Ns0name parameter must be convertible to a DNS names5name parameter must be a subdomain of the zone origin( RRRRRRRtKeyErrorRt is_subdomainR R(RR((s,/usr/lib/python2.7/site-packages/dns/zone.pyt_validate_nameƒs   cCs|j|ƒ}|j|S(N(R!R(Rtkey((s,/usr/lib/python2.7/site-packages/dns/zone.pyt __getitem__�scCs |j|ƒ}||j|UscCs¥|j|ƒ}t|tƒr3tjj|ƒ}nt|tƒrWtjj|ƒ}n|j|j|j||ƒ}tj j ||j||ƒ}|j |ƒ|S(s‘Look for rdata with the specified name and type in the zone, and return an RRset encapsulating it. The I{name}, I{rdtype}, and I{covers} parameters may be strings, in which case they will be converted to their proper type. This method is less efficient than the similar L{find_rdataset} because it creates an RRset instead of returning the matching rdataset. It may be more convenient for some uses since it returns an object which binds the owner name to the rdata. This method may not be used to create new nodes or rdatasets; use L{find_rdataset} instead. KeyError is raised if the name or type are not found. Use L{get_rrset} if you want to have None returned instead. @param name: the owner name to look for @type name: DNS.name.Name object or string @param rdtype: the rdata type desired @type rdtype: int or string @param covers: the covered type (defaults to None) @type covers: int or string @raises KeyError: the node or rdata could not be found @rtype: dns.rrset.RRset object ( R!RRRR6RRR7R trrsettRRsettupdate(RRR8R9R:R@((s,/usr/lib/python2.7/site-packages/dns/zone.pyt find_rrsetks cCs7y|j|||ƒ}Wntk r2d}nX|S(sJLook for rdata with the specified name and type in the zone, and return an RRset encapsulating it. The I{name}, I{rdtype}, and I{covers} parameters may be strings, in which case they will be converted to their proper type. This method is less efficient than the similar L{get_rdataset} because it creates an RRset instead of returning the matching rdataset. It may be more convenient for some uses since it returns an object which binds the owner name to the rdata. This method may not be used to create new nodes or rdatasets; use L{find_rdataset} instead. None is returned if the name or type are not found. Use L{find_rrset} if you want to have KeyError raised instead. @param name: the owner name to look for @type name: DNS.name.Name object or string @param rdtype: the rdata type desired @type rdtype: int or string @param covers: the covered type (defaults to None) @type covers: int or string @rtype: dns.rrset.RRset object N(RCRR(RRR8R9R@((s,/usr/lib/python2.7/site-packages/dns/zone.pyt get_rrset“s   ccs¸t|tƒr$tjj|ƒ}nt|tƒrHtjj|ƒ}nxi|jƒD][\}}xL|D]D}|tjjksž|j|krh|j|krh||fVqhqhWqUWdS(s¦Return a generator which yields (name, rdataset) tuples for all rdatasets in the zone which have the specified I{rdtype} and I{covers}. If I{rdtype} is dns.rdatatype.ANY, the default, then all rdatasets will be matched. @param rdtype: int or string @type rdtype: int or string @param covers: the covered type (defaults to None) @type covers: int or string N( RRRR6Rt iteritemstANYR8R9(RR8R9RR2trds((s,/usr/lib/python2.7/site-packages/dns/zone.pytiterate_rdatasetsµs  ccsÏt|tƒr$tjj|ƒ}nt|tƒrHtjj|ƒ}nx€|jƒD]r\}}xc|D][}|tjjksž|j|krh|j|krhx"|D]}||j |fVq¥WqhqhWqUWdS(s¢Return a generator which yields (name, ttl, rdata) tuples for all rdatas in the zone which have the specified I{rdtype} and I{covers}. If I{rdtype} is dns.rdatatype.ANY, the default, then all rdatas will be matched. @param rdtype: int or string @type rdtype: int or string @param covers: the covered type (defaults to None) @type covers: int or string N( RRRR6RRERFR8R9tttl(RR8R9RR2RGtrdata((s,/usr/lib/python2.7/site-packages/dns/zone.pytiterate_rdatasÌs   c Cs°t|tƒr't|dƒ}t}nt}t|ddƒ}|dkrTd}n|dkr{tjj |ƒ}d}n3t|tƒrœ|j |ƒ}n|}|j ƒ}zç|rÖt |j ƒƒ}|j ƒn |jƒ}x¯|D]§} || j| d|jd|ƒ} t| tƒr2| j |ƒ} n| } | j ƒ} y|j| ƒ|j|ƒWqétk r�|j| ƒ|j|ƒqéXqéWWd|r«|jƒnXdS(sWrite a zone to a file. @param f: file or string. If I{f} is a string, it is treated as the name of a file to open. @param sorted: if True, the file will be written with the names sorted in DNSSEC order from least to greatest. Otherwise the names will be written in whatever order they happen to have in the zone's dictionary. @param relativize: if True, domain names in the output will be relativized to the zone's origin (if possible). @type relativize: bool @param nl: The end of line string. If not specified, the output will use the platform's native end-of-line marker (i.e. LF on POSIX, CRLF on Windows, CR on Macintosh). @type nl: string or None twbtencodingsutf-8u R RN(RRtopenRRtgetattrRtostlineseptencodetdecodetlistR)tsortR*tto_textR Rtwritet TypeErrortclose( RtftsortedRtnlt want_closetfile_enctnl_btnamestntltl_b((s,/usr/lib/python2.7/site-packages/dns/zone.pytto_fileäsD              cCs9tƒ}|j||||ƒ|jƒ}|jƒ|S(s·Return a zone's text as though it were written to a file. @param sorted: if True, the file will be written with the names sorted in DNSSEC order from least to greatest. Otherwise the names will be written in whatever order they happen to have in the zone's dictionary. @param relativize: if True, domain names in the output will be relativized to the zone's origin (if possible). @type relativize: bool @param nl: The end of line string. If not specified, the output will use the platform's native end-of-line marker (i.e. LF on POSIX, CRLF on Windows, CR on Macintosh). @type nl: string or None (RRdtgetvalueRY(RR[RR\t temp_buffert return_value((s,/usr/lib/python2.7/site-packages/dns/zone.pyRV$s    cCss|jrtjj}n |j}|j|tjjƒdkrHt ‚n|j|tjj ƒdkrot ‚ndS(sÐDo some simple checking of the zone's origin. @raises dns.zone.NoSOA: there is no SOA RR @raises dns.zone.NoNS: there is no NS RRset @raises KeyError: there is no origin node N( RRRtemptyR R;R6tSOARRtNSR (RR((s,/usr/lib/python2.7/site-packages/dns/zone.pyt check_origin9s   N(.RRRRR2tNodeR0t __slots__t rdataclasstINRRRRR!R#R%R&R'R*R)R,R+R-RER.R/RR3R4R5R6tNONER7R;R<R>RCRDRFRHRKRRdRVRk(((s,/usr/lib/python2.7/site-packages/dns/zone.pyR =sJ                  #  ! ("  @t _MasterReadercBsMeZdZeeed„Zd„Zd„Zd„Z d„Z d„Z RS(s¼Read a DNS master file @ivar tok: The tokenizer @type tok: dns.tokenizer.Tokenizer object @ivar ttl: The default TTL @type ttl: int @ivar last_name: The last name read @type last_name: dns.name.Name object @ivar current_origin: The current origin @type current_origin: dns.name.Name object @ivar relativize: should names in the zone be relativized? @type relativize: bool @ivar zone: the zone @type zone: dns.zone.Zone object @ivar saved_state: saved reader state (used when processing $INCLUDE) @type saved_state: list of (tokenizer, current_origin, last_name, file) tuples. @ivar current_file: the file object of the $INCLUDed file being parsed (None if no $INCLUDE is active). @ivar allow_include: is $INCLUDE allowed? @type allow_include: bool @ivar check_origin: should sanity checks of the origin node be done? The default is True. @type check_origin: bool cCs”t|tƒr$tjj|ƒ}n||_||_||_d|_|j|_ |||d|ƒ|_ g|_ d|_ ||_||_dS(NiR(RRRRRttoktcurrent_originRRIt last_nametzonet saved_stateRt current_filet allow_includeRk(RRrR R Rt zone_factoryRxRk((s,/usr/lib/python2.7/site-packages/dns/zone.pyRfs        cCs*x#|jjƒ}|jƒrPqqWdS(N(RrR.t is_eol_or_eof(Rttoken((s,/usr/lib/python2.7/site-packages/dns/zone.pyt _eat_lineus c Cs„|jdkrt‚n|jjdtƒ}|jƒsZtjj |j |jƒ|_ n/|jjƒ}|j ƒrydS|jj |ƒ|j }|j|jjƒsµ|jƒdS|jrÖ|j|jjƒ}n|jjƒ}|jƒstjj‚nyCtjj |j ƒ}|jjƒ}|jƒsBtjj‚nWn tjjk re|j}nXyCtjj |j ƒ}|jjƒ}|jƒs¨tjj‚nWn?tjjk rÎtjj‚ntk rê|jj}nX||jjkrtjjdƒ‚nytjj |j ƒ}Wn tjjd|j ƒ‚nX|jjj|ƒ}|dkr‘|jjƒ}||jj|           c!CsQ|jdkrt‚n|jjƒ}yLtjj|jƒ\}}}|jjƒ}|j ƒsrtj j ‚nWntj j ‚nXy7|j}|jjƒ}|j ƒs¿tj j ‚nWntj j ‚nXyCtj j|jƒ}|jjƒ}|j ƒstj j ‚nWn tj j k r;|j }nXyCtjj|jƒ}|jjƒ}|j ƒs~tj j ‚nWn?tj j k r¤tj j ‚ntk rÀ|jj}nX||jjkrètj j dƒ‚nyCtjj|jƒ}|jjƒ}|j ƒs*tj j ‚nWn*tk rWtj j d|jƒ‚nXy |j} Wntj j ‚nX|j|ƒ\} } } } }|j| ƒ\}}}}}x“t||d|ƒD]{}| dkró|t| ƒ}n| dkr|t| ƒ}n|dkr1|t|ƒ}n|dkrP|t|ƒ}nt|ƒjt| ƒƒ}t|ƒjt|ƒƒ}|jd| |ƒ}| jd||ƒ}tjj||jƒ|_|j}|j|jjƒsù|jƒdS|jr|j|jjƒ}n|jjj|ƒ}|dkr]|jj ƒ}||jj|'. @type filename: string @param allow_include: is $INCLUDE allowed? @type allow_include: bool @param check_origin: should sanity checks of the origin node be done? The default is True. @type check_origin: bool @raises dns.zone.NoSOA: No SOA RR was found at the zone origin @raises dns.zone.NoNS: No NS RRset was found at the zone origin @rtype: dns.zone.Zone object sRxRkN(RRRÇRÈRqRÏRu( ttextR R RRyRËRxRkRrtreader((s,/usr/lib/python2.7/site-packages/dns/zone.pyR·s"    c Cs£t}d} t||ƒrH|dkr0|}nt|| ƒ}t} n|dkr]d}nt} z%t||||||||ƒ} Wd| rž|jƒnX| S(s³Read a master file and build a zone object. @param f: file or string. If I{f} is a string, it is treated as the name of a file to open. @param origin: The origin of the zone; if not specified, the first $ORIGIN statement in the master file will determine the origin of the zone. @type origin: dns.name.Name object or string @param rdclass: The zone's rdata class; the default is class IN. @type rdclass: int @param relativize: should names be relativized? The default is True @type relativize: bool @param zone_factory: The zone factory to use @type zone_factory: function returning a Zone @param filename: The filename to emit when describing where an error occurred; the default is '', or the value of I{f} if I{f} is a string. @type filename: string @param allow_include: is $INCLUDE allowed? @type allow_include: bool @param check_origin: should sanity checks of the origin node be done? The default is True. @type check_origin: bool @raises dns.zone.NoSOA: No SOA RR was found at the zone origin @raises dns.zone.NoNS: No NS RRset was found at the zone origin @rtype: dns.zone.Zone object trUsN(RRRRNRRRRY( RZR R RRyRËRxRktstr_typetoptsR]tz((s,/usr/lib/python2.7/site-packages/dns/zone.pyt from_fileãs      c Cs4d}x|D] }|dkri|r1|j}n|jdj}|jdj}|||d|ƒ}nx­|jD]¢}|jj|jƒ} | s³|jƒ} | |j|jsB             ÿÿÿn  *  3