+
    ˜qgj/Z  ã                   ó„  € ^ RI t ^ RIt^ RIt^ RIHt ^ RIHtHtHt ^ RI	H
t
HtHt ] P                  ! ]4      tRtR$t^ŽtR]! ]4      ,           R,           t ! R R	4      t ! R
 R4      tR tR tR tR tR tR t]3R ltR%R lt ! R R4      tR R lt R R lt!R t"R R lt#R t$]3R lt%R t&]3R  R! llt'R" t(R# t)R# )&é    N)Úsuppress)ÚListÚSequenceÚTuple)Ú	lifecycleÚsubpÚutilz/etc/ssh/sshd_configz§no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user \"$USER\" rather than the user \"$DISABLE_USER\".';echo;sleep 10;exit Ú"c                   ó6   a € ] tR t^Dt o RR ltR tR tRtV tR# )ÚAuthKeyLineNc                óB   € W0n         W@n        WPn        W n        Wn        R # ©N)Úbase64ÚcommentÚoptionsÚkeytypeÚsource)Úselfr   r   r   r   r   s   &&&&&&Ú4/usr/lib/python3/dist-packages/cloudinit/ssh_util.pyÚ__init__ÚAuthKeyLine.__init__E   s   € ð ŒØŒØŒØŒØŽó    c                óB   € V P                   ;'       d    V P                  # r   )r   r   ©r   s   &r   ÚvalidÚAuthKeyLine.validN   s   € Ø�{‰{×+Ð+˜tŸ|™|Ð+r   c                ó¸  € . pV P                   '       d   VP                  V P                   4       V P                  '       d   VP                  V P                  4       V P                  '       d   VP                  V P                  4       V P                  '       d   VP                  V P                  4       V'       g   V P
                  # R P                  V4      # )Ú )r   Úappendr   r   r   r   Újoin)r   Útokss   & r   Ú__str__ÚAuthKeyLine.__str__Q   s†   € ØˆØ�<�<ˆ<Ø�K‰K˜Ÿ™Ô%Ø�<�<ˆ<Ø�K‰K˜Ÿ™Ô%Ø�;�;ˆ;Ø�K‰K˜Ÿ™Ô$Ø�<�<ˆ<Ø�K‰K˜Ÿ™Ô%ßØ—;‘;Ðà—8‘8˜D“>Ð!r   )r   r   r   r   r   )NNNN)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   r   r"   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r   r   D   s   ø‡ € ôò,÷"ð "r   r   c                   ó4   a € ] tR t^at o RtR tRR ltRtV tR# )ÚAuthKeyLineParsera9  
AUTHORIZED_KEYS FILE FORMAT
 AuthorizedKeysFile specifies the file containing public keys for public
 key authentication; if none is specified, the default is
 ~/.ssh/authorized_keys.  Each line of the file contains one key (empty
 (because of the size of the public key encoding) up to a limit of 8 kilo-
 bytes, which permits DSA keys up to 8 kilobits and RSA keys up to 16
 kilobits.  You don't want to type them in; instead, copy the
 identity.pub or the id_rsa.pub file and edit it.

 sshd enforces a minimum RSA key modulus size for protocol 1 and protocol
 2 keys of 768 bits.

 The options (if present) consist of comma-separated option specifica-
 tions.  No spaces are permitted, except within double quotes.  The fol-
 lowing option specifications are supported (note that option keywords are
 case-insensitive):
c                óZ  € Rp^ pV\        V4      8  d   V'       g   W,          R9  dj   W,          pV^,           \        V4      8¼  d   V^,           pM@W^,           ,          pVR8X  d   VR8X  d   V^,           pMVR8X  d   V'       * pV^,           pKŽ  V^ V pWR P                  4       pWg3# )z·
The options (if present) consist of comma-separated option specifica-
 tions.  No spaces are permitted, except within double quotes.
 Note that option keywords are case-insensitive.
FÚ\r
   N)r   Ú	)ÚlenÚlstrip)r   ÚentÚquotedÚiÚcurcÚnextcr   Úremains   &&      r   Ú_extract_optionsÚ"AuthKeyLineParser._extract_optionsu   s¥   € ð ˆØˆØ”#�c“(Œl§¨S­V¸;Ô-FØ•6ˆDØ�1�uœ˜C›Ô Ø˜•E�ØØ˜A�•JˆEØ�tŒ| ¨¤Ø˜•E‘Ø˜”Ø#œ�Ø�A•ŠAà�a˜�(ˆð �R�—‘Ó!ˆØÐ Ð r   Nc                ó   € VP                  R 4      pVP                  R4      '       g   VP                  4       R8X  d   \        V4      # R pVP                  4       p V! V4      w  rgp\        TTTTTR7      #   \         dK    T P                  T4      w  ršT'       g   T	p T! T
4      w  rgp LF  \         d    \        T4      u u # i ; ii ; i)z
Ú#Ú c                 ó  € V P                  R ^4      p\        V4      ^8  d   \        R\        V4      ,          4      hV^ ,          \        9  d   \        RV^ ,          ,          4      h\        V4      ^8X  d   VP	                  R4       V# )NzToo few fields: %szInvalid keytype %sr=   )Úsplitr1   Ú	TypeErrorÚVALID_KEY_TYPESr   )r3   r!   s   & r   Úparse_ssh_keyÚ.AuthKeyLineParser.parse.<locals>.parse_ssh_key•   sp   € à—9‘9˜T 1Ó%ˆDÜ�4‹y˜1Œ}ÜÐ 4´s¸4³yÕ @ÓAÐAØ�A�wœoÔ-ÜÐ 4°t¸AµwÕ >Ó?Ð?ô �4‹y˜AŒ~à—‘˜B”àˆKr   )r   r   r   r   )ÚrstripÚ
startswithÚstripr   r@   r9   )r   Úsrc_liner   ÚlinerB   r3   r   r   r   Úkeyoptsr8   s   &&&        r   ÚparseÚAuthKeyLineParser.parse�   s×   € à�‰˜vÓ&ˆØ�?‰?˜3×Ò 4§:¡:£<°2Ô#5Ü˜xÓ(Ð(ò	ð �j‰j‹lˆð	-Ù)6°sÓ);Ñ&ˆW˜gô ØØØØØô
ð 	
øô ô 
	-Ø $× 5Ñ 5°cÓ :ÑˆW÷ Ø!�ð-Ù-:¸6Ó-BÑ*�¢'øÜô -Ü" 8Ó,Ô,ð-úð
	-ús*   ÁA8 Á8(CÂ!B.Â.C	ÃCÃC	Ã	C© r   )	r$   r%   r&   r'   Ú__doc__r9   rJ   r(   r)   r*   s   @r   r-   r-   a   s   ø‡ € ñò&!÷4*
ò *
r   r-   c                 ó†  € . p\        4       p. pV  Fx  p \        P                  P                  V4      '       dP   \        P
                  ! V4      P                  4       pV F#  pVP                  VP                  V4      4       K%  	  Kx  Kz  	  V#   \        \        3 d!    \        P                  ! \        R T4        K®  i ; i)zError reading lines from %s)r-   ÚosÚpathÚisfiler	   Úload_text_fileÚ
splitlinesr   rJ   ÚIOErrorÚOSErrorÚlogexcÚLOG)ÚfnamesÚlinesÚparserÚcontentsÚfnamerH   s   &     r   Úparse_authorized_keysr]   ¼   s¤   € Ø€EÜÓ €FØ€HÛˆð	CÜ�w‰w�~‰~˜e×$Ò$Ü×+Ò+¨EÓ2×=Ñ=Ó?�Û!�DØ—O‘O F§L¡L°Ó$6Ö7ó "ñ %ñ ð €Oøô œÐ!ô 	CÜ�KŠKœÐ:¸E×Bð	Cús   •A2BÂ-C Â?C c                 ó&  € \        V Uu. uF  q"P                  4       '       g   K  VNK  	  up4      p\        \        V 4      4       Fh  pW,          pVP                  4       '       g   K#  V F;  pVP                  VP                  8X  g   K   TpW#9   g   K*  VP                  V4       K=  	  WPV&   Kj  	  V F  pV P                  V4       K  	  V  Uu. uF  p\        V4      NK  	  ppVP                  R 4       RP                  V4      # u upi u upi )r=   Ú
)	Úlistr   Úranger1   r   Úremover   Ústrr    )	Úold_entriesÚkeysÚkÚto_addr5   r3   ÚkeyÚbrY   s	   &&       r   Úupdate_authorized_keysrj   Ì   sà   € Ü™dÓ0™d˜§g¡g§i—1�1™dÑ0Ó1€FÜ”3�{Ó#Ö$ˆØ�nˆØ�y‰y�{Š{ÙãˆAØ�x‰x˜3Ÿ:™:Ö%à�à–;Ø—M‘M !Ö$ñ ð �A‹ñ %ó ˆØ×Ñ˜3Öñ ñ )Ó)™[˜ŒS�ŽV™[€EÐ)ð 
‡L�L�ÔØ�9‰9�UÓÐùò1 1ùò( *s   ŠD	¦D	ÃDc                 óÞ   € \         P                  ! V 4      pV'       d   VP                  '       g   \        R V ,          4      h\        P
                  P                  VP                  R4      V3# )z"Unable to get SSH info for user %rz.ssh)ÚpwdÚgetpwnamÚpw_dirÚRuntimeErrorrO   rP   r    )ÚusernameÚpw_ents   & r   Úusers_ssh_inforr   è   sJ   € Ü�\Š\˜(Ó#€Fß˜ŸŸ˜ÜÐ?À8ÕLÓMÐMÜ�G‰G�L‰L˜Ÿ™¨Ó/°Ð8Ð8r   c                 ó(  € R V3RV3R3pV '       g   Rp V P                  4       p. pV Ff  pV F  w  rxVP                  Wx4      pK  	  VP                  R4      '       g    \        P                  P                  W4      pVP                  V4       Kh  	  V# )ú%hú%uú%h/.ssh/authorized_keysÚ/)z%%Ú%)r?   ÚreplacerE   rO   rP   r    r   )	ÚvalueÚhomedirrp   ÚmacrosÚpathsÚrenderedrP   ÚmacroÚfields	   &&&      r   Úrender_authorizedkeysfile_pathsr�   ï   s‰   € ð �Wˆo  hÐ/°Ð=€FßØ)ˆØ�K‰K‹M€EØ€HÛˆÛ"‰LˆEØ—<‘< Ó-ŠDñ #à�‰˜s×#Ò#Ü—7‘7—<‘< Ó.ˆDØ�‰˜Öñ ð €Or   c                ó.  € RpV'       d   Rp\         P                  ! V4      pV'       d)   W`8w  d#   VR8w  d   \        P                  RVVV V4       R# \         P                  ! V4      pW`8X  d   VR,          pME\         P
                  ! V4      p\         P                  ! V 4      p	W‰9   d   V^8,          pM	V^,          pWu,          ^ 8X  d   \        P                  RVVV 4       R# V'       d)   V^,          '       d   \        P                  RVV4       R# R	# )
a>  Check if the file/folder in @current_path has the right permissions.

We need to check that:
1. If StrictMode is enabled, the owner is either root or the user
2. the user can access the file/folder, otherwise ssh won't use it
3. If StrictMode is enabled, no write permission is given to group
   and world users (022)
iÉ  i¤  ÚrootzXPath %s in %s must be own by user %s or by root, but instead is own by %s. Ignoring key.FéÀ  zBPath %s in %s must be accessible by user %s, check its permissionszRPath %s in %s must not give writepermission to group or world users. Ignoring key.T)r	   Ú	get_ownerrW   ÚdebugÚget_permissionsÚ	get_groupÚget_user_groups)
rp   Úcurrent_pathÚ	full_pathÚis_fileÚstrictmodesÚminimal_permissionsÚownerÚparent_permissionÚgroup_ownerÚuser_groupss
   &&&&&     r   Úcheck_permissionsr“     s  € ð  Ðßà#Ðô �NŠN˜<Ó(€Eß�uÔ(¨U°f¬_Ü�	‰	ð@àØØØô	
ñ ä×,Ò,¨\Ó:ÐàÔà˜uÕ$Ñä—n’n \Ó2ˆÜ×*Ò*¨8Ó4ˆàÔ%à 5Õ(Ñð   5Õ(ÐàÕ.°!Ô3Ü�	‰	ð%àØØô	
ñ ÷ Ð)¨E×1Ô1Ü�	‰	ð@àØô		
ñ ár   c           	      ó˜  € \        V 4      ^,          p\        R4      ^,          p VP                  R4      ^R pRp\        P                  P	                  VP
                  4      pV EF¢  pVRV,           ,          p\        P                  P                  V4      '       d   \        P                  RV4        R# \        P                  P                  V4      '       d   \        P                  RV4        R# VP                  V4      '       g   WcP
                  8X  d   K¹  \        P                  P                  V4      '       g¬   \        P                  ! V4      ;_uu_ 4        Rp	VP                  p
VP                  pVP                  VP
                  4      '       d   Rp	VP                  p
VP                  p\        P                   ! WiR	R
7       \        P"                  ! WjV4       RRR4       \%        WVRV4      pV'       d   EK¢   R# 	  \        P                  P                  V4      '       g&   \        P                  P'                  V4      '       d   \        P                  RV4       R# \        P                  P                  V4      '       gF   \        P(                  ! VRRR	R7       \        P"                  ! WP                  VP                  4       \%        WVR	V4      pV'       g   R#  R	#   + '       g   i     EL; i  \*        \,        3 d0   p\        P.                  ! \        \1        T4      4        Rp?R# Rp?ii ; i)é   rƒ   rw   r=   z-Invalid directory. Symlink exists in path: %sFz*Invalid directory. File exists in path: %séí  r„   T)ÚmodeÚexist_okNz%s is not a file!é€  )r—   Úensure_dir_existséÿÿÿÿ)rr   r?   rO   rP   Údirnamern   ÚislinkrW   r†   rQ   rE   Úexistsr	   ÚSeLinuxGuardÚpw_uidÚpw_gidÚmakedirsÚ	chownbyidr“   ÚisdirÚ
write_filerT   rU   rV   rc   )rp   Úfilenamer�   Ú
user_pwentÚ
root_pwentÚdirectoriesÚparent_folderÚhome_folderÚ	directoryr—   ÚuidÚgidÚpermissionsÚes   &&&           r   Úcheck_create_pathr±   I  sz  € Ü Ó)¨!Õ,€JÜ Ó'¨Õ*€JðGà—n‘n SÓ)¨!¨BÐ/ˆð ˆô —g‘g—o‘o j×&7Ñ&7Ó8ˆÜ$ˆIØ˜S 9�_Õ,ˆMô �w‰w�~‰~˜m×,Ò,Ü—	‘	ØCØ!ôò ä�w‰w�~‰~˜m×,Ò,Ü—	‘	Ø@À-ôò ð ×&Ñ& }×5Ò5Ø ×$5Ñ$5Ô5áä—7‘7—>‘> -×0Ò0ô ×&Ò& }×5Õ5Ø �DØ$×+Ñ+�CØ$×+Ñ+�CØ$×/Ñ/°
×0AÑ0A×BÒBØ$˜Ø(×/Ñ/˜Ø(×/Ñ/˜Ü—K’K À4ÕHÜ—N’N =°sÔ;÷ 6ô ,Ø¨°5¸+óˆK÷ ’;ÚñU %ôX �7‰7�>‰>˜(×#Ò#¤r§w¡w§}¡}°X×'>Ò'>Ü�I‰IÐ)¨8Ô4Ùô �w‰w�~‰~˜h×'Ò'ô �OŠO˜H b¨uÈÕMÜ�NŠN˜8×%6Ñ%6¸
×8IÑ8IÔJä'Ø ¨$°ó
ˆ÷ Ùð ñ ÷K 6×5Ð5ûôB ”WÐô Ü�Š”Cœ˜Q›Ô Ýûðúst   ¦BL	 Â9$L	 ÃL	 Ã7L	 Ä6L	 ÅL	 Å#BK5Ç(L	 È	L	 È&L	 È3$L	 ÉL	 É0$L	 ÊAL	 Ë5LÌ 	L	 Ì	M	Ì$MÍM	c           
      óF  € \        V 4      w  r#\        P                  P                  VR 4      pTp. p\        P
                  ! VRR7      ;_uu_ 4         \        V4      pVP                  RR4      pVP                  RR4      p	\        WƒP                  V 4      pRRR4       \        XP!                  4       V4       Fd  w  r«\#        R	V
9   R
V
9   VP%                  RP'                  VP                  4      4      .4      '       g   KI  \)        WX	R8H  4      pV'       g   Kb  Tp M	  WT8w  d   \        P+                  RV4       V\-        V.4      3#   \        \        3 d0    YF^ &   \        P                  ! \        R\        T^ ,          4        Lói ; i  + '       g   i     Lÿ; i)Úauthorized_keysT©Ú	recursiveÚauthorizedkeysfilerv   r�   ÚyeszhFailed extracting 'AuthorizedKeysFile' in SSH config from %r, using 'AuthorizedKeysFile' file %r insteadNru   rt   z{}/zAAuthorizedKeysFile has an user-specific authorized_keys, using %s)rr   rO   rP   r    r	   rŸ   Úparse_ssh_config_mapÚgetr�   rn   rT   rU   rV   rW   ÚDEF_SSHD_CFGÚzipr?   ÚanyrE   Úformatr±   r†   r]   )rp   Ússhd_cfg_fileÚssh_dirrq   Údefault_authorizedkeys_fileÚuser_authorizedkeys_fileÚauth_key_fnsÚssh_cfgÚ	key_pathsr�   Úkey_pathÚauth_key_fnÚpermissions_oks   &&           r   Úextract_authorized_keysrÈ   ˜  s�  € Ü& xÓ0Ñ€WÜ"$§'¡'§,¡,¨wÐ8IÓ"JÐØ:ÐØ€LÜ	×	Ò	˜7¨d×	3Ö	3ð	Ü*¨=Ó9ˆGØŸ™Ø$Ð&?óˆIð "Ÿ+™+ m°UÓ;ˆKÜ:ØŸ=™=¨(óˆL÷ 
4ô0 "% Y§_¡_Ó%6¸Ö!EÑˆÜà˜Ñ Ø˜Ñ Ø×&Ñ& u§|¡|°F·M±MÓ'BÓCð÷
ô 
ô /Ø {°eÑ';óˆN÷ ‰~Ø+6Ð(Ùñ "Fð  Ô>Ü�	‰	ðà$ô	
ð 	!ÜÐ7Ð8Ó9ðð øôG œÐ!ô 
	à9˜‰OÜ�KŠKÜðô Ø˜Q•öð
	ú÷ 
4×	3ús+   ÁFÁAEÅ=FÆ
FÆFÆFÆF 	c                 óž  € \        4       p. pV  F.  pVP                  VP                  \        V4      VR 7      4       K0  	  \	        V4      w  rg\
        P                  P                  V4      p\        P                  ! VRR7      ;_uu_ 4        \        Wt4      p	\        P                  ! WiRR7       RRR4       R#   + '       g   i     R# ; i))r   Tr´   ©Úpreserve_modeN)r-   r   rJ   rc   rÈ   rO   rP   rœ   r	   rŸ   rj   r¥   )
re   rp   r   rZ   Úkey_entriesrf   rÆ   Úauth_key_entriesr¿   Úcontents
   &&&       r   Úsetup_user_keysrÏ   Ñ  s”   € äÓ €FØ€KÛˆØ×Ñ˜6Ÿ<™<¬¨A«¸˜<Ó@ÖAñ ô '>¸hÓ&GÑ#€[Ü�g‰g�o‰o˜kÓ*€GÜ	×	Ò	˜7¨d×	3Ö	3Ü(Ð)9ÓGˆÜ�Š˜¸DÕA÷ 
4×	3×	3Ò	3ús   Â$B;Â;C	c                   ó@   a € ] tR tRt o RR lt]R 4       tR tRtV t	R# )ÚSshdConfigLineià  Nc                ó*   € Wn         W n        W0n        R # r   )rH   Ú_keyrz   )r   rH   rf   Úvs   &&&&r   r   ÚSshdConfigLine.__init__á  s   € ØŒ	ØŒ	ØŽ
r   c                óV   € V P                   f   R # V P                   P                  4       # r   )rÓ   Úlowerr   s   &r   rh   ÚSshdConfigLine.keyæ  s    € à�9‰9ÒÙà�y‰y�‰Ó Ð r   c                óà   € V P                   f   \        V P                  4      # \        V P                   4      pV P                  '       d$   VR\        V P                  4      ,           ,          pV# )Nr   )rÓ   rc   rH   rz   )r   rÔ   s   & r   r"   ÚSshdConfigLine.__str__í  sL   € Ø�9‰9ÒÜ�t—y‘y“>Ð!ä�D—I‘I“ˆAØ�z�zˆzØ�Sœ3˜tŸz™z›?Õ*Õ*�ØˆHr   )rÓ   rH   rz   )NN)
r$   r%   r&   r'   r   Úpropertyrh   r"   r(   r)   r*   s   @r   rÑ   rÑ   à  s(   ø‡ € ôð
 ñ!ó ð!÷ð r   rÑ   c                ó:   € V ^8„  d   QhR\         \        ,          /# ©é   Úreturn©r   rÑ   )r½   s   "r   Ú__annotate__rá   ÷  s   € ÷ Kñ Kœt¤NÕ3ñ Kr   c                 óª   € \         P                  P                  V 4      '       g   . # \        \        P
                  ! V 4      P                  4       4      # r   )rO   rP   rQ   Úparse_ssh_config_linesr	   rR   rS   ©r\   s   &r   Úparse_ssh_configrå   ÷  s9   € Ü�7‰7�>‰>˜%× Ò Øˆ	Ü!¤$×"5Ò"5°eÓ"<×"GÑ"GÓ"IÓJÐJr   c                ó:   € V ^8„  d   QhR\         \        ,          /# rÝ   rà   )r½   s   "r   rá   rá   ý  s   € ÷ ñ ¤T¬.Õ%9ñ r   c                 ó°  € . pV  F~  pVP                  4       pV'       d   VP                  R 4      '       d   VP                  \        V4      4       KN   VP	                  R^4      w  r4TP                  \        Y#T4      4       K€  	  V#   \
         dB     TP	                  R^4      w  r4 LC  \
         d    \        P                  RT4         KË  i ; ii ; i)r<   NÚ=z;sshd_config: option "%s" has no key/value pair, skipping it)rF   rE   r   rÑ   r?   Ú
ValueErrorrW   r†   )rY   ÚretrH   rh   Úvals   &    r   rã   rã   ý  sÈ   € ð
 !#€CÛˆØ�z‰z‹|ˆß�t—‘ s×+Ò+Ø�J‰J”~ dÓ+Ô,Ùð	Ø—z‘z $¨Ó*‰HˆCð 	�
‰
”> $¨SÓ1Ö2ñ# ð$ €Jøô ô 		ðØŸ:™: c¨1Ó-‘�‘SøÜô Ü—	‘	ð#àôó
 ðúð		ús*   ÁB	Â	CÂB+Â+!CÃCÃCÃCc                 óž   € \        V 4      pV'       g   / # / pV F/  pVP                  '       g   K  VP                  W#P                  &   K1  	  V# r   )rå   rh   rz   )r\   rY   rê   rH   s   &   r   r¸   r¸     sE   € Ü˜UÓ#€EßØˆ	Ø
€CÛˆØ�x�xˆxÙØŸ
™
ˆ�H‰H‹ñ ð €Jr   c                ó0   € V ^8„  d   QhR\         R\        /# )rÞ   r\   rß   )rc   Úbool)r½   s   "r   rá   rá   $  s   € ÷ 
ñ 
œ3ð 
¤4ñ 
r   c                 ó„  € \         P                  P                  V 4      '       g+   \         P                  P                  V  R 24      '       d   R# \         P                  P                  V 4      '       g   R# \        P
                  ! V 4      P                  4        F!  pVP                  RV  R24      '       g   K    R# 	  R# )ú.dTFzInclude z	.d/*.conf)rO   rP   rž   rQ   r	   rR   rS   rE   )r\   rH   s   & r   Ú_includes_dconfrñ   $  s†   € ô �7‰7�>‰>˜%× Ò ¤R§W¡W§^¡^°u°g¸R°L×%AÒ%AÙÜ�7‰7�>‰>˜%× Ò ÙÜ×#Ò# EÓ*×5Ñ5Ö7ˆØ�?‰?˜X e W¨IÐ6×7Ô7Úñ 8ñ r   c                 ól  € \        V 4      '       d£   \        P                  P                  V  R 24      '       g   \        P
                  ! V  R 2RR7       \        P                  P                  V  R 2R4      p \        P                  P                  V 4      '       g   \        P                  ! V R4       V # )rð   r–   )r—   z50-cloud-init.confr™   )	rñ   rO   rP   r¤   r	   Ú
ensure_dirr    rQ   Úensure_filerä   s   &r   Ú"_ensure_cloud_init_ssh_config_filerõ   1  s}   € Ü�u×ÒÜ�w‰w�}‰} ˜w b˜\×*Ò*Ü�OŠO˜u˜g R˜L¨uÕ5Ü—‘—‘ ˜w b˜\Ð+?Ó@ˆÜ�w‰w�~‰~˜e×$Ò$ä×Ò˜U EÔ*Ø€Lr   c                ó  € \        V4      p\        V4      p\        W R7      pV'       dI   \        P                  ! TRP                  V Uu. uF  p\        V4      NK  	  up4      R,           RR7       \        V4      ^ 8g  # u upi )z¡Read fname, and update if changes are necessary.

@param updates: dictionary of desired values {Option: value}
@return: boolean indicating if an update was done.)rY   Úupdatesr_   TrÊ   )rõ   rå   Úupdate_ssh_config_linesr	   r¥   r    rc   r1   )r÷   r\   rY   ÚchangedrH   s   &&   r   Úupdate_ssh_configrú   <  sq   € ô
 /¨uÓ5€EÜ˜UÓ#€EÜ%¨EÔC€GßÜ�ŠØØ�I‰I©UÓ3©U T”s˜4–y©UÑ3Ó4°tÕ;Øõ	
ô
 ˆw‹<˜1ÑÐùò 4s   ÁBc                ó<  € \        4       p. p\        VP                  4        Uu. uF  qDP                  4       V3NK  	  up4      p\	        V ^R7       F»  w  rgVP
                  '       g   K  VP
                  V9   g   K,  WWP
                  ,          pW,          p	VP                  V4       VP                  V	8X  d   \        P                  RWhV	4       K�  VP                  V4       \        P                  RVVVP                  V	4       W—n        K½  	  \        V4      \        V4      8w  dn   VP                  4        FY  w  r‰W‚9   d   K  VP                  V4       V P                  \        RW‰4      4       \        P                  R\        V 4      W‰4       K[  	  V# u upi )zäUpdate the SSH config lines per updates.

@param lines: array of SshdConfigLine.  This array is updated in place.
@param updates: dictionary of desired values {Option: value}
@return: A list of keys in updates that were changed.)Ústartz$line %d: option %s already set to %sz#line %d: option %s updated %s -> %sr=   z line %d: option %s added with %s)ÚsetÚdictre   r×   Ú	enumeraterh   Úaddrz   rW   r†   r   r1   ÚitemsrÑ   )
rY   r÷   Úfoundrù   rf   Úcasemapr5   rH   rh   rz   s
   &&        r   rø   rø   M  sD  € ô ‹E€EØ€Gô ¨G¯L©L¬NÓ;©N q—W‘W“Y “N©NÑ;Ó<€Gä˜U¨!×,‰ˆØ�x�xˆxÙØ�8‰8�wÖØŸ(™(Õ#ˆCØ•LˆEØ�I‰I�cŒNØ�z‰z˜UÔ"Ü—	‘	Ø:¸AÀEöð —‘˜sÔ#Ü—	‘	Ø9ØØØ—J‘JØôð #–
ñ) -ô, ˆ5ƒz”S˜“\Ô!Ø!Ÿ-™-ž/‰JˆCØŒ|ÙØ�N‰N˜3ÔØ�L‰Lœ¨¨CÓ7Ô8Ü�I‰IØ2´C¸³JÀöñ *ð €NùòC <s   ¤Fc                ó\   € V ^8„  d   QhR\         \        \        \        3,          ,          /# )rÞ   rY   )r   r   rc   )r½   s   "r   rá   rá   {  s    € ÷ 
ñ 
œX¤e¬C´¨H¥oÕ6ñ 
r   c                 ó¢   € V '       g   R # \        V4      pR V  4       p\        P                  ! VRP                  V4      R,           RRR7       R # )Nc              3   ó4   "  € T F  w  rV R V 2x € K  	  R# 5i)r   NrL   )Ú.0rf   rÔ   s   &  r   Ú	<genexpr>Ú$append_ssh_config.<locals>.<genexpr>  s   é € Ð,¡e™d˜a�!��A�a�S�z£eùs   ‚r_   ÚabT)ÚomoderË   )rõ   r	   r¥   r    )rY   r\   rÎ   s   && r   Úappend_ssh_configr  {  sB   € ßÙÜ.¨uÓ5€EÙ,¡eÓ,€GÜ‡O‚OØØ�	‰	�'Ó˜TÕ!ØØ÷	r   c                 ó`  € Rp \        \        P                  4      ;_uu_ 4        \        P                  ! RR.^ ^.R7      w  rRRR4       RpV P                  R4       F9  pVP	                  V4      '       g   K  V\        V4      VP                  R4       u # 	  R#   + '       g   i     Lb; i)	zÐGet the full version of the OpenSSH sshd daemon on the system.

On an ubuntu system, this would look something like:
1.2p1 Ubuntu-1ubuntu0.1

If we can't find `sshd` or parse the version number, return None.
r=   Ússhdz-V)ÚrcsNÚOpenSSH_r_   Ú,)r   r   ÚProcessExecutionErrorr?   rE   r1   Úfind)ÚerrÚ_ÚprefixrH   s       r   Úget_opensshd_versionr  ˆ  s†   € ð €CÜ	”$×,Ñ,×	-Õ	-Ü—’˜F D˜>°°1¨vÔ6‰ˆ÷ 
.à€FØ—	‘	˜$–ˆØ�?‰?˜6×"Ô"Øœ˜F› d§i¡i°£nÐ5Ò5ñ  ñ ÷ 
.×	-ús   ¤BÂB-	c                 ót  € Rp \        4       pVf    \        P                  P                  V 4      # RV9   d   VRVP	                  R4       p MRV9   d   VRVP	                  R4       p MTp  \        P                  P                  V 4      p V #   \
        \        3 d    \        P                  RT 4        R# i ; i)zÔGet the upstream version of the OpenSSH sshd daemon on the system.

This will NOT include the portable number, so if the Ubuntu version looks
like `1.2p1 Ubuntu-1ubuntu0.1`, then this function would return
`1.2`
z9.0NÚpr   z Could not parse sshd version: %s)	r  r   ÚVersionÚfrom_strr  ré   r@   rW   Úwarning)Úupstream_versionÚfull_versions     r   Úget_opensshd_upstream_versionr  œ  sÂ   € ð ÐÜ'Ó)€LØÒÜ× Ñ ×)Ñ)Ð*:Ó;Ð;Ø
ˆlÔØ'Ð(@¨,×*;Ñ*;¸CÓ*@ÐAÑØ	�Ô	Ø'Ð(@¨,×*;Ñ*;¸CÓ*@ÐAÑà'ÐðJÜ$×,Ñ,×5Ñ5Ð6FÓGÐØÐøÜœ	Ð"ô JÜ�‰Ð6Ð8H×IðJús   Á+ B Â'B7Â6B7)ÚrsaÚecdsaÚed25519z(ecdsa-sha2-nistp256-cert-v01@openssh.comzecdsa-sha2-nistp256z(ecdsa-sha2-nistp384-cert-v01@openssh.comzecdsa-sha2-nistp384z(ecdsa-sha2-nistp521-cert-v01@openssh.comzecdsa-sha2-nistp521z+sk-ecdsa-sha2-nistp256-cert-v01@openssh.comz"sk-ecdsa-sha2-nistp256@openssh.comz#sk-ssh-ed25519-cert-v01@openssh.comzsk-ssh-ed25519@openssh.comz ssh-ed25519-cert-v01@openssh.comzssh-ed25519zssh-rsa-cert-v01@openssh.comzssh-rsazssh-xmss-cert-v01@openssh.comzssh-xmss@openssh.comr   )*ÚloggingrO   rl   Ú
contextlibr   Útypingr   r   r   Ú	cloudinitr   r   r	   Ú	getLoggerr$   rW   rº   rA   Ú_DISABLE_USER_SSH_EXITrc   ÚDISABLE_USER_OPTSr   r-   r]   rj   rr   r�   r“   r±   rÈ   rÏ   rÑ   rå   rã   r¸   rñ   rõ   rú   rø   r  r  r  rL   r   r   Ú<module>r*     sþ   ðó Û 	Û 
Ý ß (Ñ (ç +Ñ +à×Ò˜Ó!€ð &€ð €ð, Ð ðñ Ð(Ó)õ*ð -0õ0ð ÷"ñ "÷:X
ñ X
òvò ò89òò*BòJLð^ 5Aô 6ôrB÷ñ õ.Kõò6	õ
òð &2ô ò"+ð\ ?K÷ 
òô(Jr   