File: //usr/lib/python3/dist-packages/duplicity/backends/__pycache__/ssh_paramiko_backend.cpython-310.pyc
o
�&�`tO � @ s d dl mZ d dlmZ d dlmZ d dlmZ d dlZd dlZd dlZd dl Z d dl
Z
d dlZd dlZd dl
mZ d dlZd dlmZ d dlmZ d d lmZ d d
lmZ dZG dd
� d
ejj�Zej�de� ej�de� ej�de� ej�de� ejj�g d�� dS )� )�division)�input)�oct)�zipN)�hexlify)�progress)�config)�util)�BackendExceptionic c @ sJ e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
d� Zddd�Z dd� Z
dS )�SSHParamikoBackenda� This backend accesses files using the sftp or scp protocols.
It does not need any local client programs, but an ssh server and the sftp
program must be installed on the remote side (or with scp, the programs
scp, ls, mkdir, rm and a POSIX-compliant shell).
Authentication keys are requested from an ssh agent if present, then
~/.ssh/id_rsa/dsa are tried. If -oIdentityFile=path is present in
--ssh-options, then that file is also tried. The passphrase for any of
these keys is taken from the URI or FTP_PASSWORD. If none of the above are
available, password authentication is attempted (using the URI or
FTP_PASSWORD).
Missing directories on the remote side will be created.
If scp is active then all operations on the remote side require passing
arguments through a shell, which introduces unavoidable quoting issues:
directory and file names that contain single quotes will not work.
This problem does not exist with sftp.
c s� t jj�| |� d| _|jrt�dd|jd�| _nd| _t �
� � t �d� zdd laW n t
y4 � w W d � n1 s?w Y G � fdd �d tj�}G d
d� dtj�� t�� | _| j�|� � | j�d� tj�d�}t�tj�}|�t�d
�� |�|� t�d��� }|dkr�tj}n|dkr�tj }n|dkr�tj!}n|dkr�tj"}ntj#}|�$|� d}t�%dt&j'tj(�}|d ur�|�)d�r�|�)d�n|�)d�}zt*j�+|�r�| j�,|� W n t-y� } zt.d|� d���d } ~ ww t*j�/d�}
t�%dt&j'tj(�}|d u�r|�)d��r|�)d�n|�)d�}
zt*j�+|
��r&| j�0|
� n|
| j_1W n t-�y@ } zt.d|
� d���d } ~ ww d|j2i| _&| j&�3| �4d|j2�� | j&�3| �4d|j2�� |j5�rk| j&�3d|j5i� d| j&v�r{| j&�3dt6�7� i� |j8�r�| j&�3d|j8i� d| j&v �r�| j&�3dt9| j&d �i� n| j&�3ddi� t�%dt&j'tj(�}|d u�r�|�)d��r�|�)d�n|�)d�}|�:d �| j&d!<