9fe3ac2 setroubleshoot.util: get_rpm_nvr_by_type() and get_rpm_nvr_by_scontext()

Authored and Committed by plautrba 4 years ago
    setroubleshoot.util: get_rpm_nvr_by_type() and get_rpm_nvr_by_scontext()
    
    get_rpm_nvr_by_scontext(scontext)
         Finds an SELinux module which defines given SELinux context
    
         ##### arguments
    
         * `scontext(s)`: an SELinux context
    
         ##### return values
    
         * `nvr(s)`: nvr of rpm which ships module where SELinux type used in `scontext` is defined
    
         ##### usage
    
         >>> get_rpm_nvr_by_scontext("system_u:system_r:syslogd_t:s0")
         selinux-policy-
    
         >>> get_rpm_nvr_by_scontext("system_u:system_r:mysqld_log_t:s0")
         mysqld-selinux-
    
         >>> get_rpm_nvr_by_scontext("system_u:system_r:timedatex_t:s0")
         selinux-policy-
    
     get_rpm_nvr_by_type(selinux_type)
         Finds an SELinux module which defines given SELinux type
    
         ##### arguments
    
         * `selinux_type(s)`: an SELinux type
    
         ##### return values
    
         * `nvr(s)`: nvr of rpm which ships module where `selinux_type` is defined
    
         ##### usage
    
         >>> get_rpm_nvr_by_type("sshd_t")
         selinux-policy-
    
         >>> get_rpm_nvr_by_type("mysqld_log_t")
         mysqld-selinux