+
    oÆFjUZ  ã                   ó€  € R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt ]
P0                  P3                  RR4      t]
P0                  P3                  RR4      t^tR	tR
t ! R R]P>                  P@                  4      t!R R lt"R R lt#R R lt$R R lt%R R lt&R t'R R lt(R R lt)R R lt*R R lt+]PX                  ! R 4      t-R! R" lt.]P^                  R# R$ l4       t0R% R& lt1R' R( lt2R) R* lt3R+ R, lt4R- R. lt5R/ R0 lt6R1 R2 lt7R3 R4 lt8R5 R6 lt9RVR7 R8 llt:R9 R: lt;]P^                  R; R< l4       t<RWR= lt=R> R? lt>R@ RA lt?RB RC lt@RD RE ltARF RG ltBRVRH RI lltCRXRJ RK lltDRL RM ltERN RO ltFRP RQ ltGRR RS ltHRT RU ltIR# )Yz0Functions to manage apport problem report files.N)ÚIO)Úimpl)ÚProblemReportÚAPPORT_REPORT_DIRz
/var/crashÚAPPORT_COREDUMP_DIRz/var/lib/apport/coredumpz~/.config/apport/settingsz/run/snapd.socketc                   ó8   a € ] tR t^/t o R tV 3R lR ltRtV tR# )ÚUHTTPConnectionc                óf   € \         P                  P                  P                  V R 4       Wn        R# )Ú	localhostN)ÚhttpÚclientÚHTTPConnectionÚ__init__Úpath)Úselfr   s   &&Ú2/usr/lib/python3/dist-packages/apport/fileutils.pyr   ÚUHTTPConnection.__init__0   s!   € Ü�‰×"Ñ"×+Ñ+¨D°+Ô>ØŽ	ó    c                ó   <€ V ^8„  d   QhRR/# )é   ÚreturnN© )ÚformatÚ__classdict__s   "€r   Ú__annotate__ÚUHTTPConnection.__annotate__4   s   ø€ ÷ ñ ˜ñ r   c                ó®   € \         P                   ! \         P                  \         P                  4      pVP                  V P                  4       Wn        R # ©N)ÚsocketÚAF_UNIXÚSOCK_STREAMÚconnectr   Úsock)r   r"   s   & r   r!   ÚUHTTPConnection.connect4   s1   € Ü�}Š}œVŸ^™^¬V×-?Ñ-?Ó@ˆØ�‰�T—Y‘YÔØŽ	r   )r   r"   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   r!   Ú__static_attributes__Ú__classdictcell__)r   s   @r   r   r   /   s   ø‡ € ò÷ö r   r   c                ó$   € V ^8„  d   QhR\         /# ©r   r   )Úbool)r   s   "r   r   r   :   s   € ÷ 	ñ 	œ4ñ 	r   c                 ó¼   € \         P                  ! R\         P                  4      '       g   R#  . ROp \        P                  ! V 4      ^ 8H  #   \
         d     R# i ; i)z)Check whether crash reporting is enabled.z/usr/bin/whoopsieTF)z/bin/systemctlz-qz
is-enabledzwhoopsie.path)ÚosÚaccessÚX_OKÚ
subprocessÚcallÚOSError)Úcmds    r   Úallowed_to_reportr5   :   sK   € ä�9Š9Ð(¬"¯'©'×2Ò2ÙðÚEˆÜ�Š˜sÓ# qÑ(Ð(øÜô Úðús   ¯A ÁAÁAc                ó>   € V ^8„  d   QhR\         R\         R,          /# )r   Ú	dbus_addrr   N©Ústr)r   s   "r   r   r   F   s   € ÷ ñ œsð ¤s¨T¥zñ r   c                óÖ   € V '       g   R# V P                  R4      '       g   R# RV 9   d   R# R F  pW9   g   K   R# 	  V P                  R4      p\        V4      ^8w  d   R# V^,          # )z'Extract the socket from a DBus address.Nzunix:path=/run/user/z../Ú=)Ú%Ú,Ú;)Ú
startswithÚsplitÚlen)r7   ÚsearchÚpartss   &  r   Úget_dbus_socketrD   F   sh   € çÙð ×ÑÐ 6×7Ò7Ùð �	ÔÙó "ˆØÖÚñ "ð �O‰O˜CÓ €EÜ
ˆ5ƒz�Q„Ùà��8€Or   c                óL   € V ^8„  d   QhR\         R,          R\         R,          /# )r   ÚpackageNr   r8   )r   s   "r   r   r   `   s"   € ÷ ñ ¤c¨D¥jð ´S¸4µZñ r   c                ó®  € V f   R# Rp\         P                  ! V 4       FŒ  pVP                  R4      '       g   K  VP                  R4      '       g   VP                  R4      '       g   KL  V'       d    R#  \	        VR4      ;_uu_ 4       pRVP                  4       9  d   TpRRR4       KŽ  	  V#   + '       g   i     K£  ; i  \         d     K´  i ; i)z�Return a package's .desktop file.

If given package is installed and has a single .desktop file, return the
path to it, otherwise return None.
Nz.desktopz/etc/xdg/autostartz/usr/share/applications/Úrbs   NoDisplay=true)Ú	packagingÚ	get_filesÚendswithr?   ÚopenÚreadÚFileNotFoundError)rF   ÚdesktopfileÚlineÚfs   &   r   Úfind_package_desktopfilerR   `   s»   € ð ‚Ùà€Kä×#Ò# GÖ,ˆØ�=‰=˜×$Ô$à—?‘?Ð#7×8Ò8ÀÇÁØ*÷Bò Bñ çÚðÜ˜$ ×%Ô%¨Ø(°·±³Ô8Ø&*˜÷ &Ñ%ñ -ð& Ð÷ &×%Ð%ûô %ô Úðús0   Á7CÂB1Â#CÂ1CÂ<CÃCÃCÃCc                ó0   € V ^8„  d   QhR\         R\        /# )r   Úfiler   ©r9   r,   )r   s   "r   r   r   �   s   € ÷ ñ œ#ð ¤$ñ r   c                óÒ   € . ROpRpV F  pV P                  V4      '       g   K  Rp M	  T;'       d5    V P                  R4      '       * ;'       d    V P                  R4      '       * # )a  Check whether the given file is likely to belong to a package.

This is semi-decidable: A return value of False is definitive, a True value
is only a guess which needs to be checked with find_file_package().
However, this function is very fast and does not access the package
database.
FTz/usr/local/z	/var/lib/)	z/bin/z/bootz/etc/z/initrdz/libz/sbin/z/optz/usr/z/var)r?   )rT   Úpkg_allowlistÚallowlist_matchÚis   &   r   Úlikely_packagedrZ   �   sm   € ò
€Mð €OÛˆØ�?‰?˜1×ÔØ"ˆOÙñ ð
 	÷ 	-ð 	-Ø—‘ Ó.Ô.÷	-ð 	-à—‘ Ó,Ô,ðr   c                ó>   € V ^8„  d   QhR\         R\         R,          /# )r   rT   r   Nr8   )r   s   "r   r   r   ¢   s   € ÷ ,ñ ,œCð ,¤C¨$¥Jñ ,r   c                ó\  € \         P                  P                  V 4      w  r\         P                  P                  V4      p\         P                  P	                  V4      '       d    \         P                  P                  W24      p \        V 4      '       g   R# \        P                  ! V 4      # )zSReturn the package that ships the given file.

Return None if no package ships it.
N)	r.   r   r@   ÚrealpathÚisdirÚjoinrZ   rI   Úget_file_package)rT   Ú	directoryÚnameÚresolved_dirs   &   r   Úfind_file_packagerd   ¢   sp   € ô —g‘g—m‘m DÓ)�O€IÜ—7‘7×#Ñ# IÓ.€LÜ	‡w�w‡}�}�\×"Ò"Ü�w‰w�|‰|˜LÓ/ˆä˜4× Ò Ùä×%Ò% dÓ+Ð+r   c                óê  €  \         P                  ! \        \        4      4      ;_uu_ 4       pRV  2pVP	                  RV4       VP                  4       pVP                  ^È8X  d6   \        P                  ! VP                  4       4      R,          uuRRR4       #  RRR4       R#   + '       g   i     R# ; i  \        P                  P                  \        P                  \        3 d     R# i ; i)zZReturn the data of the given snap.

Return None if the snap is not found to be installed.
z
/v2/snaps/ÚGETÚresultN)Ú
contextlibÚclosingr   ÚSNAPD_SOCKETÚrequestÚgetresponseÚstatusÚjsonÚloadsrM   r   r   ÚHTTPExceptionÚJSONDecodeErrorr3   )ÚsnapÚcÚurlÚresponses   &   r   Ú	find_snaprv   ³   s¶   € ð
Ü×Ò¤´Ó =×>Ô>À!Ø˜t˜fÐ%ˆCØ�I‰I�e˜SÔ!Ø—}‘}“ˆHØ�‰ #Ô%Ü—z’z (§-¡-£/Ó2°8Õ<÷ ?Ò>ð &÷	 ?ñ ÷ ?Ö>ñ ûô �K‰K×%Ñ%¤t×';Ñ';¼WÐEô Úðús5   ‚+B: ­A#B&Â
B: ÂB: Â&B7	Â1B: Â7B: Â:4C2Ã1C2c                ó0   € V ^8„  d   QhR\         R\        /# ©r   Úreportr   rU   )r   s   "r   r   r   Ä   s   € ÷ <ñ <œð <¤ñ <r   c                óŽ   € \         P                  ! V 4      pVP                  VP                  8„  ;'       g    VP                  ^ 8H  # )zACheck whether the report file has already been processed earlier.)r.   ÚstatÚst_atimeÚst_mtimeÚst_size)ry   Ústs   & r   Úseen_reportr€   Ä   s2   € ä	�Š�‹€BØ�K‰K˜"Ÿ+™+Ñ%×;Ð;¨2¯:©:¸©?Ð;r   c                ó(   € V ^8„  d   QhR\         RR/# ©r   ry   r   Nr8   )r   s   "r   r   r   Ê   s   € ÷ 
ñ 
œsð 
 tñ 
r   c                 ó,  € V P                  R ^4      ^ ,           R2pV P                  R ^4      ^ ,           R2p\        P                  P                  V4      '       dƒ   \        P                  P                  V4      '       d^   \        P                  ! V 4      p\        P                  ! V4      pVP
                  VP
                  8  d   \        P                  ! V4       \        VRRR7      ;_uu_ 4         RRR4       R#   + '       g   i     R# ; i)Ú.z.uploadz	.uploadedÚaúutf-8©ÚencodingN)Úrsplitr.   r   Úexistsr{   r}   ÚunlinkrL   )ry   ÚuploadÚuploadedÚ	report_stÚ	upload_sts   &    r   Úmark_report_uploadr�   Ê   s¼   € Ø—‘˜c 1Ó% aÕ(Ð)¨Ð1€FØ—-‘-  QÓ'¨Õ*Ð+¨9Ð5€Hä	‡w�w‡~�~�h×Ò¤B§G¡G§N¡N°6×$:Ò$:Ü—G’G˜F“Oˆ	Ü—G’G˜F“Oˆ	Ø×Ñ 	× 2Ñ 2Ô2Ü�IŠI�fÔÜ	ˆf�c G×	,Ö	,Ø÷ 
-×	,×	,Ò	,ús   Ã6DÄD	c                ó4   € V ^8„  d   QhR\         R\        RR/# )r   ry   Úpidr   N)r   Úint)r   s   "r   r   r   ×   s!   € ÷ 
ñ 
¤ð 
´Sð 
¸Tñ 
r   c                 ó`  € R V 9   d   V R ,          P                  RR4      pM\        R4      h\        P                  ! 4       pV R\	        V4       RV R2p\        P
                  P                  \        V4      p\        VRRR7      ;_uu_ 4         R	R	R	4       R	#   + '       g   i     R	# ; i)
ÚExecutablePathÚ/Ú_z1report does not have the ExecutablePath attributer„   z.hangingr…   r†   r‡   N)	ÚreplaceÚ
ValueErrorr.   Úgeteuidr9   r   r_   Ú
report_dirrL   )ry   r’   ÚsubjectÚuidÚbaser   s   &&    r   Úmark_hanging_processrŸ   ×   sŠ   € Ø˜6Ô!ØÐ)Õ*×2Ñ2°3¸Ó<‰äÐLÓMÐMä
�*Š*‹,€CØˆY�aœ˜C›�z  3 % xÐ0€DÜ�7‰7�<‰<œ
 DÓ)€DÜ	ˆd�C '×	*Ö	*Ø÷ 
+×	*×	*Ò	*ús   ÂBÂB-	c                ó(   € V ^8„  d   QhR\         RR/# r‚   r8   )r   s   "r   r   r   ä   s   € ÷ "ñ "œSð " Tñ "r   c                óP  € \         P                  ! V 4      p \         P                  ! WP                  VP                  ^,
          34       R#   \         dÎ    ^pT^ 8”  d¬   \        T RR7      ;_uu_ 4       pTP                  ^4       RRR4       M  + '       g   i     M; i \         P                  ! T 4      pM  \         d      R# i ; iTP                  TP                  8”  d   M!\        P                  ! R4       T^,          pK²  T^ 8X  d   \        T 4        R#  R# i ; i)zMark given report file as seen.r†   r‡   Ngš™™™™™¹?)r.   r{   Úutimer}   r3   rL   rM   r|   ÚtimeÚsleepÚdelete_report)ry   r   ÚtimeoutÚreport_files   &   r   Úmark_report_seenr¨   ä   sÛ   € ä	�Š�‹€Bð"Ü
�Š�Ÿ+™+ r§{¡{°Q¥Ð7Ö8øÜô "ð
 ˆØ˜ŒkÜ�f w×/Õ/°;Ø× Ñ  Ô#÷ 0×/×/Ð/úðÜ—W’W˜V“_‘øÜô Ûðúð �{‰{˜RŸ[™[Ô(ØÜ�JŠJ�sŒOØ�q�LŠGà�aŒ<ä˜&×!ò ð'"úsN   ˜3A Á)D%Á6BÂ	D%ÂB!ÂD%Â%B<Â;D%Â<CÃD%ÃCÃAD%Ä$D%zH^\s*(?P<name>[A-Z0-9_]+)\s+(?P<quote>[\"\']?)(?P<value>.*)(?P=quote)\s*$c                óf   € V ^8„  d   QhR\         P                  R\        \        \        3,          /# )r   Úlinesr   )ÚioÚTextIOWrapperÚdictr9   )r   s   "r   r   r     s(   € ÷ ñ œR×-Ñ-ð ´$´s¼C°xµ.ñ r   c                 óž   € / pV  FD  p\         P                  V4      pV'       g   K"  VP                  R 4      WP                  R4      &   KF  	  V# )Úvaluerb   )Ú_LOGIN_DEFS_REÚmatchÚgroup)rª   ÚdefsrP   r±   s   &   r   Ú_parse_login_defsr´     sH   € Ø€DÛˆÜ×$Ñ$ TÓ*ˆßÙØ$)§K¡K°Ó$8ˆ�[‰[˜Ó Ó!ñ	 ð
 €Kr   c                óF   € V ^8„  d   QhR\         \        \        3,          /# r+   )r­   r9   )r   s   "r   r   r     s   € ÷ ñ œœS¤#˜X�ñ r   c                 ó¨   €  \        RRR7      ;_uu_ 4       p \        V 4      uuRRR4       #   + '       g   i     R# ; i  \         d    / u # i ; i)z?Parse /etc/login.defs and return a dictionary with its content.z/etc/login.defsr†   r‡   N)rL   r´   rN   )Úlogin_defs_files    r   Úget_login_defsr¸     sA   € ðÜÐ#¨g×6Õ6¸/Ü$ _Ó5÷ 7×6×6Ó6ûäô ØŠ	ðús(   ‚A —-¢
A ­>	¸A ¾A ÁAÁAc                ó$   € V ^8„  d   QhR\         /# r+   ©r“   )r   s   "r   r   r     ó   € ÷ ñ œñ r   c                 óh   €  \        \        4       R,          4      #   \        \        3 d     R# i ; i)zBReturn maximum system group ID (SYS_GID_MAX from /etc/login.defs).ÚSYS_GID_MAXéç  ©r“   r¸   ÚKeyErrorr™   r   r   r   Úget_sys_gid_maxrÁ     ó1   € ðÜ”>Ó# MÕ2Ó3Ð3øÜ”jÐ!ô Úðúó   ‚ œ1°1c                ó$   € V ^8„  d   QhR\         /# r+   rº   )r   s   "r   r   r   "  r»   r   c                 óh   €  \        \        4       R,          4      #   \        \        3 d     R# i ; i)zAReturn maximum system user ID (SYS_UID_MAX from /etc/login.defs).ÚSYS_UID_MAXr¾   r¿   r   r   r   Úget_sys_uid_maxrÇ   "  rÂ   rÃ   c                ó:   € V ^8„  d   QhR\         \        ,          /# r+   ©Úlistr9   )r   s   "r   r   r   *  s   € ÷ ñ œœc�ñ r   c                 ó   € . p \         P                   ! \        P                  P                  \        R4      4       F}  p \        P                  P                  V4      ^ 8”  dV   \        P                  ! V\        P                  \        P                  ,          4      '       d   V P                  V4       K{  K}  K  	  V #   \         d     K‘  i ; i)zCReturn a list with all report files accessible to the calling user.ú*.crash)Úglobr.   r   r_   r›   Úgetsizer/   ÚR_OKÚW_OKÚappendr3   ©ÚreportsÚrs     r   Úget_all_reportsrÕ   *  s’   € à€GÜ�YŠY”r—w‘w—|‘|¤J°	Ó:Ö;ˆð	Ü�w‰w�‰˜qÓ! AÔ%¬"¯)ª)°A´r·w±wÄÇÁÕ7H×*IÒ*IØ—‘˜qÖ!ñ +JÑ%ñ <ð €Nøô	 ô 	ò ð	ús   ¿A#B>Â#B>Â>CÃCc                ó:   € V ^8„  d   QhR\         \        ,          /# r+   rÉ   )r   s   "r   r   r   8  s   € ÷ ñ œœc�ñ r   c                 óš   € . p \        4        F(  p \        V4      '       g   V P                  V4       K(  K*  	  V #   \         d     K<  i ; i)z‘Get new reports for calling user.

Return a list with all report files which have not yet been processed
and are accessible to the calling user.
)rÕ   r€   rÑ   r3   rÒ   s     r   Úget_new_reportsrØ   8  sR   € ð €GÜÖˆð	Ü˜q—>’>Ø—‘˜qÖ!ñ "ñ ð €Nøô	 ô 	ò ð	ús   ‘";»A
Á	A
c                ó:   € V ^8„  d   QhR\         \        ,          /# r+   rÉ   )r   s   "r   r   r   J  s   € ÷ ñ ¤¤S¥	ñ r   c                 ó  € . p \        4       p\        P                  ! \        P                  P	                  \
        R4      4       F–  p \        P                  ! V4      pVP                  ^ 8”  dl   VP                  V8:  dY    \        P                  ! VP                  4      pVP                  P                  R4      '       d   K€   V P                  V4       K”  K–  K˜  	  V #   \         d     L(i ; i  \         d     K»  i ; i)a  Get all system reports.

Return a list with all report files which belong to a system user.
The maximum system user group ID is taken from SYS_UID_MAX from
/etc/login.defs (defaults to 999 on Debian based systems and LSB
specifies 499 in "User ID Ranges").
rÌ   Úguest)rÇ   rÍ   r.   r   r_   r›   r{   r~   Úst_uidÚpwdÚgetpwuidÚpw_namer?   rÀ   rÑ   r3   )rÓ   Úsys_uid_maxrÔ   r   Úpws        r   Úget_all_system_reportsrâ   J  sÔ   € ð €GÜ!Ó#€KÜ�YŠY”r—w‘w—|‘|¤J°	Ó:Ö;ˆð	Ü—’˜“ˆBØ�z‰z˜AŒ~ "§)¡)¨{Ô":ðÜŸš b§i¡iÓ0�BØ—z‘z×,Ñ,¨W×5Ò5Ù ð 6ð
 —‘˜qÖ!ñ #;‰~ñ <ð$ €Nøô  ô Ùðûô ô 	ò ð	ús7   Á	8C2ÂA C!ÃC2Ã!C/Ã,C2Ã.C/Ã/C2Ã2DÄ Dc                ó:   € V ^8„  d   QhR\         \        ,          /# r+   rÉ   )r   s   "r   r   r   i  s   € ÷ Gñ G¤¤S¥	ñ Gr   c                 óf   € \        4        U u. uF  p \        V 4      '       d   K  V NK  	  up # u up i )a!  Get new system reports.

Return a list with all report files which have not yet been processed
and belong to a system user. The maximum system user group ID is taken
from SYS_UID_MAX from /etc/login.defs (defaults to 999 on Debian based
systems and LSB specifies 499 in "User ID Ranges").
)râ   r€   )rÔ   s    r   Úget_new_system_reportsrå   i  s)   € ô .Ô/ÓFÑ/�!´{À1·~�AˆAÑ/ÑFÐFùÒFs   �.¥.c                ó(   € V ^8„  d   QhR\         RR/# r‚   r8   )r   s   "r   r   r   t  s   € ÷ 
ñ 
œ#ð 
 $ñ 
r   c                óâ   €  \         P                  ! V 4       R#   \         dJ    \        T RRR7      ;_uu_ 4       pTP	                  ^ 4       RRR4        R#   + '       g   i      R# ; ii ; i)zµDelete the given report file.

If unlinking the file fails due to a permission error (if report_dir is not
writable to normal users), the file will be truncated to 0 bytes instead.
Úwr†   r‡   N)r.   r‹   r3   rL   Útruncate)ry   rQ   s   & r   r¥   r¥   t  sM   € ðÜ
�	Š	�&ÖøÜô Ü�&˜#¨×0Õ0°AØ�J‰J�qŒM÷ 1×0×0Ô0úðús&   ‚ š!A.»AÁA.ÁA*Á#A.Á*A.c                óF   € V ^8„  d   QhR\         \        ,          R\        /# rx   )r   Úbytesr“   )r   s   "r   r   r   �  s   € ÷ ñ œr¤%�yð ¬Sñ r   c                ón  € \        4       pVP                  V RRR.R7        \        VR,          4      p\        P                  ! \        P
                  ! VR,          4      4      p\        P                  ! \        P                  ! 4       4      pWC,
          R8”  d   ^ # V#   \        \        3 d     ^ # i ; i)z®Return the number of recent crashes for the given report file.

Return the number of recent crashes (currently, crashes which happened more
than 24 hours ago are discarded).
FÚCrashCounterÚDate)Ú
key_filteri€Q )	r   Úloadr“   r£   ÚmktimeÚstrptimeÚ	localtimer™   rÀ   )ry   ÚprÚcountÚreport_timeÚcur_times   &    r   Úget_recent_crashesrø   �  s�   € ô 
‹€BØ‡G�GˆF�E ~°vÐ&>€GÔ?ð	Ü�B�~Õ&Ó'ˆÜ—k’k¤$§-¢-°°6µ
Ó";Ó<ˆÜ—;’;œtŸ~š~Ó/Ó0ˆàÕ! IÔ-ÙØˆøÜœÐ!ô Úðús   ¢A9B ÂB ÂB4Â3B4c                ó4   € V ^8„  d   QhR\         R\        RR/# ©r   ry   Úfilenamer   N©r   r9   )r   s   "r   r   r   •  s!   € ÷ 
4ñ 
4¤Mð 
4¼Sð 
4ÀTñ 
4r   c                óü  € \        V4      '       g   R# \        P                  ! V\        P                  \        P                  ,          \        P
                  ,          4      p\        P                  ! V4      p\        P                  ! VP                  4      '       dK   \        P                  ! VR4      ;_uu_ 4       p\        V4      ^,           pRRR4       \        X4      V R&   R# R#   + '       g   i     L"; i)z/Increment the crash counter if report was seen.NrH   rí   )r€   r.   rL   Ú
O_NOFOLLOWÚO_RDONLYÚ
O_NONBLOCKÚfstatr{   ÚS_ISREGÚst_modeÚfdopenrø   r9   )ry   rû   Úfdr   rQ   Úcrash_counters   &&    r   Úincrement_crash_counterr  •  s˜   € ä�x× Ò Ùä	�Š�œ2Ÿ=™=¬2¯;©;Õ6¼¿¹ÕFÓ	G€BÜ	�Š�"‹€BÜ‡|‚|�B—J‘J×ÒÜ�YŠY�r˜4× Ô  AÜ.¨qÓ1°AÕ5ˆM÷ !ä!$ ]Ó!3ˆˆ~Óñ  ß × ús   Â>C+Ã+C;	c                óv   € V ^8„  d   QhR\         R\        \        ,          R,          R\        \        ,          /# )r   ry   r�   Nr   )r   r“   r9   r   rë   )r   s   "r   r   r   ¢  s/   € ÷ ñ œ]ð ´´sµ¸TÕ1Að ÌRÔPUÍYñ r   c                óZ  € RV 9   d   V R,          P                  RR4      pM3RV 9   d"   V R,          P                  R^4      ^ ,          pM\        R4      hVf   \        P                  ! 4       p\        P
                  P                  \        V R\        V4       R24      p\        VR	4      # )
a#  Construct a canonical pathname for a report and open it for writing.

If uid is not given, it defaults to the effective uid of the current
process. The report file must not exist already, to prevent losing
previous reports or symlink attacks.

Return an open file object for binary writing.
r•   r–   r—   ÚPackageNz7report has neither ExecutablePath nor Package attributer„   z.crashÚxb)
r˜   r@   r™   r.   rš   r   r_   r›   r9   rL   )ry   r�   rœ   r   s   &&  r   Úmake_report_filer  ¢  s–   € ð ˜6Ô!ØÐ)Õ*×2Ñ2°3¸Ó<‰Ø	�fÔ	Ø˜Õ#×)Ñ)¨$°Ó2°1Õ5‰äÐRÓSÐSà
‚{Ü�jŠj‹lˆä�7‰7�<‰<œ
 w i¨q´°S³°
¸&Ð$AÓB€DÜ��dÓÐr   c                óF   € V ^8„  d   QhR\         R\        \         ,          /# )r   Úsumfiler   )r9   rÊ   )r   s   "r   r   r   ¹  s   € ÷ ñ œSð ¤T¬#¥Yñ r   c           	     óÔ  € \         P                  P                  V 4      '       g   Q h\        P                  ! RRV .R\        P
                  \        P
                  R/ R7      pVP                  ^ 8X  d   . # . pVP                  P                  4       P                  4        FD  pVP                  R4      '       g   K  VP                  VP                  R^4      ^ ,          4       KF  	  V# )zˆCheck file integrity against md5 sum file.

sumfile must be md5sum(1) format (relative to /).

Return a list of files that don't match.
z/usr/bin/md5sumz-cFr–   )ÚcheckÚstdoutÚstderrÚcwdÚenvÚFAILEDÚ:)r.   r   rŠ   r1   ÚrunÚPIPEÚ
returncoder  ÚdecodeÚ
splitlinesrK   rÑ   r‰   )r  Úmd5sumÚ
mismatchesrP   s   &   r   Úcheck_files_md5r  ¹  s»   € ô �7‰7�>‰>˜'×"Ò"Ð"Ð"Ü�^Š^Ø	˜D 'Ð*ØÜ�‰Ü�‰ØØô€Fð ×Ñ˜AÔØˆ	à€JØ—‘×$Ñ$Ó&×1Ñ1Ö3ˆØ�=‰=˜×"Ô"Ø×Ñ˜dŸk™k¨#¨qÓ1°!Õ4Ö5ñ 4ð Ðr   c                óD   € V ^8„  d   QhR\         R\        P                  /# ©r   r   r   )r9   ÚconfigparserÚConfigParser)r   s   "r   r   r   ×  s    € ÷ ñ œSð ¤\×%>Ñ%>ñ r   c                 óÄ  € \         P                  ! R R7      pRpR pR p \        P                  ! V \        P                  \        P
                  ,          4      p\        P                  ! V4      p\        P                  ! VP                  4      '       d)   \        P                  ! VR4      pVP                  R4      pTe   TP                  4        MTe   \        P                  ! T4        TP                  T4       T#   \         d     LPi ; i  Te   TP                  4        i Te   \        P                  ! T4       i i ; i  \         P                   d     T# i ; i)N)ÚinterpolationÚ rÔ   iô  )r!  r"  r.   rL   rþ   rÿ   r  r{   r  r  r  rM   r3   ÚcloseÚread_stringÚMissingSectionHeaderError)r   ÚconfigÚcontentsr  rQ   r   s   &     r   Ú_get_config_parserr+  Ö  s  € ä×&Ò&°TÔ:€FØ€HØ	€BØ€AðÜ�WŠW�Tœ2Ÿ=™=¬2¯;©;Õ6Ó7ˆÜ�XŠX�b‹\ˆÜ�<Š<˜Ÿ
™
×#Ò#Ü—	’	˜"˜cÓ"ˆAà—v‘v˜c“{ˆHð Š=Ø�G‰G�IØŠ^Ü�HŠH�RŒLðØ×Ñ˜8Ô$ð €Møô ô Ùðûð Š=Ø�G‰G�IØŠ^Ü�HŠH�R�Lð ûô
 ×1Ñ1ô Øà€Mðús6   ŸBD  Ã-E Ä DÄD ÄDÄD Ä2EÅEÅEc                ód  € V'       gG   \         P                  ! \        P                  ! 4       4      ^,          p\        P                  RV4      p\        V4      p V'       d   VP                  W4      # VP                  W4      #   \        P                  \        P                  3 d    Tu # i ; i)zÐReturn a setting from user configuration.

This is read from ~/.config/apport/settings or path. If bool is True, the
value is interpreted as a boolean.

Privileges may need to be dropped before calling this.
Ú~)rÝ   rÞ   r.   rš   Ú_CONFIG_FILEr˜   r+  Ú
getbooleanÚgetr!  ÚNoOptionErrorÚNoSectionError)ÚsectionÚsettingÚdefaultr   ÚbooleanÚhomedirr)  s   &&&&&  r   Ú
get_configr8  ó  s‰   € ÷ ä—,’,œrŸzšz›|Ó,¨QÕ/ˆÜ×#Ñ# C¨Ó1ˆä Ó%€FðßØ×$Ñ$ WÓ6Ð6Ø�z‰z˜'Ó+Ð+øÜ×&Ñ&¬×(CÑ(CÐDô ØŠðús   ÁB Á4B Â'B/Â.B/c                ó0   € V ^8„  d   QhR\         R\        /# )r   r*  r   )r9   r“   )r   s   "r   r   r   
  s   € ÷ %ñ %œCð %¤Cñ %r   c                óv   € W P                  R4      ^,           R p\        VP                  4       ^,          4      # )z7Extract the starttime from the contents of a stat file.Ú)N)Úrfindr“   r@   )r*  Ústrippeds   & r   Úget_starttimer>  
  s4   € ð Ÿ™ sÓ+¨aÕ/Ð1Ð2€Häˆx�~‰~Ó Õ#Ó$Ð$r   c                ón   € V ^8„  d   QhR\         R\        \        R,          \        R,          3,          /# )r   r*  r   N)r9   Útupler“   )r   s   "r   r   r     s,   € ÷  ñ  œcð  ¤e¬C°$­J¼¸d½
Ð,BÕ&Cñ  r   c                óž  € RpRpV P                  4        F³  pVP                  R4      '       dA   \        VP                  4       4      ^8”  d#   \	        VP                  4       ^,          4      pKZ  VP                  R4      '       g   Ks  \        VP                  4       4      ^8”  g   K“  \	        VP                  4       ^,          4      pKµ  	  W3# )z;Extract the uid and gid from the contents of a status file.NzUid:zGid:)r  r?   rA   r@   r“   )r*  Úreal_uidÚreal_gidrP   s   &   r   Úget_uid_and_gidrD    s–   € à€HØ€HØ×#Ñ#Ö%ˆð �?‰?˜6×"Ò"¤s¨4¯:©:«<Ó'8¸1Ô'<Ü˜4Ÿ:™:›<¨�?Ó+ŠHØ�_‰_˜V×$Ô$¬¨T¯Z©Z«\Ó):¸QÖ)>Ü˜4Ÿ:™:›<¨�?Ó+ŠHñ &ð ÐÐr   c                óR   € V ^8„  d   QhR\         \        ,          R\        R\        /# )r   Úmapfdr�   r   )r   r9   r“   r,   )r   s   "r   r   r   $  s%   € ÷ ñ ”bœ•gð ¤Cð ¬Dñ r   c                óÜ   € V  Fe  pVP                  4       p\        V4      ^8w  d   K%  \        V^,          4      pV\        V^,          4      ,           pYAu;8:  d   V8:  g   K`    R#  Kg  	  R# )zSearch for an ID in a map fd.TF)r@   rA   r“   )rF  r�   rP   ÚfieldsÚ
host_startÚhost_ends   &&    r   Ú
search_maprK  $  s]   € ãˆØ—‘“ˆÜˆv‹;˜!ÔÙä˜ �“^ˆ
Ø¤ F¨1¥I£Õ.ˆàÖ( ×(Úò )ñ ñ r   c                ó$   € V ^8„  d   QhR\         /# r+   r8   )r   s   "r   r   r   4  s   € ÷ ñ ”Sñ r   c                 ó¦   € \        RRR7      ;_uu_ 4       p V P                  4       P                  4       pRRR4       V#   + '       g   i     X# ; i)zGet the kernel boot id.z/proc/sys/kernel/random/boot_idr†   r‡   N)rL   rM   Ústrip)rQ   Úboot_ids     r   Úget_boot_idrP  4  s>   € ä	Ð/¸'×	BÕ	BÀaØ—&‘&“(—.‘.Ó"ˆ÷ 
Cà€N÷ 
CÖ	Bà€Nús	   –?¿A	c                óR   € V ^8„  d   QhR\         R\        \        \        3,          /# )r   Úproc_pid_fdr   )r“   r­   r9   )r   s   "r   r   r   ;  s&   € ÷ Xñ X¤Sð X¬T´#´s°(­^ñ Xr   c           	     ó^  a € R V 3R llp\        RRRVR7      ;_uu_ 4       pVP                  4       P                  R4      pRRR4       X'       g   / # \        VP	                  R	4       Uu. uF  pR
V9   g   K  VP	                  R
^4      NK   	  up4      #   + '       g   i     L]; iu upi )z€Get the process environ from a proc directory file descriptor.

Raises an OSError in case the environ file could not been read.
c                ó|   € V ^8„  d   QhR\         \        P                  \         ,          ,          R\        R\        /# ©r   r   Úflagsr   ©r9   r.   ÚPathLiker“   )r   s   "r   r   Ú)get_process_environ.<locals>.__annotate__A  ó/   € ÷ 8ñ 8”Sœ2Ÿ;™;¤sÕ+Õ+ð 8´Cð 8¼Cñ 8r   c                 ó4   <€ \         P                  ! WSR 7      # ©©Údir_fd©r.   rL   ©r   rV  rR  s   &&€r   ÚopenerÚ#get_process_environ.<locals>.openerA  ó   ø€ Ü�wŠw�t¨;Ô7Ð7r   Úenvironr†   r˜   )rˆ   Úerrorsra  z  NÚ r;   )rL   rM   Úrstripr­   r@   )rR  ra  Ú
environ_fdrd  Úentrys   f    r   Úget_process_environrj  ;  s˜   ø€ ÷8ð 8ô 
Ø˜G¨I¸f÷
õ 
à	Ø—/‘/Ó#×*Ñ*¨5Ó1ˆ÷
÷
 Øˆ	Ü°'·-±-ÀÔ2EÓVÑ2E¨ÈÐPUÉÔ$�—‘˜S !Ö$Ñ2EÑVÓWÐW÷
÷ 
üò Ws   ¢ BÁ,	B*Á:B*ÂB'	c                ó>   € V ^8„  d   QhR\         R,          R\        /# )r   rR  Nr   )r“   r9   )r   s   "r   r   r   N  s   € ÷ ñ ¤#¨¥*ð ¼ñ r   c                ód   € V f   R#  \         P                  ! RV R7      #   \         d     R# i ; i)z;Get the process path from a proc directory file descriptor.ÚunknownÚexer]  )r.   Úreadlinkr3   )rR  s   &r   Úget_process_pathrp  N  s3   € àÒÙðÜ�{Š{˜5¨Ô5Ð5øÜô Úðús   ˆ   /®/c                óÈ   € V ^8„  d   QhR\         R,          R\        R,          R\         R,          R\         R,          R\         R,          R\        \        \        3,          /# )r   r’   Nrn  r�   Ú	timestamprR  r   )r“   r9   r@  )r   s   "r   r   r   X  s`   € ÷ %"ñ %"Ü	ˆt�ð%"ä	ˆt�ð%"ô 
ˆt�ð%"ô �T�zð	%"ô
 �t•ð%"ô Œ3”ˆ8…_ñ%"r   c           
     ó   a€ R V3R llpV eL   VfH   Se   RpMRV  R2p\        VRVR7      ;_uu_ 4       pVP                  4       pRRR4       \        X4      pVf   \        S4      pVP	                  R	R
4      P	                  RR
4      pVf   \
        P                  ! 4       pV f   RV RV R\        4        R2p	MRV RV R\        4        RV  RV 2
p	\
        P                  P                  \        V	4      p
Wš3#   + '       g   i     L¾; i)zGet the path to a core file.c                ó|   € V ^8„  d   QhR\         \        P                  \         ,          ,          R\        R\        /# rU  rW  )r   s   "r   r   Ú#get_core_path.<locals>.__annotate__a  rZ  r   c                 ó4   <€ \         P                  ! WSR 7      # r\  r_  r`  s   &&€r   ra  Úget_core_path.<locals>.openera  rc  r   Nr{   z/proc/z/statr†   )rˆ   ra  r–   r—   r„   zcore.z.unknown.unknown)rL   rM   r>  rp  r˜   r.   ÚgetuidrP  r   r_   Úcore_dir)r’   rn  r�   rr  rR  ra  Ústat_filenameÚ	stat_fileÚstat_contentsÚ	core_nameÚ	core_paths   &&&&f      r   Úget_core_pathr  X  s  ø€ ÷8ð 8ð ‚˜9Ò,ØÒ"Ø"‰Mà$ S E¨Ð/ˆMÜ�-¨'¸&×AÕAÀYØ%ŸN™NÓ,ˆM÷ Bä! -Ó0ˆ	à
‚{Ü˜{Ó+ˆØ
�+‰+�c˜3Ó
×
'Ñ
'¨¨SÓ
1€Cà
‚{Ü�iŠi‹kˆð ‚{Ø˜C˜5  #  a¬« Ð6FÐG‰	à˜C˜5  #  a¬« °a¸°u¸A¸i¸[ÐIˆ	ä—‘—‘œX yÓ1€IàÐ!Ð!÷) B×Aús   ¶C=Ã=D	c                óh   € V ^8„  d   QhR\         R\        \        \        \        3,          ,          /# )r   r�   r   )r“   rÊ   r@  r9   Úfloat)r   s   "r   r   r   €  s(   € ÷ ñ ¤ð ¬¬U´3¼°:Õ->Õ(?ñ r   c                óÐ  € . p. p\         P                  P                  \        4      '       d   \         P                  ! \        R7      pV F  p VP                  R4      ^,          \        V 4      8X  dV   \         P                  P                  \         P                  P                  \        V4      4      pVP                  W434       K  K�  	  V#   \        \        3 d     K™  i ; i)zšSearch the core file directory for files that belong to a
specified uid. Returns a list of tuples containing the filename and
the file modification time.
)r   r„   )r.   r   rŠ   ry  Úlistdirr@   r9   Úgetmtimer_   rÑ   Ú
IndexErrorrN   )r�   Ú
core_filesÚ	uid_filesrQ   Úcore_file_times   &    r   Úfind_core_files_by_uidr‰  €  s±   € ð
 €JØ€Iä	‡w�w‡~�~”h×ÒÜ—Z’Z¤XÔ.ˆ
ãˆð	Ø�w‰w�s‹|˜A�¤# c£(Ô*Ü!#§¡×!1Ñ!1´"·'±'·,±,¼xÈÓ2KÓ!L�Ø× Ñ  !Ð!4Ö5ñ +ñ ð Ðøô Ô-Ð.ô 	Úð	ús   ÁA9CÃC%Ã$C%c                ó(   € V ^8„  d   QhR\         RR/# )r   r�   r   Nrº   )r   s   "r   r   r   •  s   € ÷ 1ñ 1œcð 1 dñ 1r   c                ó®  € \        V 4      p\        V\        P                  ! ^4      R7      p\	        V4      \
        ^,
          8”  dŽ   \        \	        V4      \
        ,
          ^,           4       Fa  p\        P                  ! \        P                  P                  \        V^ ,          ^ ,          4      4       VP                  V^ ,          4       Kc  	  R# R# )z]Remove old files from the core directory if there are more than
the maximum allowed per uid.
)ÚkeyN)r‰  ÚsortedÚoperatorÚ
itemgetterrA   ÚMAX_COREFILES_PER_UIDÚranger.   Úremover   r_   ry  )r�   r‡  Úsorted_filesr—   s   &   r   Úclean_core_directoryr”  •  s“   € ô ' sÓ+€IÜ˜)¬×)<Ò)<¸QÓ)?Ô@€Lô ˆ9ƒ~Ô-°Õ1Ô1Ü”s˜9“~Ô(=Õ=ÀÕAÖBˆAÜ�IŠI”b—g‘g—l‘l¤8¨\¸!­_¸QÕ-?Ó@ÔAØ×Ñ ¨Q¥Ö0ó Cñ 2r   c                óR   € V ^8„  d   QhR\         R\        \         \         3,          /# r   )r9   r­   )r   s   "r   r   r   £  s"   € ÷ "ñ "œ3ð "¤4¬¬S¨¥>ñ "r   c                óf  € / p\         P                  ! RV .\         P                  \         P                  RR7      ;_uu_ 4       pVP                  f   Q hVP                   Fs  p VP                  R^4      w  rETP                  4       pRT9   d   K1  TP                  4       ^ ,          P                  4       pTP                  R4      '       d   Ko  YQT&   Ku  	  VP                  P                  4        RRR4       XP                  ^ 8w  d   / # V#   \         d     K¼  i ; i  + '       g   i     L7; i)zŸGet libraries with which the specified binary is linked.

Return a library name -> path mapping, for example 'libc.so.6' ->
'/lib/x86_64-linux-gnu/libc.so.6'.
ÚlddT)r  r  Úuniversal_newlinesNz=>z
linux-vdsoÚ()r1   ÚPopenr  ÚSTDOUTr  r@   r™   rN  r?   r&  r  )r   Úlibsr—  rP   rb   Úrests   &     r   Úshared_librariesrž  £  s  € ð €Dä	×	Ò	Ø	�ˆÜ�‰Ü× Ñ Ø÷	
õ 
ð
 
Ø�z‰zÒ%Ð%Ð%Ø—J”JˆDðØ!ŸZ™Z¨¨aÓ0‘
�ð —:‘:“<ˆDà˜tÔ#Ùà—:‘:“< •?×(Ñ(Ó*ˆDØ�‰˜s×#Ò#ÙØ�‹Jñ ð 	�
‰
×ÑÔ÷-
ð0 ‡~�~˜ÔØˆ	Ø€Køô! ô Úðú÷
÷ 
ús7   Á D Á$DÁ8AD Ã$D ÄD	ÄD ÄD	ÄD Ä D0	c                óJ   € V ^8„  d   QhR\         R\        R\        R,          /# rú   rü   )r   s   "r   r   r   È  s%   € ÷ ñ œmð ´sð ¼sÀT½zñ r   c                óð   €  \        V R,          4      pV^8”  d   RV R2# \        P                  P                  V4      '       d   \        V4      '       g   RV R2# R#   \        \        3 d    ^ p L`i ; i)z˜Check if the crash should be skipped for flood protection.

In case the crash should be skipped return a string with the reason.
Otherwise return None.
rí   z this executable already crashed z times, ignoringzreport z< already exists and unseen, skipping to avoid disk usage DoSN)r“   rÀ   r™   r.   r   rŠ   r€   )ry   rû   r  s   && r   Úshould_skip_crashr¡  È  s…   € ðÜ˜F >Õ2Ó3ˆð �qÔØ1°-°Ð@PÐQÐQÜ	‡w�w‡~�~�h×Ò¬°H×(=Ò(=ð �h�Zð  0ð 1ð	
ñ øô ”jÐ!ô ØŠðús   ‚A ÁA5Á4A5c                ó<   € V ^8„  d   QhR\         R\         R\        /# )r   r   Úlibr   rU   )r   s   "r   r   r   Ý  s!   € ÷ ñ ¤Cð ¬cð ´dñ r   c                óx   € \        V 4      pW9   d   R# V F   pVP                  V R24      '       g   K   R# 	  R# )zÅCheck if the binary at path links with the library named lib.

path should be a fully qualified path (e.g. report['ExecutablePath']),
lib may be of the form 'lib<name>' or 'lib<name>.so.<version>'
Tz.so.F)rž  r?   )r   r£  rœ  Ú
linked_libs   &&  r   Úlinks_with_shared_libraryr¦  Ý  s?   € ô ˜DÓ!€Dà
„{Ùãˆ
Ø× Ñ  C 5¨ ×.Ô.Úñ ñ r   r   )NNF)NNNNN)JÚ__doc__r!  rh   Ú	functoolsrÍ   Úhttp.clientr   r«   rn   rŽ  r.   rÝ   Úrer   r{   r1   r£   Útypingr   Úapport.packaging_implr   rI   Úproblem_reportr   rd  r0  r›   ry  r�  r.  rj   r   r   r   r5   rD   rR   rZ   rd   rv   r€   r�   rŸ   r¨   Úcompiler°   r´   Úcacher¸   rÁ   rÇ   rÕ   rØ   râ   rå   r¥   rø   r  r  r  r+  r8  r>  rD  rK  rP  rj  rp  r  r‰  r”  rž  r¡  r¦  r   r   r   Ú<module>r°     s‰  ðÙ 6ó Û Û Û Û Û 	Û Û Û 	Û 
Û 	Û Û Û Û Ý å 3Ý (à�Z‰Z�^‰^Ð/°Ó>€
Ø�:‰:�>‰>Ð/Ð1KÓL€ØÐ à*€à"€ô�d—k‘k×0Ñ0ô õ	õõ4õBõB,ò"õ"<õ
õ
õ"ð: —’ØOó€õ
ð ‡�ôó ðõõõõõ$õ>Gõ
õõ(
4÷õ.ð: ‡�ôó ðô8õ.%õ õõ õX÷&÷%"õPõ*1õ"õJ÷*r   