AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/landscape/lib/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /usr/lib/python3/dist-packages/landscape/lib/__pycache__/twisted_util.cpython-310.pyc
o

���c|�	@s�ddlZddlmZmZddlmZddlmZmZddl	m
Z
ddlmZddl
mZmZddlmZGd	d
�d
e�Zddd
�ZGdd�de�Zdidddddddf	dd�ZdS)�N)�DeferredList�Deferred)�ProcessProtocol)�Process�
ProcessReader)�reactor)�Failure)�
itervalues�
networkString)�
encode_valuesc@seZdZdZdS)�SignalErrorz3An error if the process was terminated by a signal.N)�__name__�
__module__�__qualname__�__doc__�rr�</usr/lib/python3/dist-packages/landscape/lib/twisted_util.pyr
srFcCs.t|d|d�}|�dd��|�dd��|S)N�)�fireOnOneErrback�
consumeErrorscSsdd�|D�S)NcSsg|]}|d�qS)rr)�.0�xrrr�
<listcomp>sz4gather_results.<locals>.<lambda>.<locals>.<listcomp>r)�rrrr�<lambda>sz gather_results.<locals>.<lambda>cSs|jjS�N)�value�
subFailure)�frrrrs)r�addCallback�
addErrback)�	deferreds�consume_errors�drrr�gather_resultss�r$c@s2eZdZdZddd�Zdd�Zdd�Zd	d
�ZdS)�AllOutputProcessProtocolz<A process protocol for getting stdout, stderr and exit code.NcCs:||_t��|_t��|_|jj|_||_||_d|_	dS�N�)
�deferred�io�BytesIO�outBuf�errBuf�write�errReceived�stdin�
line_received�
_partial_line)�selfr(r/r0rrr�__init__s



z!AllOutputProcessProtocol.__init__cCs.|jdur|j�t|j��|j��dSdSr)r/�	transportr-r
�
closeStdin)r2rrr�connectionMade%s
�z'AllOutputProcessProtocol.connectionMadecCsX|j�|�|jdur
dS|�d�}|j|d|d<|��|_|D]}|�|�q"dS)N�
r)r+r-r0�splitr1�pop)r2�data�lines�linerrr�outReceived*s


�z$AllOutputProcessProtocol.outReceivedcCsv|jr|�|j�d|_|j��}|j��}|j}|j}|jr0tt	|||j��}|j
�|�dS|j
�|||f�dSr&)
r1r0r+�getvaluer,r�exitCode�signalrrr(�errback�callback)r2�reason�out�err�e�code�failurerrr�processEnded:s

z%AllOutputProcessProtocol.processEnded)NN)r
rrrr3r6r=rIrrrrr%s
	r%rTc

s`|g}
|
�|�t�}t||	|d�}t|�}tj|||
|||||d��|s.�fdd�}
|
�_|S)a�
    Spawn a process using Twisted reactor.

    Return a deferred which will be called with process stdout, stderr and exit
    code.

    @param wait_pipes: if set to False, don't wait for stdin/stdout pipes to
        close when process ends.
    @param line_received: an optional callback called with every line of
        output from the process as parameter.

    @note: compared to reactor.spawnProcess, this version does NOT require the
    executable name as first element of args.
    )r/r0)�args�env�path�uid�gid�usePTYcsJ�jr�jst�j�D]}t|t�r|��|��qi�_t���dS)a�A less strict version of Process.maybeCallProcessEnded.

            This behaves exactly like the original method, but in case the
            process has ended already and sent us a SIGCHLD, it doesn't wait
            for the stdin/stdout pipes to close, because the child process
            itself might have passed them to its own child processes.

            @note: Twisted 8.2 now has a processExited hook that could
                be used in place of this workaround.
            N)	�pipes�pidr	�
isinstancer�doRead�stopReadingr�maybeCallProcessEnded)�pipe��processrrrUhs

z,spawn_process.<locals>.maybeCallProcessEnded)�extendrr%rr�spawnProcessrU)�
executablerJrKrLrMrNrO�
wait_pipesr0r/�	list_args�result�protocolrUrrWr�
spawn_processIs
�
�r`)F)r)�twisted.internet.deferrr�twisted.internet.protocolr�twisted.internet.processrr�twisted.internetr�twisted.python.failurer�twisted.python.compatr	r
�landscape.lib.encodingr�	Exceptionrr$r%r`rrrr�<module>s

0�

Anon7 - 2022
AnonSec Team