o
    G%@i                     @   s&   d dl mZmZ G dd deeZdS )    )PluginIndependentPluginc                   @   s,   e Zd ZdZdZdZdZdd Zdd Zd	S )
SudozSudo command executionsudo)identitysystem)r   c              
   C   s   |  d d}ddg}z,t|ddd}|D ]}|dr&|| d	  qW d    n1 s1w   Y  W n tyT } z| d
| d|  W Y d }~nd }~ww | dsa|  | d S |  dd |D  d S )Nz
/etc/sudo*z/etc/sudo.confz/var/log/sudo_debugz/var/log/sudoers_debugrzUTF-8)encodingDebug   zCould not open conf file z: all_logsc                 S   s   g | ]}| d qS )* ).0logr   r   9/usr/lib/python3/dist-packages/sos/report/plugins/sudo.py
<listcomp>&   s    zSudo.setup.<locals>.<listcomp>)add_copy_specopen
startswithappendsplitIOError
_log_error
get_option)selfconfig_file	log_filescfilelineerrorr   r   r   setup   s*   


z
Sudo.setupc                 C   s   d}|  d|d d S )Nz(\s*bindpw\s*)\S+z/etc/sudo-ldap.confz
\1********)do_file_sub)r   regexpr   r   r   postproc(   s   zSudo.postprocN)	__name__
__module____qualname__
short_descplugin_nameprofilespackagesr!   r$   r   r   r   r   r      s    r   N)sos.report.pluginsr   r   r   r   r   r   r   <module>   s   
