o i©¹dP ã@sbddlmZmZmZmZddlmZmZGdd„deƒZGdd„deeƒZ Gdd„deeeƒZ d S) é)ÚPluginÚ RedHatPluginÚ DebianPluginÚ UbuntuPlugin)ÚjoinÚnormpathc@s8eZdZdZdZdZdZeZdd„Zdd„Z d d „Z d S) ÚNamedzBIND named serverÚnamed)ÚsystemÚservicesÚnetworkú/etc/named.confcCsb| ddg¡|jD]$}| |¡r.| || |¡g¡| t| |¡dƒt| |¡dƒg¡q dS)Nz/etc/default/bindz/var/log/named*.logz chroot/devz chroot/proc)Ú add_copy_specÚ config_filesÚ path_existsÚ get_dns_dirÚadd_forbidden_pathr)ÚselfÚcfg©rú:/usr/lib/python3/dist-packages/sos/report/plugins/named.pyÚsetups þ  þþ€úz Named.setupcCs | d|¡}|rt|dƒSdS)z3 grab directory path from named{conf,boot} zdirectory\s+\"(.*)\"rÚ)Údo_regex_find_allr)rÚ config_fileÚdirectory_listrrrr&s ÿ zNamed.get_dns_dircCsd}d}| |j||¡dS)Nz(\s*arg \"password )[^\"]*z\1******)Ú do_file_subÚ named_conf)rÚmatchÚsubstrrrÚpostproc0szNamed.postprocN) Ú__name__Ú __module__Ú __qualname__Ú short_descÚ plugin_nameÚprofilesrrrrr rrrrr s rcs0eZdZdZdZedfZdZ‡fdd„Z‡ZS)Ú RedHatNamedr )r z/etc/named.bootú/etc/sysconfig/named)Úbindcs:tt|ƒ ¡| d¡| d¡| d¡| d¡dS)Nz /etc/named/r(zklist -ket /etc/named.keytabz/etc/named.keytab)Úsuperr'rrÚadd_cmd_outputr©r©Ú __class__rrr>s     zRedHatNamed.setup) r!r"r#rrÚfilesÚpackagesrÚ __classcell__rrr-rr'6s r'cs2eZdZdZdZdZeddfZ‡fdd„Z‡ZS)Ú DebianNamed)ú/etc/bind/named.conf)Úbind9r3z/etc/bind/named.conf.optionsz/etc/bind/named.conf.localcstt|ƒ ¡| d¡dS)Nz /etc/bind/)r*r2rrr,r-rrrPs zDebianNamed.setup) r!r"r#r/r0rrrr1rrr-rr2Gsþr2N) Úsos.report.pluginsrrrrÚos.pathrrrr'r2rrrrÚs )