https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/hgext/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/hgext/__pycache__/factotum.cpython-310.pyc
o

�]Lb{�@s�dZddlmZddlZddlmZddlmZddlm	Z	ddl
mZmZm
Z
mZmZejZejZdZdaaaiZe
�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�serviceshgcCsL|j��st�td���d|vrd|}d|}t�t�dt	|f��dS)Nsfactotum not interactivesuser=s%s user?s
%s !password?s
%s -g '%s')
�ui�interactiver�Abortr�os�systemr�tonativestr�_executable)�self�params�r�0/usr/lib/python3/dist-packages/hgext/factotum.py�auth_getkeyYs
rc	Csd|}	t�dttj�}znzVt�|d|�t�|t���}|ddkrdt�|d�t�|t��dd�\}}}|dkrd|�d	�rY|�	d	�rR|d
d��
dd	�}nt�t
d
���||fWWt�|�SWnttfyut�t
d���wWt�|�nt�|�w|||�q)Ns
proto=pass %sTs%s/rpcsstart %srsoksread��'����s''smalformed password stringsfactotum not responding)r�open�_mountpoint�O_RDWR�write�read�ERRMAX�split�
startswith�endswith�replacerrr�close�OSError�IOError)r�getkeyr�fd�l�status�user�passwdrrr�auth_getuserpasswdbs0


����
�r4cs�fdd�}|S)Ncst�|j|�|S)N)r�__name__)�func��clsrr�	decorator{sz%monkeypatch_method.<locals>.decoratorr)r8r9rr7r�monkeypatch_methodzsr:c
Cs�|j�||�\}}|r|r|�||�||fSd}t�|j||�}|r7|\}}|�d�}|�d�|�d�}}|r;|s\|sF|�d�d��}dt	|f}	|rTd|	|f}	t
|t|	�\}}|�||||�|�||�||fS)	N�sprefixsusernamespassword� rsservice=%s prefix=%ss
%s user=%s)
�passwddb�find_user_password�_writedebugr�readauthforurir�getr'�lower�_servicer4r�add_password)
r�realm�authurir2r3�prefix�resr�authrrrrr>�s(
r>cCs(|�dd�a|�dd�a|�dd�adS)Nrr
rr)�configrr"rC)rrrr�uisetup�srK)�__doc__�
__future__rr�mercurial.i18nr�mercurial.pycompatr�mercurial.utilsr�	mercurialrrrr	r
�urlreq�passwordmgrr&rr"rC�configtable�
configitemrr4r:r>rKrrrr�<module>sD
���	


https://t.me/RX1948 - 2025