%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/uaclient/cli/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/uaclient/cli/__pycache__/fix.cpython-312.pyc

�

�(�f�r����ddlZddlZddlmZmZmZmZmZmZm	Z	ddl
mZmZm
Z
mZmZddlmZmZddlmZddlmZmZddlmZmZddlmZmZmZmZdd	l m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4dd
l5m6Z6ddl5m7Z8ddl9m:Z:ddl9m7Z;dd
l<m=Z=m>Z>ddl?m@Z@mAZAmBZBddlCmDZDddlEmFZFddlGmHZHmIZImJZJddlKmLZLddlMmNZNddlOmPZPddlQmRZRmSZSmTZTddlUmVZVddlWmXZXddlYmZZZddl[m\Z\Gd�d�Z]de+fd�Z^de-fd�Z_d e`d!ead"eLfd#�Zbd e`d!ead$ead"eLfd%�Zc	dSd&ee`d'e`d(edd)edd*ee`d+e`fd,�Zed"eLd-e`d+eafd.�ZfdTd/�Zgd"eLfd0�Zhd"eLd+eafd1�Zid2ee`d+e`fd3�Zjd"eLd!ead+eafd4�Zkd"eLd+eafd5�Zld"eLd6e`d+eafd7�Zmd6e`d"eLd!ead+eafd8�Zn	dUd'ed9e`d:e`fd;�Zod<e`fd=�Zpd>e]d?e0fd@�Zqd>e]d?e1fdA�Zrd>e]d?e/fdB�Zsd>e]d?e$fdC�Ztd>e]d?e%fdD�Zud>e]d?e&fdE�Zvd>e]d?e*fdF�Zwd>e]d?e(fdG�Zxd>e]d?e'fdH�Zyde+d!ead"eLd+eeeeffdI�ZzdJ�Z{eBdKe
j�e
j�e{eFj�eAe@d e
j��L�e@dMe
�jdN�O�e@dPe
�jdN�O�g�Q�g�R�Z�y)V�N)�Dict�List�
NamedTuple�Optional�Set�Tuple�Union)�apt�
exceptions�messages�system�util)�attach_with_token�enable_entitlement_by_name)�	_initiate)�MagicAttachRevokeOptions�_revoke)�MagicAttachWaitOptions�_wait)�CVE_OR_USN_REGEX�	FixStatus�UnfixedPackage�status_message)�ESM_APPS_POCKET�ESM_INFRA_POCKET�STANDARD_UPDATES_POCKET�FixPlanAptUpgradeStep�FixPlanAttachStep�FixPlanEnableStep�FixPlanNoOpAlreadyFixedStep�FixPlanNoOpLivepatchFixStep�FixPlanNoOpStatus�FixPlanNoOpStep�
FixPlanResult�FixPlanStep�FixPlanUSNResult�FixPlanWarning�"FixPlanWarningFailUpdatingESMCache�&FixPlanWarningPackageCannotBeInstalled�#FixPlanWarningSecurityIssueNotFixed�NoOpAlreadyFixedData�NoOpLivepatchFixData�USNAdditionalData)�CVEFixPlanOptions)�_plan)�USNFixPlanOptions)�ContractExpiryStatus�_is_attached)�ProArgument�ProArgumentGroup�
ProCommand)�
action_detach)�HelpCategory)�CLOUD_TYPE_TO_TITLE�PRO_CLOUD_URLS�get_cloud_type)�UAConfig)�PRINT_WRAP_WIDTH)�entitlement_factory)�ApplicabilityStatus�CanEnableFailure�UserFacingStatus)�notices)�Notice)�
PRO_HOME_PAGE)�colorize_commandsc�j�eZdZdededeedefd�Zd�Z	ddeed	ed
e	efd�Z
deed
efd�Zy)�
FixContext�title�dry_run�
affected_pkgs�cfgc���d|_g|_t�|_tj
|_||_||_||_	||_
d|_d|_d|_
y)NrTF)�	pkg_index�unfixed_pkgs�set�installed_pkgsr�SYSTEM_NON_VULNERABLE�
fix_statusrGrIrHrJ�should_print_pkg_header� warn_package_cannot_be_installed�fixed_by_livepatch)�selfrGrHrIrJs     �2/usr/lib/python3/dist-packages/uaclient/cli/fix.py�__init__zFixContext.__init__Ss_��������!�e���#�9�9�����
�*���������'+��$�05��-�"'���c�Z�|jr�tjjt	|j��jt	|j�dj
t|j����}ttj|tdd���yy)N�, )�count�pkgs�    F)�width�subsequent_indent�replace_whitespace)rIr�SECURITY_AFFECTED_PKGS�	pluralize�len�format�join�sorted�print�textwrap�fillr<)rU�msgs  rV�print_fix_headerzFixContext.print_fix_headerfs�������1�1�;�;��D�&�&�'���f��$�,�,�-��Y�Y�v�d�&8�&8�9�:���
�
��
�
��*�&,�',�	�
�rXN�source_pkgs�status�pocketc��|jrDtt|||jt	|j
�|rt
|�nd���yy)N)�pkg_listrmrL�num_pkgs�
pocket_source)rRrg�_format_packages_messagerLrcrI�get_pocket_description)rUrlrmrns    rV�print_pkg_headerzFixContext.print_pkg_headerwsJ���'�'��(�(�!�"�n�n� ��!3�!3�4�:@�.�v�6�d�
�

�(rXr\�unfixed_reasonc�^�|D](}|jjt||����*y)N)�pkgrv)rM�appendr)rUr\rvrxs    rV�add_unfixed_packageszFixContext.add_unfixed_packages�s/���	�C����$�$��3�~�F�
�	rX�N)�__name__�
__module__�__qualname__�str�boolrr;rWrkrrurz�rXrVrFrFRs{��(��(��(��C�y�	(�
�(�&�*!%�	��#�Y������
�	�&��c���C�rXrF�cvec���dj|jj�|j��dj|jj��g}t	dj|��y)N�{issue}: {description}��issue�descriptionz! - https://ubuntu.com/security/{}�
)rdrG�upperr�rgre)r��liness  rV�print_cve_headerr��s^�� �'�'��)�)�/�/�#����	(�	
�	,�2�2�3�9�9�?�?�3D�E�	
�E�
�$�)�)�E�
�rX�fix_planc��|j}dj|jj�|j��g}|j
}t
|t�r�|jry|jtj�|jD]J}|jdjtjjj|�����LnP|jrD|jtj�|jD]}|jd|z��t!dj#|��y)Nr�r�z - {})r�z - r�)�target_usn_planrdrGr�r��additional_data�
isinstancer-�associated_cvesryr�SECURITY_FOUND_CVES�urls�SECURITY_CVE_PAGE�associated_launchpad_bugs�SECURITY_FOUND_LAUNCHPAD_BUGSrgre)r��
target_usnr�r�r��lp_bugs      rV�print_usn_headerr��s���)�)�J� �'�'��"�"�(�(�*�
�8N�8N�	(�	
�
�E�!�0�0�O��/�#4�5��*�*��L�L��5�5�6�&�6�6�
������N�N� �
�
�7�7�>�>�3�>�G���
��
6�
6��L�L��?�?�@�)�C�C�
-�����U�V�^�,�
-�
�$�)�)�E�
�rX�security_issuerHrJc���tt|g��|��}|jjdj}|rN|j
rBt
jtj|jxsd|j
����t|jjd�t�t|jjd||�\}}|S)N)�cves��optionsrJr�unexpected-error��	named_msg)�cve_planr.�	cves_datar��errorrjr�AnonymousUbuntuProErrorr�NamedMessage�coder�rg�execute_fix_plan)r�rHrJr�r�rm�_s       rV�fix_cver��s����!��'7�8�c��H�
���#�#�A�&�,�,�E������0�0��+�+��
�
�0�0�%�)�)��
�	
�
�X�'�'�,�,�Q�/�0�	�G� ��!3�!3�!8�!8��!;�W�c�J�I�F�A��MrX�
no_relatedc	��tt|g��|��}|jjdjj
}|rN|jrBtjtj|jxsd|j����t|jjd�tdtjj|��z�t!|jjdj||�\}}|t"j$t"j&fvr|S|jjdj(}|r|r|Stdtj*jdj-d	�|D���
�z�tdtj.z�i}	|D]J}
tdj|
j0��t!|
||�|	|
j0<t��Lttj2�t5||tj6��d
}|D]�}
|	|
j0\}}
t5||
j0tj8��|t"j:k(r.tdtj<jd��z�d}|t"j>k(s��|
D]>}|j@s�tdj|jB|j@���@d}��|r,tdtjDj|��z�|S)N)�usnsr�rr�r�r�)�issue_idz
- c3�4K�|]}|j���y�wr{)rG)�.0�usns  rV�	<genexpr>zfix_usn.<locals>.<genexpr>�s����$L�3�S�Y�Y�$L�s�)�related_usnsz- {})�contextF�- �
fix operation��	operationTz
  - {}: {})#�usn_planr0�	usns_datar�r�r�rjrr�rr�r�r�rg�SECURITY_FIXING_REQUESTED_USNrdr�rrP�SYSTEM_NOT_AFFECTED�related_usns_plan�SECURITY_RELATED_USNSre�SECURITY_FIXING_RELATED_USNSrG�SECURITY_USN_SUMMARY�_handle_fix_status_message�FIX_ISSUE_CONTEXT_REQUESTED�FIX_ISSUE_CONTEXT_RELATED�SYSTEM_VULNERABLE_UNTIL_REBOOT�ENABLE_REBOOT_REQUIRED_TMPL�SYSTEM_STILL_VULNERABLErvrx�SECURITY_RELATED_USN_ERROR)r�rHr�rJr�r��target_usn_statusr�r��related_usn_status�related_usn_plan�failure_on_related_usnrmrM�unfixed_pkgs               rV�fix_usnr��s2���!��'7�8�c��H�
���#�#�A�&�6�6�<�<�E������0�0��+�+��
�
�0�0�%�)�)��
�	
�
�X�'�'�,�,�Q�/�0�	��
�
0�
0�
7�
7�#�8�
�	
��,�������"�2�2������q���'�'��%�%�!��!� � �*�*�/�/��2�D�D���
� � �	��
�
(�
(�
/�
/����$L�:K�$L�L�0�
�	
��
�$��6�6�
6�7�
��.���
�f�m�m�,�2�2�3�4�5E����6
��+�1�1�2�
	���
�(�
'�
'�(�����4�4��#��-�*��1�2B�2H�2H�I����"���"�"��6�6�	
��Y�=�=�=����6�6�=�=�-�>���
�&*�"��Y�6�6�6�+�
���-�-��$�+�+�'�O�O�[�-G�-G���
�&*�"�1*�4�
���1�1�8�8�'�9��
�	
��rXrprmrLrqrr�returnc
�v�|syg}g}|D]9}|dz
}|jdj||��|j|��;tjdjddj	|�zdzdj	t|���td�	�}d
j|t||��S)z;Format the packages and status to an user friendly message.��z{}/{}z{} {}:�(rZ�)r]�r^r_z{}
{})ryrdrhrirerfr<r)	rprmrLrqrr�	msg_index�src_pkgs�src_pkg�
msg_headers	         rVrsrs0s������I��H��!���Q��	�������	�8�<�=����� �!�
�������$�)�)�I�&�&��,�d�i�i��x�8H�.I�	
�� ��J��?�?�:�~�f�m�'L�M�MrX�tokenc��ttdd|gg��	t||d��y#tj$r}t|j
�Yd}~yd}~wwxYw)ztAttach to an Ubuntu Pro subscription with a given token.

    :return: True if attach performed without errors.
    �pro�attachT)r��allow_enableNF)rgrDrr�UbuntuProErrorrj)rJr��errs   rV�_run_ua_attachr�LsT��

�
�e�X�u�5�6�
7�8���#�U��>����$�$��
�c�g�g�����s�)�A�A�Ac���t�\}}|tj�vrQttj
j
tj|�tj|����yy)z:Alert the user when running Pro on cloud with PRO support.)rG�cloud_specific_urlN)	r:r9�keysrgr�SECURITY_USE_PRO_TMPLrdr8�get)�
cloud_typer�s  rV�*_inform_ubuntu_pro_existence_if_applicabler�Zsa��"�$�M�J���^�(�(�*�*�
��*�*�1�1�)�-�-�j�9�#1�#5�#5�j�#A�
2�
�	
�+rXc��ttj�t|��}tdtjj|j��z�t|j��}	t||��}tdtjz�t!||j"�S#tj$rC}ttj�t|j��}t||��|�d}~wwxYw)N)rJr�)�	user_code)�magic_tokenr�)rgr�CLI_MAGIC_ATTACH_INITr�CLI_MAGIC_ATTACH_SIGN_INrdr�rr�rr�MagicAttachTokenError�CLI_MAGIC_ATTACH_FAILEDrr�CLI_MAGIC_ATTACH_PROCESSINGr��contract_token)rJ�
initiate_resp�wait_options�	wait_resp�e�revoke_optionss      rV�_perform_magic_attachr�fs���	�(�
(�
(�)��#�&�M�	��
�
+�
+�
2�
2�#�-�-�3�
�	
��*�m�6I�6I�J�L�	��,�C�8�	�
�$��5�5�
5�6��#�y�7�7�8�8���+�+��
�h�.�.�/�1�%�+�+�
��	��C�0�����s�3
B2�2D�>D�Dc�.�t�ttj�t	j
tjgd���}|dk(ry|dk(rt|�S|dk(r0ttj�td�}t||�Sy)	zZPrompt for attach to a subscription or token.

    :return: True if attach performed.
    )�s�a�c��
valid_choicesr�Fr�r��> T)r�rgr�*SECURITY_UPDATE_NOT_INSTALLED_SUBSCRIPTIONr�prompt_choices�SECURITY_FIX_ATTACH_PROMPTr��PROMPT_ENTER_TOKEN�inputr�)rJ�choicer�s   rV�_prompt_for_attachr�s���
/�0�	�(�
=�
=�>�
�
 �
 ��+�+�%��F���}��
��}�$�S�)�)�
��}�
�h�)�)�*��d����c�5�)�)�rXrMc
���t|�}tjtjj|�j
|djt|����td��S)z�Format the list of unfixed packages into an message.

    :returns: A string containing the message output for the unfixed
              packages.
    rZ)rqr\r]r�)
rcrhrir�SECURITY_PKG_STILL_AFFECTEDrbrdrerfr<)rM�num_pkgs_unfixeds  rV�_format_unfixed_packages_msgr�sb���<�(���=�=��,�,�6�6��	
�
�&�%����6�,�/�0��
�� �	�	rXc��t|�j}|r:|tjjk(r|rttj�yyy)zuCheck if the Ubuntu Pro subscription is expired.

    :returns: True if subscription is expired and not renewed.
    FT)r2�contract_statusr1�EXPIRED�valuergr�(SECURITY_DRY_RUN_UA_EXPIRED_SUBSCRIPTION)rJrH�contract_expiry_statuss   rV�_check_subscription_is_expiredr�sG��
*�#�.�>�>���"�&:�&B�&B�&H�&H�H���(�C�C�D���rXc��ddl}t�ttj�tjtjjt��ddg��}|dk(rdttj�td�}ttdd	gg��t|jd
d��|�t||�Sy
)zdPrompt for attach a new subscription token to the user.

    :return: True if attach performed.
    rN)�url�rr�r�r�r��detachT�cli)�
assume_yesrdF)�argparser�rgr�%SECURITY_UPDATE_NOT_INSTALLED_EXPIREDrr��SECURITY_FIX_RENEW_PROMPTrdrC�PROMPT_EXPIRED_ENTER_TOKENrrDr6�	Namespacer�)rJrrr�s    rV�_prompt_for_new_tokenr�s���
�.�0�	�(�
8�
8�9�
�
 �
 ��*�*�1�1�m�1�D��C�j��F���}�
�h�1�1�2��d���
��%��!2� 3�4�5��h�(�(�D��(�G��M��c�5�)�)�rX�servicec��ttjj|���t	j
tjj|��ddg��}|dk(rittdd|gg��t||��\}}|s=|�;t|t�r+|j�t|jj�|Sy)	zMPrompt for enable a pro service.

    :return: True if enable performed.
    �rr�r�r�r��enable�rJ�nameF)
rgr�SECURITY_SERVICE_DISABLEDrdrr��SECURITY_FIX_ENABLE_PROMPTrDrr�r?�messagerj)rJrr�ret�reasons     rV�_prompt_for_enabler'�s���

�(�
,�
,�
3�
3�G�
3�
D�E�
�
 �
 ��+�+�2�2�7�2�C��C�j��F�
��}�
��%��7�!;� <�=�>�0�S�w�G���V���"��6�#3�4��~�~�)��f�n�n�(�(�)��
�rXc�,�t||��}|�r|j�\}}|tjk(ry|j	�\}}|t
jk(r�|r7tdtjj|j��z�yt||j�ryttjj|j���yttjj|j���y)zQ
    Verify if the Ubuntu Pro subscription has the required service enabled.
    r Tr�rF)r=�user_facing_statusr@�ACTIVE�applicability_statusr>�
APPLICABLErgr�'SECURITY_DRY_RUN_UA_SERVICE_NOT_ENABLEDrdr!r'�SECURITY_UA_SERVICE_NOT_ENABLED� SECURITY_UA_SERVICE_NOT_ENTITLED)rrJrH�ent�
ent_statusr�r+s       rV�)_handle_subscription_for_required_servicer2�s���#�G�
4�C�
��.�.�0�
�
�A��)�0�0�0��"%�":�":�"<���a��#6�#A�#A�A�����F�F�M�M� #���N�����!�#�s�x�x�0����<�<�C�C� #���D����

��9�9�@�@��H�H�A��
�rXr�r�c��|tjk(rc|r"tjj	||��}n tj
j	|��}t
tj|��y|tjk(rc|r"tjj	||��}n tjj	|��}t
tj|��y|tjk(rc|r"tjj	||��}n tjj	|��}t
tj|��y|r"tjj	||��}n tjj	|��}t
tj|��y)N)r�r��r�)rrPr�%SECURITY_ISSUE_RESOLVED_ISSUE_CONTEXTrd�SECURITY_ISSUE_RESOLVEDrgr�handle_unicode_charactersr��'SECURITY_ISSUE_UNAFFECTED_ISSUE_CONTEXT�SECURITY_ISSUE_UNAFFECTEDr��)SECURITY_ISSUE_NOT_RESOLVED_ISSUE_CONTEXT�SECURITY_ISSUE_NOT_RESOLVED)rmr�r�rjs    rVr�r�sv����0�0�0���@�@�G�G���H��C��2�2�9�9��9�I�C�
�d�,�,�S�1�2�	�9�0�0�	0���B�B�I�I���J��C��4�4�;�;�(�;�K�C�
�d�,�,�S�1�2�	�9�;�;�	;���D�D�K�K���L��C��6�6�=�=�H�=�M�C�
�d�,�,�S�1�2���D�D�K�K���L��C��6�6�=�=�H�=�M�C�
�d�,�,�S�1�2rXrnc��|tk(rtjS|tk(rtjS|t
k(rtjS|Sr{)rr�'SECURITY_UBUNTU_STANDARD_UPDATES_POCKETr�SECURITY_UA_INFRA_POCKETr�SECURITY_UA_APPS_POCKET)rns rVrtrt@sE��
�(�(��?�?�?�	�#�	#��0�0�0�	�?�	"��/�/�/��
rX�fix_context�stepc��|j|jjd|jj��d|_t
jj|jj|jj��}td|z�|j|jjg|��d|_
tj|_y)N�released�rlrmrnF)�package�versionr��r\rvT)ru�data�related_source_packagesrnrRr�FIX_CANNOT_INSTALL_PACKAGErd�binary_package�binary_package_versionrgrz�source_packagerSrr�rQ)r@rA�warn_msgs   rV�)_execute_package_cannot_be_installed_steprOKs���� � ��I�I�5�5���y�y���!��
+0�K�'��2�2�9�9��	�	�(�(��	�	�0�0�:��H�
�$��/���$�$��i�i�&�&�
'��%��48�K�0�&�>�>�K�rXc��|j|jj|jj��|xjt|jj�z
c_|j
|jjt|jj���tj|_
y)N)rlrmrG)rurH�source_packagesrmrLrcrzrrr�rQ�r@rAs  rV�&_execute_security_issue_not_fixed_steprSds���� � ��I�I�-�-��y�y���!�����S����!:�!:�;�;���$�$�
�Y�Y�
&�
&�%�d�i�i�&6�&6�7�%��'�>�>�K�rXc��tj�rttj�ytdtj
zdz�y)Nr�)r�we_are_currently_rootrgr�CLI_FIX_FAIL_UPDATING_ESM_CACHE�(CLI_FIX_FAIL_UPDATING_ESM_CACHE_NON_ROOTrRs  rV�%_execute_fail_updating_esm_cache_steprXts6���!�!�#�
�h�6�6�7�
�d�X�F�F�F��M�NrXc�P�|j|jjd|jj��|xjt|jj�z
c_|jjs;|jsttj�tj|_
ytj�sp|j sdttj"�tj$|_
|j'|jjtj"��ytt)gd�gd�zt+|jj�zg��|j rtj|_
y	t-j.�t-j0gd�|jjzddi�	�tj|_
d|_|j:j=|jj�y#t2$rg}t5|d
t7|��}t|�tj$|_
|j'|jj|��Yd}~yd}~wwxYw)NrCrDrG)r
�updatez&&)r
�install�--only-upgrade�-y)zapt-getr[r\r]�DEBIAN_FRONTEND�noninteractive)�cmd�override_env_varsrjT)rurHrQrnrLrc�binary_packagesrSrgr�SECURITY_UPDATE_INSTALLEDrrPrQrrUrH�SECURITY_APT_NON_ROOTr�rzrDrfr
�run_apt_update_command�run_apt_command�	Exception�getattrrrRrOrZ)r@rAr�rjs    rV�_execute_apt_upgrade_stepri}s��� � ��I�I�-�-���y�y���!��
���S����!:�!:�;�;���9�9�$�$��;�;��(�4�4�5�!*�!@�!@�����%�%�'��0C�0C�
�h�,�,�-�!*�!B�!B����(�(����*�*�#�9�9�	)�	
�	�	��'�<�=�����2�2�3�4�
�	
�����!*�!@�!@������"�"�$����>��i�i�'�'�(�0�2B�C�	
�'�<�<�K��*.�K�'����%�%�d�i�i�&?�&?�@�����a���A��'��
�c�
�!*�!B�!B����(�(����*�*��	)�	
�	���s�#AH5�5	J%�>AJ � J%c��|jjdk(rtnt}|j	|jj
d|��d|_t|j�js�|jrtdtjz��nPt|j��s:tj |_|j%|jj
tj&j)|jj����yt+|j|j��r�|jrttj,�n�t/|j�sotj |_|j%|jj
tj0j)|jj����ytj2|_y)	N�	esm-infrarCrDFr�rrG)rJrH)rH�required_servicerrrurQrRr2rJ�is_attachedrHrgr� SECURITY_DRY_RUN_UA_NOT_ATTACHEDrrr�rQrz�SECURITY_UA_SERVICE_REQUIREDrdrr
r�$SECURITY_UA_SERVICE_WITH_EXPIRED_SUBrP�r@rArns   rV�_execute_attach_steprr�s����9�9�%�%��4�	�
��
� � ��I�I�-�-���!��+0�K�'�����(�4�4�����$��B�B�B�C�%�k�o�o�6�)2�)J�)J��&��0�0����2�2�#+�#H�#H�#O�#O� $�	�	� :� :�$P�$�1���	'��O�O�[�%8�%8�
�����(�C�C�D�&�{���7�%.�%F�%F�K�"��,�,��Y�Y�.�.�'�L�L�S�S� �I�I�6�6� T� �
-�
�
�&�<�<�K�rXc��|jjdk(rtnt}|j	|jj
d|��d|_t|jj|j|j�so|j|jj
tjj|jj����tj|_ytj"S)NrkrCrDFrrG)rHrrrrurQrRr2rJrHrzr�%SECURITY_UA_SERVICE_NOT_ENABLED_SHORTrdrr�rQrPrqs   rV�_execute_enable_stepru�s����9�9����+�	�
��
� � ��I�I�-�-���!��
+0�K�'�4��	�	����������
	�(�(����*�*�#�I�I�P�P��	�	�)�)�Q��	)�	
�"+�!B�!B�����*�*�*rXc���|jjtjjk(r/ttj�tj|_
yyr{)rHrmr"�NOT_AFFECTEDrrgr�SECURITY_NO_AFFECTED_PKGSrr�rQrRs  rV�_execute_noop_not_affected_steprysE���y�y���,�9�9�?�?�?�
�h�0�0�1�!*�!>�!>���@rXc���t|jt�rPttj
j
|j|jj���d|_	yy)N)r�rFT)
r�rHr,rgr�CVE_FIXED_BY_LIVEPATCHrdrG�
patch_versionrTrRs  rV�%_execute_noop_fixed_by_livepatch_stepr}sY���$�)�)�1�2�
��+�+�2�2�!�'�'��	�	�/�/�
3�
�	
�*.��&�3rXc�H�t|jt�r�|j|jjd|jj
��t
tj�|xjt|jj�z
c_	yy)NrCrD)r�rHr+rurQrnrgrrcrLrcrRs  rV� _execute_noop_already_fixed_stepr sx���$�)�)�1�2��$�$��	�	�1�1���9�9�#�#�	%�	
�
	�h�0�0�1�����T�Y�Y�%>�%>�!?�?��3rXc�@�g|j�|j�}t|j||jxsg|��}|j�t
|d���D�]^}t|t�rt||�t|t�rt||�t|t�rt||�t|t�r+t||�|j t"j$k7rn�t|t&�r+t)||�|j t"j$k7rn�t|t*�r+t-||�|j t"j$k7rnYt|t.�rt1||�t|t2�rt5||�t|t6�s��St9||���at;�|j<r]t;t?tAtC|j<D�cgc]}|jD��c}����t"jF|_|j t"j$k(r�tIjJ|jL��ret"jN|_tPjRjUd��}t;|�tWjXtZj\d��|j^s ta|j |j�|j |j<fScc}w)N)rGrHrIrJc��|jSr{)�order)�xs rV�<lambda>z"execute_fix_plan.<locals>.<lambda>=s
�����rX)�key)rOr�r�)1�plan�warningsrFrG�affected_packagesrkrfr�r)rOr*rSr(rXrrirQrrPrrrrrur#ryr!r}r rrgrMr�listrNrxr�r
�
should_rebootrOr�rr�rdrA�addrB�ENABLE_REBOOT_REQUIREDrTr�)r�rHrJ�	full_planr@rAr��
reboot_msgs        rVr�r�-s����	����	�	�	��I�
��n�n���0�0�6�B��	�K�� � �"��y�&7�8�@���d�B�C�5�k�4�H��d�?�@�2�;��E��d�>�?�1�+�t�D��d�1�2�%�k�4�8��%�%��)H�)H�H���d�-�.� ��d�3��%�%��)H�)H�H���d�-�.� ��d�3��%�%��)H�)H�H���d�O�,�+�K��>��d�7�8�1�+�t�D��d�7�8�,�[�$�?�9@�<
�G����
�(���0;�/G�/G�� +�(�O�O����	
�	
�"+�!B�!B���	���)�"A�"A�A�� � ��0J�0J�K�!*�!I�!I����9�9�@�@�%�A�
�
�	�j������)�)�%�	
�
�)�)�"�;�#9�#9�8�>�>�J��"�"�K�$<�$<�=�=��7s�:Lc���tjt|j�s t	j
|j���|jrttj�d|jj�vr-t|j|j|�}|jSt|j|j|j|�}|jS)Nr4r�)�re�matchrr�r�InvalidSecurityIssueIdFormatrHrgr�SECURITY_DRY_RUN_WARNING�lowerr�r�r��	exit_code)�argsrJ�kwargsrms    rV�
action_fixr�s���
�8�8�$�d�&9�&9�:��5�5��%�%�
�	
��|�|�
�h�/�/�0���#�#�)�)�+�+���,�,�d�l�l�C�@������	�������t����
�����rX�fix)�helpz	--dry-run�
store_true)r��actionz--no-related)�	arguments)r�r�r��
help_category�argument_groupsr{)r�N)r�)�r�rh�typingrrrrrrr	�uaclientr
rrr
r�uaclient.actionsrr�+uaclient.api.u.pro.attach.magic.initiate.v1r�)uaclient.api.u.pro.attach.magic.revoke.v1rr�'uaclient.api.u.pro.attach.magic.wait.v1rr�'uaclient.api.u.pro.security.fix._commonrrrr�/uaclient.api.u.pro.security.fix._common.plan.v1rrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-�+uaclient.api.u.pro.security.fix.cve.plan.v1r.r/r��+uaclient.api.u.pro.security.fix.usn.plan.v1r0r��(uaclient.api.u.pro.status.is_attached.v1r1r2�uaclient.cli.commandsr3r4r5�uaclient.cli.detachr6�uaclient.cli.parserr7�uaclient.clouds.identityr8r9r:�uaclient.configr;�uaclient.defaultsr<�uaclient.entitlementsr=�(uaclient.entitlements.entitlement_statusr>r?r@�uaclient.filesrA�uaclient.files.noticesrB�uaclient.messages.urlsrC�uaclient.statusrDrFr�r�rr�r�r��intrsr�r�r�rrrrr'r2r�rtrOrSrXrirrruryr}rr�r��CLI_ROOT_FIX�CLI_FIX_DESC�SECURITY�
CLI_FIX_ISSUE�CLI_FIX_DRY_RUN�CLI_FIX_NO_RELATED�fix_commandr�rXrV�<module>r�s���	�����=�<�J�A�����������,J�I�I�I��L�K�-�,���
%�.�5���
#�)�0�-�<�<�~�-���/��4�C��$��X��&d��d�"&�d�48�d�?G�d�X$(�N��3�i�N��N��N��	N�
�C�=�N�	�
N�8�������	
�9�x�9�6�H����.�t�C�y��S��&���4��D��$�x��D��.�H��s��t��8(�
�(��(�*.�(�	�(�X68�"3��"3�!$�"3�/2�"3�J�3��?��?�
0�?�2
?��
?�#F�
?� O��O�#E�O�;A��;A�
�;A�|,=��,=�
�,=�^+��+�
�+�B?��?�#2�?�
.��
.�#>�
.�
@��
@�#>�
@�O>��O>�&*�O>�19�O>�
�9�d�>�*�*�+�O>�d�&�	�	�	�	��%�%���'�'���,�8�3I�3I�J���!�1�1�'��
�"�!�4�4�'���	
��
�rX

Zerion Mini Shell 1.0