HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/thread-self/root/lib/python3/dist-packages/uaclient/cli/__pycache__/cve.cpython-38.pyc
U

��Jh��@s"ddlZddlZddlmZddlmZmZmZmZm	Z	ddl
mZddlm
Z
mZmZddlmZddlmZddlmZmZmZdd	lmZdd
lmZddlmZedd
dddg�Zejej d�ed�dd��Z!dd�Z"dd�Z#dd�Z$edej%ej&e$ej'deedej(d�gd�gd�Z)dS) �N)�
namedtuple)�defaults�
exceptions�messages�system�util)�VulnerabilityData)�CVEInfo�CVEsOptions�_cves)�#query_installed_source_pkg_versions)�cli_util)�ProArgument�ProArgumentGroup�
ProCommand)�Table)�HelpCategory)�UAConfig�AffectedPackage�name�
fix_status�
fix_origin�fix_version)�msg��cfgcKs2ztt�|d�}Wntjk
r,d}YnX|S)N)Zoptionsr)rr
r�VulnerabilityDataNotFound)�argsr�kwargs�result�r �2/usr/lib/python3/dist-packages/uaclient/cli/cve.py�_get_cve_vulnerabilitiess

r"c
Cs~g}t�}|jD]h}|�|i���}t|�D]J}|j�|�}|r,|jD].}	|	j|krF|�t	||	j
|	j|	jd��q,qFq,q|S)N)rrrr)
rZrelated_packages�get�keys�sortedZpackages�cvesr�appendrrrr)
�cve_vulnerabilities�cve_info�cve_name�rowsZinstalled_pkgs_by_sourceZ
source_pkgZbinary_pkgsZ
binary_pkgZbinary_pkg_info�cver r r!�_get_affected_pkgs s&


��
r-cCs`g}|D]R}|jdkr>|�d�|j�|jd�|j�|jg�q|�d�|j�|jddg�q|S)NZfixedz{}:z({})�)rr'�formatrrr)Z
affected_pkgsZformatted_rowsZaffected_pkgr r r!�_format_affected_pkgs:s$


��	
��	r0c
Ksr|j��}t||d�}|s"t���||jkr�t|����di��di��|�}|s�t�	�j
}ttj
j|j|d�tj|�d�tjd�dSt|dt�|d�|d	|d
|d|dgd
�}d}n*|j|}tt|||j��}	t|	d���}td�|��td�tj|��td�|j�d���td�|j�d���td�|j�d���td�t�|j ���|j!�r|td�|j!��|j"�r�td�|j"��td�td�d�#t$j%|j&tj'ddddd����|j(�rtd�|j(D]"}
tt$j)|
tj'ddd d!d���q�|�r,td"�|�*�D]}td|��qntd#�|j+�rnd$d%�|j+D�}|�rntd&�|D]}
t|
��q^dS)'NrZsecurity_issuesr&z{}/{})Zissue�releaseZurl)�file�description�published_atZubuntu_priority�notes�
cvss_score�
cvss_severity)r3r4�priorityr5r6r7�related_usnsr.)r+zname:            {}zpublic-url:      {}/{}zpublished-at:    {}z%Y-%m-%dzcve-cache-date:  {}zapt-cache-date:  {}zpriority:        {}zcvss-score:      {}zcvss-severity:   {}zdescription: |z{}�
Fz  )�widthZbreak_long_wordsZbreak_on_hyphensZinitial_indentZsubsequent_indentznotes:z  - z    zaffected_packages:zaffected_packages: []cSs"g|]}|jrd�|j|j��qS)z  {}: {})�titler/r)�.0Zusnr r r!�
<listcomp>�s�zaction_cve.<locals>.<listcomp>z
related_usns:),r,�upperr"rrr&rr#rZget_release_infor1�printrZCLI_CVE_NOT_FOUND_IN_DATAr/rZBASE_SECURITY_URL�sys�stderrr	rZparse_rfc3339_dater0r-rZ	to_stringr4�strftimeZvulnerability_data_published_atZapt_updated_atr
Zcolorize_priorityr8r6r7�join�textwrapZwrapr3ZPRINT_WRAP_WIDTHr5Zfill�
splitlinesr9)rrrr*r(Zcve_datar1r)Zaffected_pkgs_tableZaffected_pkgs_rowsZnote�liner9Zrelated_usnr r r!�
action_cveTs�

����
���	
��
�����
��
������
���rHr,T)�help)Z	arguments)rIr3�actionZ
help_categoryZpreserve_descriptionZargument_groups)*rArE�collectionsrZuaclientrrrrrZ+uaclient.api.u.pro.security.cves._common.v1rZ#uaclient.api.u.pro.security.cves.v1r	r
rZ'uaclient.api.u.pro.security.fix._commonrZuaclient.clir
Zuaclient.cli.commandsrrrZuaclient.cli.formatterrZuaclient.cli.parserrZuaclient.configrrZwith_spinnerZCLI_CVES_SPINNER_MSGr"r-r0rHZCLI_CVEZCLI_CVE_DESCZSECURITYZ
CLI_CVE_ISSUEZcve_commandr r r r!�<module>sJ
�	�����