U
    -_gT	                     @   sb   d dl m Z  d dlmZmZmZmZmZ G dd deZG dd deeZG dd deeeZ	d	S )
    )glob)PluginRedHatPluginDebianPluginUbuntuPluginSoSPredicatec                   @   s,   e Zd ZdZdZdZdZdd Zdd Zd	S )
SssdzSystem security service daemonsssd)servicesZsecurityZidentity)r	   zsssd-commonc                 C   s   |  dddg | j tddd |  ddd	g t| d
gd}| jd|d | jd|d}|d dkr|d  D ]}| d|  qtd S )N/etc/sssd/sssd.confz/etc/sssd/conf.d/*.confz%/var/lib/sss/pubconf/krb5.include.d/*z/var/log/sssd/*log*Z	sssd_logs)Ztagsz/var/lib/sss/mc/passwdz/var/lib/sss/mc/groupz/var/lib/sss/mc/initgroupsr	   )r
   zsssctl config-check)Zpredzsssctl domain-listZstatusr   outputzsssctl domain-status -o )add_copy_specr   r   Zadd_cmd_outputZcollect_cmd_output
splitlines)selfZ	sssd_predZdomainZdomain_name r   9/usr/lib/python3/dist-packages/sos/report/plugins/sssd.pysetup   s"    
z
Sssd.setupc                 C   s$   d}|  d|d | d|d d S )Nz#((\s*ldap_default_authtok\s*=)(.*))r   z\2 ********z/etc/sssd/conf.d/*)Zdo_file_subZdo_path_regex_sub)r   Zregexpr   r   r   postproc8   s    zSssd.postprocN)	__name__
__module____qualname__Z
short_descZplugin_nameZprofilesZpackagesr   r   r   r   r   r   r      s    r   c                   @   s   e Zd ZdS )
RedHatSssdN)r   r   r   r   r   r   r   r   ?   s   r   c                       s   e Zd Z fddZ  ZS )
DebianSssdc                    s   t    | d d S )Nz/etc/default/sssd)superr   r   )r   	__class__r   r   r   E   s    
zDebianSssd.setup)r   r   r   r   __classcell__r   r   r   r   r   C   s   r   N)
r   Zsos.report.pluginsr   r   r   r   r   r   r   r   r   r   r   r   <module>   s   /