
    ~ g                     t    S SK r S SKrS SKJrJrJrJr   " S S\5      r " S S\\5      r " S S\\\5      r	g)	    N)PluginRedHatPluginDebianPluginUbuntuPluginc                   4    \ rS rSrSrSrSrSrSrS r	S r
S	rg)
Krb5   a&  This plugin handles the collection of kerberos authentication config
files and logging. Users should expect to see their krb5 config(s) in the
final archive, along with krb5 logging and `klist` output.

kdc configs and acls will also be collected from the distribution-spcecific
kdc directory.
zKerberos authenticationkrb5)identitysystemNc                    U R                  SSU R                   S3U R                   S3S/5        U R                  5         U R                  SSS9  U R                  S	U R                   S
35        U R                  S5        g )Nz/etc/krb5.confz/etc/krb5.conf.d/*z
/kadm5.aclz	/kdc.confz/var/log/kadmind.logz/var/log/krb5kdc.logkerberos_kdc_log)tagszklist -ket z/.k5*zklist -ket /etc/krb5.keytab)add_copy_speckdcdircollect_kinitadd_cmd_output)selfs    9/usr/lib/python3/dist-packages/sos/report/plugins/krb5.pysetup
Krb5.setup   s     {{m:&{{m9%"
 	 	18JKk$++e<=9:    c                    [         R                  " 5       nSnU R                  U5      (       a  [        USSS9 nU H  n[        R
                  " SU[        R                  5      (       a<  UR                  S5      S   SS	 R                  5       nU R                  S
U S35          OF[        R
                  " SU[        R                  5      (       d  M  U R                  S
U S35          O   SSS5        gg! , (       d  f       g= f)z
Collect the kinit command output for the system with id_provider "AD"
or "IPA" domains.

While integrating the Linux M/c with AD the realmd will create a
computer object on the AD side. The realmd and AD restrict the
Hostname/SPN to 15 Characters.
z/etc/sssd/sssd.confrzutf-8)encodingz\s*id_provider\s*=\s*ad.r   N   zMKRB5_TRACE=/dev/stdout                                             kinit -k 'z$'z\s*id_provider\s*=\s*ipa')
socketgetfqdnpath_isfileopenrematch
IGNORECASEsplitupperr   )r   hostname	sssd_confflines        r   r   Krb5.collect_kinit+   s     >>#)	I&&iw71Dxx : $bmm5 5#+>>##6q#9#2#>#D#D#F++ /77?j-D Exx ; $bmm5 5++ /77?j-C D  87 '77s   BC6C66
D )__name__
__module____qualname____firstlineno____doc__
short_descplugin_nameprofilesr   r   r   __static_attributes__r-   r   r   r   r      s'     +JK%HF;r   r   c                       \ rS rSrSrSrSrg)
RedHatKrb5G   )z	krb5-libszkrb5-serverz/var/kerberos/krb5kdcr-   Nr.   r/   r0   r1   packagesr   r6   r-   r   r   r8   r8   G   s    +H$Fr   r8   c                       \ rS rSrSrSrSrg)
UbuntuKrb5M   )zkrb5-kdczkrb5-configz	krb5-userz/var/lib/krb5kdcr-   Nr:   r-   r   r   r=   r=   M   s    7HFr   r=   )
r#   r   sos.report.pluginsr   r   r   r   r   r8   r=   r-   r   r   <module>r@      s>    
  O O46 4n%| % |\  r   