Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib64/python3.9/site-packages/hgext/__pycache__/ |
Upload File : |
a �+�b{ � @ s� d Z ddlmZ ddlZddlmZ ddlmZ ddlm Z ddl mZmZm Z mZmZ ejZejZdZd a aai Ze �e�Zed d dd� ed d dd� ed ddd� dd� Zdd� Zdd� Zee�dd� �Zdd� ZdS )a� http authentication with factotum This extension allows the factotum(4) facility on Plan 9 from Bell Labs platforms to provide authentication information for HTTP access. Configuration entries specified in the auth section as well as authentication information provided in the repository URL are fully supported. If no prefix is specified, a value of "*" will be assumed. By default, keys are specified as:: proto=pass service=hg prefix=<prefix> user=<username> !password=<password> If the factotum extension is unable to read the required key, one will be requested interactively. A configuration section is available to customize runtime behavior. By default, these entries are:: [factotum] executable = /bin/auth/factotum mountpoint = /mnt/factotum service = hg The executable entry defines the full path to the factotum binary. The mountpoint entry defines the path to the factotum file service. Lastly, the service entry controls the service name used when reading keys. � )�absolute_importN)�_)�setattr)�procutil)�error�httpconnection� registrar�url�util� � factotum� executables /bin/auth/factotum)�default� mountpoints /mnt/factotum� services hgc C sL | j �� st�td���d|vr(d| }d| }t�t�dt |f �� d S )Ns factotum not interactives user=s %s user?s %s !password?s %s -g '%s') �ui�interactiver �Abortr �os�systemr Ztonativestr�_executable)�self�params� r �4/usr/lib64/python3.9/site-packages/hgext/factotum.py�auth_getkeyY s r c C s d| }t �dt t j�}z�z�t �|d| � t �|t��� }|d dkr�t �|d� t �|t��d d�\}}}|dkr�|�d�r�|� d�r�|d d � � dd�}nt�t d���||fW W t �|� S W n$ ttfy� t�t d ���Y n0 W t �|� nt �|� 0 || |� qd S )Ns proto=pass %ss %s/rpcs start %sr s oks read� � '� ���s ''s malformed password strings factotum not responding)r �open�_mountpoint�O_RDWR�write�read�ERRMAX�split� startswith�endswith�replacer r r �close�OSError�IOError)r Zgetkeyr �fd�l�status�user�passwdr r r �auth_getuserpasswdb s( �r2 c s � fdd�}|S )Nc s t � | j| � | S )N)r �__name__)�func��clsr r � decorator{ s z%monkeypatch_method.<locals>.decoratorr )r6 r7 r r5 r �monkeypatch_methodz s r8 c C s� | j �||�\}}|r.|r.| �||� ||fS d}t�| j||�}|rn|\}}|�d�}|�d�|�d� }}|rv|s�|s�|�d�d �� }dt |f } |r�d| |f } t | t| �\}}| �||||� | �||� ||fS ) N� s prefixs usernames password� r s service=%s prefix=%ss %s user=%s) Zpasswddb�find_user_passwordZ_writedebugr Zreadauthforurir �getr&