403Webshell
Server IP : 178.105.222.151  /  Your IP : 216.73.216.38
Web Server : nginx/1.28.3
System : Linux MNK 7.0.0-15-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Wed Apr 22 16:06:43 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.5.4
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/cloudinit/config/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/cloudinit/config/__pycache__/cc_apt_configure.cpython-314.pyc
+
��i���a�RVtX0tRt^RIt^RIt^RIt^RIt^RIt^RIt^RIH	t	^RI
HtHtH
t
Ht^RIHtHtHtHtHt^RIHt^RIHt^RIHt^RIHt^R	IHt]P>!] 4t!R
t"Rt#Rt$R
t%Rt&RRRR/t']^kRRR.RWOR]R./t(]^kRt)Rt*Rt+Rt,RRRR /t-RR!RR!/t.R"R#.t/.RXOt0R$t1R]1/t2RYR%lt3R&R'lt4R(t5R)t6R*t7R+t8R,t9R-t:R.t;R/t<R0t=R1R2lt>R3R4lt?R5R6lt@R7R8ltAR9R:ltBR;R<R=R>R?R@/tCRAtDRBRCltERDtFRZREltGRFtHR[RGltIR\RHltJRItKRJtLRKtMRLtNRMtORNtPROtQRPtRRQtSRYRRltTRStUR]RTltVRU]:/tWR#)^z*Apt Configure: Configure apt for the user.N)�indent)�Dict�Iterable�List�Mapping)�features�	lifecycle�subp�	templater�util)�Cloud)�Config)�
MetaSchema)�GPG)�PER_INSTANCEz
^[\w-]+:\wz/etc/apt/trusted.gpgz/etc/apt/trusted.gpg.d/z/etc/apt/cloud-init.gpg.d/z&# cloud-init disable_suites redacted: �add-apt-repositoryzsoftware-properties-common�gpg�gnupg�id�cc_apt_configure�distros�ubuntu�	frequency�activate_by_schema_keysz/var/lib/apt/listsz'/etc/apt/apt.conf.d/94cloud-init-configz)/etc/apt/apt.conf.d/90cloud-init-aptproxyzkeyserver.ubuntu.com�PRIMARYz!http://archive.ubuntu.com/ubuntu/�SECURITYz"http://security.ubuntu.com/ubuntu/z$http://ports.ubuntu.com/ubuntu-ports�amd64�i386a# Ubuntu sources have moved to the /etc/apt/sources.list.d/ubuntu.sources
# file, which uses the deb822 format. Use deb822-formatted .sources files
# to manage package sources in the /etc/apt/sources.list.d/ directory.
# See the sources.list(5) manual page for details.
c���Vf\P!4pV\9d\P	4#V\
9d\P	4#\RV,4h)z�returns the default mirrors for the target. These depend on the
architecture, for more see:
https://wiki.ubuntu.com/UbuntuDevelopment/PackageArchive#Portsz#No default mirror known for arch %s)r�get_dpkg_architecture�PRIMARY_ARCHES�PRIMARY_ARCH_MIRRORS�copy�PORTS_ARCHES�
PORTS_MIRRORS�
ValueError��archs&�C/usr/lib/python3/dist-packages/cloudinit/config/cc_apt_configure.py�get_default_mirrorsr)UsV���|��)�)�+���~��#�(�(�*�*��|���!�!�#�#�
�:�T�A�
B�B�c
�L�V^8�dQhR\R\R\R\RR/#)��name�cfg�cloud�args�returnN)�strr
r�list)�formats"r(�__annotate__r5ds/��/�/��/�6�/�%�/�t�/��/r*c�@�\V4pVPR/4p\V\4'g%\	RP\
V4R74h\V4\4;_uu_4p\WBV4RRR4R# +'giR#;i)z�process the config for apt_config. This can be called from
curthooks if a global apt config was provided or via the "apt"
standalone command.�aptz9Expected dictionary for 'apt' config, found {config_type})�config_typeN)
�convert_to_v3_apt_format�get�
isinstance�dictr%r4�type�apply_debconf_selectionsr�	apply_apt)r-r.r/r0�apt_cfg�gpg_contexts&&&&  r(�handlerBdsv��
#�3�
'�C��g�g�e�R� �G��g�t�$�$��
"�"(�&�T�'�]�&�"C�
�	
�
�W�%�	���+��'�+�.�
����s�5
B�B	c��\P!4'dR#\P!R4'g\P!R4'gR#R#)Fzapt-getr7)Fzsystem is snappy.)Fzno apt commands.)TzApt is available.)r�system_is_snappyr	�which�r*r(�_should_configure_on_empty_aptrGws@�������)�)��J�J�y�!�!�T�Z�Z��%6�%6�(�(�$�$r*c�b�V'g-\4wr4V'g\PRV4R#\PRV4\P!4R,p\P
!4p\
WVR7p\PRV4RpVPR\4p	V	'd!\P!V	4Pp\WV4\P!VPRR44'd%\WV4p
\WWqV
4\!Wv4\#V\$\&4R
V9d,TpW[R&VR,VR&\/VR
,VVVVR
7R#R# \(\*3d\P-R	4L\i;i)z#Nothing to do: No apt config and %sNzhandling apt config: %s�codenamer&zApt Mirror info: %s�add_apt_repo_match�preserve_sources_listFz)Failed to apply proxy or apt config info:�sources�RELEASE�MIRROR)�template_params�
aa_repo_match)rG�LOG�debugr�lsb_releaser�find_apt_mirror_infor:�ADD_APT_REPO_MATCH�re�compile�search�_ensure_dependencies�is_false�add_mirror_keys�generate_sources_list�rename_apt_lists�apply_apt_config�APT_PROXY_FN�
APT_CONFIG_FN�IOError�OSError�	exception�add_apt_sources)r.r/r�
should_config�msg�releaser'�mirrors�matcher�matchcfg�keys�paramss&&&         r(r?r?�s`���;�=��
���I�I�;�S�A���I�I�'��-���� ��,�G��%�%�'�D�"�3�D�9�G��I�I�#�W�-��G��w�w�+�-?�@�H���*�*�X�&�-�-����u�-��}�}�S�W�W�4�e�<�=�=��s�3�/���c�G�D�A���'�C���l�M�:�
�C����#�y��"�8�,��x����	�N���"�!�	
���	
�W��C��
�
�A�B�C�s�<F�&F.�-F.c�z�VPR4'g
VR,
p\P!R.VRR7R#)�
zdebconf-set-selectionsT��data�captureN)�endswithr	)�
selectionss&r(�debconf_set_selectionsrt�s5�����u�%�%��e��
��I�I�	!�"�
��r*c��.p.pVFZpV\9d<\PRV4\V,!4VPV4KIVPV4K\	\	V4'd\PRV4\	V4'd.\P!RR.\V4,RRR7R#R#)zunconfiguring %szSThe following packages were installed and preseeded, but cannot be unconfigured: %szdpkg-reconfigurez--frontend=noninteractiveNTro)�CONFIG_CLEANERSrQrR�append�len�warningr	r3)�packages�	unhandled�	to_config�pkgs&   r(�dpkg_reconfigurer~�s����I��I����/�!��I�I�(�#�.��C� �"����S�!����S�!�
��9�~�~����
-��	
��9�~�~��	�	�
�!<�=��9�o�
���		
�r*c���VPR4pV'g\PR4R#RP\	VP44Uu.uFq!V,NK
	up4p\
VP44\4pVP4F^wrVVP4FEpVPR4'dK\P!RRV4pVPV4KG	K`	\P !4p	\PRV4VP#V	4p
V
'g\PR	4R#\%V
4R#uupi)
z2apply_debconf_selections - push content to debconf�debconf_selectionsz(debconf_selections was not set in configN�
�#z[:\s].*�z
pkgs_cfgd: %szno need for reconfig)r:rQrR�join�sortedrkrt�encode�set�items�
splitlines�
startswithrV�sub�addr�get_installed_packages�intersectionr~)r.�selsets�keyrs�	pkgs_cfgd�_key�content�liner}�pkgs_installed�
need_reconfigs&          r(r>r>�s���g�g�*�+�G���	�	�<�=�����F�7�<�<�>�4J�K�4J�S�C�L�L�4J�K�L�J��:�,�,�.�/���I� ����
���&�&�(�D����s�#�#���&�&��R��.�C��M�M�#��	)�)��0�0�2�N��I�I�o�y�)��*�*�>�:�M���	�	�(�)���]�#��+Ls�E,c���\P!\P!RR74p\P	RV4VFp\
P!V4K	R#)z%clean out any local cloud-init configz/etc/cloud/cloud.cfg.d/*dpkg*��pathz#cleaning cloud-init config from: %sN)�globr	�target_pathrQrR�os�unlink)�flist�dpkg_cfgs  r(�clean_cloud_initr��sA���I�I�d�&�&�,K�L�M�E��I�I�3�U�;���
�	�	�(��r*c��TpVPR4'dV^RpVPR4pV^8�dW^,RpVPRR4pV#)z�mirrorurl_to_apt_fileprefix
Convert a mirror url to the file prefix used by apt on disk to
store cache information for that mirror.
To do so do:
- take off ???://
- drop tailing /
- convert in string / to _�/z://N�_���)rr�find�replace)�mirror�string�poss&  r(�mirrorurl_to_apt_fileprefixr�s[���F�
���s�����"���
�+�+�e�
�C�
�a�x��a��	�"��
�^�^�C��
%�F��Mr*c��\V4p\P!\4pVP	4F�wrEVPV4pV'gK V\PP,\V4,pV\PP,\V4,pWx8XdK�\V4p	\P!RV,4F:p
V:W�R:2p\PRW�4\P!W�4K<	K�	R# \d\P!RRR7Kii;i)z>rename_apt_lists - rename apt lists to preserve old cache dataz%s_*NzRenaming apt list %s to %szFailed to rename apt list:T)�exc_info)r)r	r��	APT_LISTSr�r:r�r��sepr�rxr�rQrR�renamerbry)�new_mirrorsr'�default_mirrors�prer-�omirror�nmirror�oprefix�nprefix�olen�filename�newnames&&          r(r]r]s���)�$�/�O�
�
�
�9�
%�C�(�.�.�0�
���/�/�$�'����������#�&A�'�&J�J��������#�&A�'�&J�J������7�|���	�	�&�7�"2�3�H� '��%��9�G��I�I�2�H�F�
I��	�	�(�,�	4�1���
I����8�4��H�
I�s�D,�,"E�Ec
�X�RRRRRRRRR	R
/pW,pV# \dTpT#i;i)z�there are a few default names which will be auto-extended.
This comes at the inability to use those names literally as suites,
but on the other hand increases readability of the cfg quite a lot�updatesz$RELEASE-updates�	backportsz$RELEASE-backports�securityz$RELEASE-security�proposedz$RELEASE-proposedrgz$RELEASE)�KeyError)�suite�mapping�retsuites&  r(�map_known_suitesr�/sV��
	�%��)��'��'��:��G���>���O�������O��s��
)�)c�0�V^8�dQhR\R\/#)r,�deb822_entryr1�r2)r4s"r(r5r5As��
�
��
��
r*c���\P!RV4'gI\P!RRV4p\P!\RV4pR\	VR4,#V#)z0If no active Suites, disable this deb822 source.z\nSuites:[ \t]+([\w-]+)z\nSuites:.*r�z7## Entry disabled by cloud-init, due to disable_suites
z# disabled by cloud-init: )rV�findallr��DISABLE_SUITES_REDACT_PREFIXr)r�s&r(�%disable_deb822_section_without_suitesr�Asd��
�:�:�0�,�?�?��v�v�n�b�,�?���v�v�,�-��L�
��
G��\�#?�@�
A�	
��r*c�$�V^8�dQhR\/#�r,r1r�)r4s"r(r5r5Qs��,�,�S�,r*c��.pVUu.uF%p\P!\V4RV/4NK'	pp\P	RW4RpVP4EF4pVP
R4'd(V'd
WgR2,
pMVPV4KBV'dVP4'd8V'dVP\V44RpVPV4K�TpVP
R4'gWgR,,
pK�V'd]VP4R,p	V	Uu.uF
pWE9gKVNK	p
pW�8wd'V\VR2,
pRR	PV
42pWhR,,
pEK7	V'dVP\V44RPV4#uupiuupi)
z:reads the deb822 format config and comment disabled suitesrMzDisabling suites %s as %sr�r�r�zSuites:��NNzSuites: � )
r
�
render_stringr�rQrRr�r�rw�isspacer��splitr�r�)�disabled�srcrg�new_srcr��disabled_suite_names�new_deb822_entryr��new_line�orig_suites�
new_suitess&&&        r(�disable_suites_deb822r�Qs����G����E�	��� 0�� 7�)�W�9M�N�����I�I�)�8�J������ ���?�?�3���� �f�B�K�/� ����t�$���t�|�|�~�~�����9�:J�K��$&� ��N�N�4� �������y�)�)��t��+�����*�*�,�r�*�K�)��(�E��4���(�
��
�(� �'C�&D�T�F�"�$M�M� �%�c�h�h�z�&:�%;�<���t�O�+��A!�B����<�=M�N�O��9�9�W����S��<s�+G�G
�
G
c�$�V^8�dQhR\/#r�r�)r4s"r(r5r5�s��%�%�c�%r*c�|�V'gV#Tp\V4'd
\WV4#VEFp\V4p\P!VRV/4p\
P
RWE4RpVPR4F�pVPR4'dWg,
pK$VP4p\V4^8�di^p	V^,PR4'd3VR,F%p
V	^,
p	V
PR4'gK%M	W�,V8Xd
R	V,pWg,
pK�	TpEK	V#)
zNreads the config for suites to be disabled and removes those
from the templaterMzDisabling suite %s as %sr�Tr��[r��]z"# suite disabled by cloud-init: %s)�is_deb822_sources_formatr�r�r
r�rQrRr�r�r�rxrr)r�r�rg�retsrcr��releasesuite�newsrcr��cols�pcol�cols&&&        r(�disable_suitesr��s����
�
�F���$�$�$�X�G�<�<��� ��'�� �.�.�u�y�'�6J�K���	�	�,�e�B����%�%�d�+�D����s�#�#�����
�:�:�<�D��4�y�1�}�����7�%�%�c�*�*�#�B�x�x����	���<�<��,�,�!� (�
�:��-�?�$�F�D��N�F�',�(��5�8�Mr*c�F�V^8�dQhR\\\3,/#r�)rr2)r4s"r(r5r5�s������S��(9�r*c	��/pRF:pVPV.4F!p\WQW$R7pV'gKWcVR2&K#	K<	V#)z=Adds any keys included in the primary/security mirror clauses)�	file_namer���primaryr�)r:�add_apt_key)r.r/rrkr�r��resps&&&    r(r[r[�sL��
�D�&���g�g�c�2�&�F��v�c�A�D��t�%)��u�D�\�"�'�'�
�Kr*c�0�V^8�dQhR\R\/#)r,�apt_src_contentr1)r2�bool)r4s"r(r5r5�s����c��d�r*c���\P!RV\P4'dR#\P!RV\P4'dR#\P	R4R#)a+Simple check for deb822 format for apt source content

Only validates that minimal required keys are present in the file, which
indicates we are likely deb822 format.

Doesn't handle if multiple sections all contain deb822 keys.

Return True if content looks like it is deb822 formatted APT source.
z^(deb |deb-src )Fz'^(Types: |Suites: |Components: |URIs: )Tzapt.sources_list value does not match either deb822 source keys or deb/deb-src list keys. Assuming APT deb/deb-src list format.)rVr��MrQry)r�s&r(r�r��sW��
�z�z�%�����=�=��	�z�z�2�O�R�T�T�����K�K�	H��r*�Dir::Etczetc/apt�Dir::Etc::sourcelist�sources.list�Dir::Etc::sourcepartszsources.list.dz@(Dir::Etc|Dir::Etc::sourceparts|Dir::Etc::sourcelist) \"([^\"]+)c�F�V^8�dQhR\\\3,/#r�)rr2)r4s"r(r5r5�s��0�0�T�#�s�(�^�0r*c
�@�^RIpVP4VPPR\R,4pVPPR\R,4pVPPR\R,4pRRTRT2R	RTRTR2/# \
d�\P!RR.4wrEMW \Pd@\R,p\R,p\R,pRRTRT2R	RTRTR2/uu#i;i\P!\T4p\T4pTPR\R,4pTPR\R,4pTPR\R,4pELi;i)
z�Return a dict of applicable apt configuration or defaults.

Prefer python apt_pkg if present.
Fallback to apt-config dump command if present out output parsed
Fallback to DEFAULT_APT_CFG if apt-config command absent or
output unparsable.
Nr�r�r�z
apt-config�dump�
sourcelistr��sourceparts)�apt_pkg�init_config�configr:�DEFAULT_APT_CFG�ImportErrorr	�ProcessExecutionErrorrVr��
APT_CFG_REr<)r��etcr�r��apt_dumpr��matched_cfg�apt_cmd_configs        r(�get_apt_cfgr	�s���$
�	������n�n� � ��_�Z�-H�I���^�^�'�'�"�O�4J�$K�
�
��n�n�(�(�#�_�5L�%M�
��2	��#��a�
�|�,���3�%�q��
�Q�/����+�
�
	��)�)�\�6�$:�;�K�H�a���)�)�	�!�*�-�C�(�)?�@�J�)�*A�B�K���#��a�
�|�4���3�%�q��
�Q�7��
�	���j�j��X�6���k�*��� � ��_�Z�-H�I��#�'�'�"�O�4J�$K�
�
�%�(�(�#�_�5L�%M�
��%
�s8�B	B�F�*C�F�AD�F�D�BF�Fc��\4pVR,pVR,VPPR2p\P'dTpMTpRVRV/p	V	PV4VF%p
W*,W�&W*,W�P
4&K'	VPRR4pV'g�\PR4\P'dR	MR
pVPRVPPV24p
V
'gVPR4p
V
'g\PR
V4R#\P!V
4p\P!W�4pV'dI\!V4'd W�8Xd\P#RV4TpM\P#RV4Tp\%VPR4W�4p\P&!W�RR7W�8Xd�\(P*P-V4'd�\.PVPP4pV'dQV\P!V48wd4\PRV4\P&!V\04R#R#\PRV4\P2!V4R#R#R#)z�generate_sources_list
create a source.list file based on a custom or default template
by replacing mirrors and release in the templater�r�z.sourcesrMrI�sources_listNz1No custom template provided, fall back to builtinz.deb822r�z
sources.list.r�z#No template found, not rendering %szAProvided 'sources_list' user-data is deb822 format, writing to %szFProvided 'sources_list' user-data is not deb822 format, fallback to %sr�i�)�modez*Replacing %s to favor deb822 source formatz)Removing %s to favor deb822 source format)r	�distror-r�APT_DEB822_SOURCE_LIST_FILE�update�lowerr:rQ�info�get_template_filenameryr�load_text_filer
r�r�rRr��
write_filer�r��exists�DEB822_ALLOWED_APT_SOURCES_LIST�UBUNTU_DEFAULT_APT_SOURCES_LIST�del_file)r.rgrhr/rkr@�apt_sources_list�apt_sources_deb822�aptsrc_filerl�k�tmpl�tmpl_fmt�template_fn�renderedr��expected_contents&&&&&            r(r\r\
sI���m�G��|�,��#�M�2�3�E�L�L�4E�4E�3F�h�O���+�+�+�(��&����*�g�
6�F�
�M�M�$��
���J��	�#�J��w�w�y����7�7�>�4�(�D�����D�E� (� D� D� D�9�"���1�1��E�L�L�-�-�.�x�j�9�
����5�5�n�E�K���K�K�=�{�K���"�"�;�/���&�&�t�4�H��#�H�-�-��.��	�	�%�&��
1����I�I�"� �
�
+�K��c�g�g�&6�7��K�H��O�O�K��6��(�R�W�W�^�^�<L�-M�-M�:�>�>��L�L���
����4�#6�#6�7G�#H�H����@�$�����$�&E��I�
�H�H�;�=M�
�
�M�M�*�+�#.N�(r*c���\PRV4\P!V4Pp\RW$WR7# \Pd\PR4hi;i)zA
actual adding of a key as defined in key argument
to the system
zAdding key:
'%s'r�)�output_filerp�hardenedz(failed to add apt GPG Key to apt keyring)	rQrR�pathlib�Path�stem�apt_keyr	rrc)r�r�rr$r-s&&&& r(�add_apt_key_rawr)Qsg��
�I�I�!�3�'���|�|�I�&�+�+����3�s�
�	
���%�%���
�
�@�A�
��s�-A�,A2c��.p\4p\P!VPRR44'd^RFWpVPV4'gKW,F/pRR0P	V4'gKVPR4K1	KY	VPR/4pVP
4F^pRR0P	V4'dVPR4V!VPRR44'gKMVPR	4K`	VF=p	\P!V	4'dK!VP\V	,4K?	V'd'VPP\V44R
#R
#)a�Install missing package dependencies based on apt_sources config.

Inspect the cloud config user-data provided. When user-data indicates
conditions where add_apt_key or add-apt-repository will be called,
ensure the required command dependencies are present installed.

Perform this inspection upfront because it is very expensive to call
distro.install_packages due to a preliminary 'apt update' called before
package installation.
rKFr��keyidrrL�sourcer�rNr�)r�rrZr:r�r��values�shutilrErw�PACKAGE_DEPENDENCY_BY_COMMANDr
�install_packagesr�)
r.rPr/�missing_packages�
required_cmds�
mirror_key�mirror_item�apt_sources_dict�ent�commands
&&&       r(rYrYas9��#%��#&�5�M��}�}�S�W�W�4�e�<�=�=�1�J��w�w�z�"�"�$'�?�?�K��w�'�4�4�[�A�A�%�)�)�%�0�$3�	2��w�w�y�"�-���&�&�(���7��(�(��-�-����e�$������2�.�/�/����2�3�	)�
!���|�|�G�$�$��#�#�$A�'�$J�K�!��
���%�%�f�-=�&>�?�r*c���RV9d:RV9d3\pRV9d
VR,pVPVR,V4VR&RV9d'\VR,T;'g
VR,W#R7#R#)z�
Add key to the system as defined in ent (if any).
Supports raw keys or keyid's
The latter will as a first step fetched to get the raw key
r+r��	keyserverr��r$N)�DEFAULT_KEYSERVER�
getkeybyidr))r6r/rr$r�r9s&&&&& r(r�r��sq���#�~�%�s�*�%�	��#���K�(�I��^�^�C��L�)�<��E�
���|����J�	�4�4�S��_�c�
�	
�r*c��Vf/pVf\R4h\V\4'g\RV,4hVEF�pW,p\PRV4RV9dWVR&RV9d"RVR,9d\
WaVRR	7pWsR
&M\
WaV4RV9dKjVR,p\P!W�4pVR,PR4'g+\PPRVR,4VR&VR,PR
4'gVR;;,R
,
uu&V!V4'd\P!RRV.4EK/\P"!VR,R7p	RV,p
RpRV9dVR,'gRp\$P&!W�VR7EK�	VP*P-RR7R# \Pd\P!R4hi;i \(dp\P!RY�4hRp?ii;i)a�
install keys and repo source .list files defined in 'sources'

for each 'source' entry in the config:
    1. expand template variables and write source .list file in
            /etc/apt/sources.list.d/
    2. install defined keys
    3. update packages via distro-specific method (i.e. apt-key update)


@param srcdict: a dict containing elements required
@param cloud: cloud instance object

Example srcdict value:
{
'rio-grande-repo': {
    'source': 'deb [signed-by=$KEY_FILE] $MIRROR $RELEASE main',
    'keyid': 'B59D 5F15 97A5 04B7 E230  6DCA 0620 BBCF 0368 3F77',
    'keyserver': 'pgp.mit.edu'
    }
}

Note: Deb822 format is not supported
Nz did not get a valid repo matcherzunknown apt format: %szadding source/key '%s'r�r,z	$KEY_FILETr:�KEY_FILEr�z/etc/apt/sources.list.d/z.listrz--no-updatezadd-apt-repository failed.r�z%s
�arw�w)�omodezfailed write to file %s: %s)�force)r%r;r<�	TypeErrorrQrRr�r
r�r�r�r�r�rrr	rrcr�rrrar
�update_package_sources)
�srcdictr/rrOrPr�r6�key_filer,�sourcefn�contentsrA�details
&&&&&        r(rdrd�s���6�������;�<�<��g�t�$�$��0�G�<�=�=�������	�	�*�C�0��S� �&�
�O��s�?�{�c�(�m�;�"�3�s�T�B�H�*2�J�'���C�(��3����X����(�(��A���:��)�)�#�.�.� �g�g�l�l�*�C�
�O��C�
�O��:��'�'��0�0��
�O�w�&�O��� � �
��	�	�)�=�&�A��
��#�#��Z��9��
	���(�H��E��3��s�8�}�}����O�O�H�e�<�<�U�^
�L�L�'�'�d�'�3�
��)�-�-�
��
�
�:�;��
���	��M�M�7��J���	�s*�G,� H�/H�,,H�I�&H=�=Ic�P�/p\P!RRRR7\V\4'dR\PR4VF4pRV9dRVR&\P!VR4pM	VR,pW!V&K6	V#\V\4'dTpV#\R4h)	z1convert v1 apt format to v2 (dict in apt_sources)zConfig key 'apt_sources'�22.1zUse 'apt' instead)�
deprecated�deprecated_version�
extra_messagez9apt config: convert V1 to V2 format (source list to dict)r�zcloud_config_sources.listzunknown apt_sources format)
r�	deprecater;r3rQrRr�
rand_dict_keyr<r%)�srclistrE�srcentr�s&   r(�convert_v1_to_v2_apt_formatrS�s����G�
���-�!�)��
�'�4� � ��	�	�M�N��F���'�&A��z�"��(�(��2M�N���Z�(��!�C�L���N�
�G�T�	"�	"����N��5�6�6r*c�\�VPVR4eVPV4W&WR#R#)zeconvert an old key to the new one if the old one exists
returns true if a key was found and convertedNTF�r:)�oldcfg�aptcfg�oldkey�newkeys&&&&r(�convert_keyrZ
s0���z�z�&�$��+����F�+����N��r*c�~�.ROpRpRR./pVFwrV\WWV4'gKRpK	V'd	V.VR&R#R#)zBconvert old apt_mirror keys into the new more advanced mirror specF�arches�defaultTr�N))�
apt_mirror�uri)�apt_mirror_searchrX)�apt_mirror_search_dns�
search_dns)rZ)rVrW�keymap�	converted�newmcfgrXrYs&&     r(�convert_mirrorrfsP���F�
�I��)��%�G� ����v��7�7��I�!�
�$�I��y��r*c���RRRRRRRRRRR	R
RRR
RRRRRRR/p.pVF-pW09gKW,R9dWKVPV4K/	V'gV#\P!RV2RR7VPRR4pVez\P!RRR7VFYpW,pW,pWVeVPVR4fK/WdV,8wgK>\	RV:RWE,:RV:24h	V#/pVF"pW,fK\WW1V,4K$	\
W4VF)pVPVR4fK\	RV,4h	WpR&V#)z:convert old to new keys and adapt restructured mirror spec�apt_sourcesrLr^Nr`ra�	apt_proxy�proxy�apt_http_proxy�
http_proxy�
apt_ftp_proxy�https_proxy�apt_https_proxy�	ftp_proxy�apt_preserve_sources_listrK�apt_custom_sources_listrrJzThe following config key(s): rK)rLrMr7z0Support for combined old and new apt module keysz3Old and New apt format defined with unequal values z vs z @ z&old apt key '%s' left after conversion)Nr�)rwrrOr:r%rZrf)rV�
mapoldkeys�
needtoconvertrX�	newaptcfgrY�verifyrWs&       r(�convert_v2_to_v3_apt_formatrw&s���	�y��d��T����W��,����;�#�%<�!�>��2��J��M������~��+��N��$�$�V�,����
�
���2�=�/�B�!���
�
�5�$�'�I������I�%�	
�$�F��'�F��^�F����~����v�t�!<�!D���6�*�*� ��y�0�0�&�:���$��
��F�����)����6�0B�C��
�6�"����:�:�f�d�#�/��E��N�O�O��
�5�M��Mr*c�d�VPRR4pVe\V4VR&\V4pV#)z�convert the old list based format to the new dict based one. After that
convert the old dict keys/format to v3 a.k.a 'new apt config'rhN)r:rSrw)r.rhs& r(r9r9ps:���'�'�-��.�K���8��E��M��&�c�
*�C��Jr*c��RpV'd�Rp.pVR8XdRpMVR8XdRpM\R4h\P!W#4PpRP	VPR4R	,4pV'dVP
R
V,4VPR4.p	VPPp
RV
:RV:R
:RV
:2pVFpV	P
W�,4K	\P!V	4pV#)z?
Try to resolve a list of predefines DNS names to pick mirrors
Nr�r�r�r�zsecurity-mirrorzunknown mirror type�.r�z.%szhttp://�-z%sr�)z.localdomainr�)r%r�get_hostname_fqdn�fqdnr�r�rw�extendr
r-�search_for_mirror)
�
configured�
mirrortyper.r/r��mydom�doms�	mirrordnsr}�mirror_listr
�	mirrorfmt�posts
&&&&         r(�search_for_mirror_dnsr�s����F��������"� �I�
�:�
%�)�I��2�3�3��%�%�c�1�6�6��������C���,�-����K�K���
�&����
�	
������"�"��+1�9�d�F�K�	��D����y�1�2���'�'��4���Mr*c���Ve
VfTpRVRV/#VPP4pV'd+VP4pVR,VR&VR,VR&V#\V4#)zZsets security mirror to primary if not defined.
returns defaults if no mirrors are definedrrr�r�)�
datasource�get_package_mirror_infor"r))�pmirror�smirrorr'r/�mirror_info�ms&&&&  r(�update_mirror_infor��sx�����?��G��7�J��8�8��"�"�:�:�<�K��
�������|��)���*�
��*�
����t�$�$r*c��VPVR4pVfR#RpVF3pVPR4;'g.pW&9dVu#RV9gK1TpK5	V#)zqout of a list of potential mirror configurations select
and return the one matching the architecture (or default)Nr\r]rU)r.r�r'�mirror_cfg_listr]�mirror_cfg_elemr\s&&&    r(�get_arch_mirrorconfigr��se���g�g�j�$�/�O�����G�*�� �$�$�X�.�4�4�"���>�"�"����%�G�+��Nr*c���\WV4pVfR#VPRR4pVf'\P!VPRR44pVf\	VPRR4WV4pV#)z�pass the three potential stages of mirror specification
returns None is neither of them found anything otherwise the first
hit is returnedNr_rXrb)r�r:rrr�)r.r�r'r/�mcfgr�s&&&&  r(�
get_mirrorr��sv��!��$�7�D��|���X�X�e�T�
"�F��~��'�'�����4�(@�A���~�&��H�H�\�4�(�*�5�
���Mr*c� �Vf,\P!4p\PRV4\	VRW!4p\PRV4\	VRW!4p\PRV4\W4W!4pVR,VR&V#)afind_apt_mirror_info
find an apt_mirror given the cfg provided.
It can check for separate config of primary and security mirrors
If only primary is given security is assumed to be equal to primary
If the generic apt_mirror is given that is defining for both
z!got arch for mirror selection: %sr�zgot primary mirror: %sr�zgot security mirror: %srrN)rrrQrRr�r�)r.r/r'r�r�r�s&&&   r(rTrT�s����|��)�)�+���	�	�5�t�<���i��5�G��I�I�&��0���j�$�6�G��I�I�'��1�$�W�t�C�K�(�	�2�K����r*c�8�RpVUUu.uF5wrEVPV4'gKWPPV4,NK7	ppp\V4'dE\PRV4\P
!VRP
V4R,4MQ\PPV4'd-\P!V4\PRV4VPRR4'd>\PRV4\P
!W PR44R#\PPV4'd/\P!V4\PRV4R#R#uuppi)	z@apply_apt_config
Applies any apt*proxy config from if specified
zwrite apt proxy info to %sr�z#no apt proxy configured, removed %s�confNzwrite apt config info to %sz$no apt config configured, removed %s))rj�Acquire::http::Proxy "%s";)rlr�)rpzAcquire::ftp::Proxy "%s";)rnzAcquire::https::Proxy "%s";)r:rxrQrRrrr�r�r��isfiler)r.�proxy_fname�config_fname�cfgsr-�fmt�proxiess&&&    r(r^r^s��
�D�7;�L�d�{��c�g�g�d�m�"�s�W�W�T�]�"�"�d�G�L�
�7�|�|��	�	�.��<�����T�Y�Y�w�%7�$�%>�?�	������	$�	$��
�
�k�"��	�	�7��E�
�w�w�v�t����	�	�/��>�����g�g�f�o�6�	������	%�	%��
�
�l�#��	�	�8�,�G�
&��Ms
�F�Fc�aaaaa�RoVVV3RlpVV3RlpVR8Xd	V!V4#VR8XgVR8Xd	V!V4#\R4h)aHapt-key replacement

commands implemented: 'add', 'list', 'finger'

@param output_file: name of output gpg file (without .gpg or .asc)
@param data: key contents
@param human_output: list keys formatted for human parsing
@param hardened: write keys to to /etc/apt/cloud-init.gpg.d/ (referred to
with [signed-by] in sources file)
c�*�\PP\4'd\.M.p\P!\
4F8pVP
R4'gKVP\
V,4K:	V'dV#R#)z�return all apt keys

/etc/apt/trusted.gpg (if it exists) and all keyfiles (and symlinks to
keyfiles) in /etc/apt/trusted.gpg.d/ are returned

based on apt-key implementation
r�)z.gpgz.asc)r�r�r��APT_LOCAL_KEYS�listdir�APT_TRUSTED_GPG_DIRrrrw)�	key_files�files  r(�_get_key_files�apt_key.<locals>._get_key_files4sg��)+�����~�(F�(F�^�$�B�	��J�J�2�3�D��}�}�-�.�.�� � �!4�t�!;�<�4�&�y�-�2�-r*c�
<�RpS'g-\P!\RPS44V#S'd\M\
pVP
S4pRPVS4p\P!W4V# \Pd/\P!\RPS44T#\d/\P!\RPS44T#i;i)zYapt-key add <file>

returns filepath to new keyring, or '/dev/null' when an error occurs
z	/dev/nullz)Unknown filename, failed to add key: "{}"z{}{}.gpgz Gpg error, failed to add key: {}z#Decode error, failed to add key: {})r�logexcrQr4�CLOUD_INIT_GPG_DIRr��dearmorrr	r�UnicodeDecodeError)rAr��key_dir�stdoutrpr$r#s&   ���r(�apt_key_add�apt_key.<locals>.apt_key_addCs����
 �	���K�K��@�G�G��M�
�&��
�*2�&�8K��%�,�,�T�2��&�-�-�g�{�C�	����	�2�����-�-�
�����;�B�B�4�H����	&�
�����>�E�E�d�K����	
�s$�B�AB�?D�
D�+D�Dc�<�.pS!4F&pVPVPVSR74K(	RP
V4# \Pd"p\PRY#4Rp?KlRp?ii;i)zgapt-key list

returns string of all trusted keys (in /etc/apt/trusted.gpg and
/etc/apt/trusted.gpg.d/)
)�human_outputzFailed to list key "%s": %sNr�)rw�	list_keysr	rrQryr�)rA�key_listrF�errorr�r�s&   ��r(�apt_key_list�apt_key.<locals>.apt_key_list_sy�����&�(�H�
L�����)�)�(��)�N��)��y�y��"�"���-�-�
L����9�8�K�K��
L�s�"A�A<�A7�7A<r��fingerr3z@apt_key() commands add, list, and finger are currently supported)r%)	r7rr#rpr$r�r�r�r�s	&&ffff  @r(r(r(!sQ���&
.��8#� �%���3���	�H�	��6� 1��C� � ��N�
�	
r*z
cloud-initc��V^8�dQh/^\9d\\\3,;R&^\9d
\;R&#)r,r/�meta)�__conditional_annotations__rr2r)r4s"r(r5r5	s?��0�0�8��w�s�C�x�0��91�B��j��C1r*)r�debianzraspberry-pi-os)�s390x�arm64�armhf�powerpc�ppc64el�riscv64)N)F)FN)NN)NNFT)Yr��__doc__r��loggingr�r%rVr.�textwrapr�typingrrrr�	cloudinitrrr	r
r�cloudinit.cloudr�cloudinit.configr
�cloudinit.config.schemar�
cloudinit.gpgr�cloudinit.settingsr�	getLogger�__name__rQrUr�r�r�r�r/r�r�r`r_r;r!r$r r#rrr)rBrGr?rtr~r>r�r�r]r�r�r�r�r[r�rrr	r\r)rYr�rdrSrZrfrwr9r�r�r�r�rTr^r(rvr5)r�s@r(�<module>r�s���1���	��	�
��0�0�@�@�!�#�.��+�
����!��#��'��/��1��G���6�	�7�4���	�
�
�6����r�	���
!�	�:�
�:��+���2��4���
�5��6��
��6�"��K��#��$,�-L�"M��C�/�&%�+
�\�
�@ $�F��$I�2�$
� ,�^%�P��4�	��N��-���H��
0�fD,�N
� @�D
�&U�p�8�&�$G�T�&�R%�0�&�4�0H�8U
�r�"��r*

Youez - 2016 - github.com/yon3zu
LinuXploit