Sh3ll
OdayForums


Server : Apache
System : Linux server1.cgrithy.com 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64
User : nobody ( 99)
PHP Version : 8.1.23
Disable Function : NONE
Directory :  /opt/alt/python311/lib64/python3.11/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/alt/python311/lib64/python3.11/__pycache__/pty.cpython-311.pyc
�

�,d]���dZddlmZddlZddlZddlZddlmZmZddlmZmZm	Z	gd�Z
dZdZdZ
dZd	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zeefd�Zeefd�ZdS)zPseudo terminal utilities.�)�selectN)�close�waitpid)�setraw�	tcgetattr�	tcsetattr)�openpty�fork�spawn��c��	tj��S#ttf$rYnwxYwt	��\}}t|��}||fS)zdopenpty() -> (master_fd, slave_fd)
    Open a pty master/slave pair, using os.openpty() if possible.)�osr	�AttributeError�OSError�_open_terminal�
slave_open)�	master_fd�
slave_name�slave_fds   �*/opt/alt/python311/lib64/python3.11/pty.pyr	r	s`��
��z�|�|����G�$�
�
�
���
����*�,�,��I�z��*�%�%�H��h��s��)�)c���	tj��\}}tj|��}tj|��||fS#tt
f$rYnwxYwt
��S)z�master_open() -> (master_fd, slave_name)
    Open a pty master and return the fd, and the filename of the slave end.
    Deprecated, use openpty() instead.)rr	�ttynamerrrr)rrrs   r�master_openr&sx��
%� �j�l�l��	�8��Z��)�)�
�
�������*�$�$��
�G�$�
�
�
���
�������s�A�A�Ac��dD]M}dD]H}d|z|z}	tj|tj��}n#t$rY�7wxYw|d|z|zfccS�Ntd���)z1Open pty master and return (master_fd, tty_name).�pqrstuvwxyzPQRST�0123456789abcdefz/dev/ptyz/dev/ttyzout of pty devices)r�open�O_RDWRr)�x�y�pty_name�fds    rrr6s���
�,�,��#�	,�	,�A�!�A�~��)�H�
��W�X�r�y�1�1�����
�
�
���
�����
�Q���*�+�+�+�+�+�+�
	,��&�
'�
'�'s�2�
?�?c���tj|tj��}	ddlm}m}n#t$r|cYSwxYw	|||d��|||d��n#t$rYnwxYw|S)z�slave_open(tty_name) -> slave_fd
    Open the pty slave and acquire the controlling terminal, returning
    opened filedescriptor.
    Deprecated, use openpty() instead.r)�ioctl�I_PUSH�ptem�ldterm)rrr�fcntlr%r&�ImportErrorr)�tty_name�resultr%r&s    rrrBs����W�X�r�y�
)�
)�F��'�'�'�'�'�'�'�'�'�������
�
�
�����
�
��f�f�f�%�%�%�
��f�f�h�'�'�'�'���
�
�
���
�����Ms�*�9�9�A�
A%�$A%c��	tj��\}}|tkr%	tj��n#t$rYnwxYw||fS#t
tf$rYnwxYwt
��\}}tj��}|tkr�tj��tj|��tj	|t��tj	|t��tj	|t��|tkrtj|��tj
tjt��tj��}tj|��ntj|��||fS)zdfork() -> (pid, master_fd)
    Fork and make the child a session leader with a controlling terminal.)r�forkpty�CHILD�setsidrrr	r
r�dup2�STDIN_FILENO�
STDOUT_FILENO�
STDERR_FILENOrrr)�pidr#rr�tmp_fds     rr
r
Tse����*�,�,���R��%�<�<�
��	�������
�
�
���
�����B�w���
�G�$�
�
�
���
����"�)�)��I�x�
�'�)�)�C�
�e�|�|�
�	����
������	���,�'�'�'�
���-�(�(�(�
���-�(�(�(��m�#�#��H�X��������M�2�2�B�I�>�>��
�������
�������	�>�s �A�8�
A�A�A �A c�P�|r#tj||��}||d�}|�!dSdS)z#Write all the data to a descriptor.N)r�write)r#�data�ns   r�_writenr;|sF��
���H�R������A�B�B�x��������c�,�tj|d��S)zDefault read function.i)r�read)r#s r�_readr?�s��
�7�2�t���r<c�\�|tg}|r�t|gg��\}}}||vr=	||��}n#t$rd}YnwxYw|sdStjt
|��t|vr=|t��}|s|�t��nt||��|��dSdS)z�Parent copy loop.
    Copies
            pty master -> standard output   (master_read)
            standard input -> pty master    (stdin_read)r<N)r2rrrr8r3�remover;)r�master_read�
stdin_read�fds�rfds�_wfds�_xfdsr9s        r�_copyrH�s���
�l�
#�C�

�)�#�C��R�0�0���e�U�����
�"�{�9�-�-�����
�
�
�����
�����
.�������-�-�-��4����:�l�+�+�D��
)��
�
�<�(�(�(�(��	�4�(�(�(�+�)�)�)�)�)s�2�A�Ac�d�t|��td��kr|f}tjd|��t��\}}|tkrtj|dg|�R�	tt��}tt��d}n#tj$rd}YnwxYw	t|||��|r tttj|��n(#|r!tttj|��wwxYwt|��t!|d��dS)zCreate a spawned process.�z	pty.spawnrTFr)�type�sys�auditr
r/r�execlprr2r�tty�errorrHr�	TCSAFLUSHrr)�argvrBrCr5r�mode�restores       rrr�s2���D�z�z�T�"�X�X����w���I�k�4� � � ��V�V�N�C��
�e�|�|�
�	�$�q�'�!�D�!�!�!�!����&�&���|���������9������������9�
�i��j�1�1�1��	9��l�C�M�4�8�8�8����	9��l�C�M�4�8�8�8�8�	9����
�)�����3��?�?�1��s�.*B�B-�,B-�1C%�%%D
)�__doc__rrrLrOrrrrr�__all__r2r3r4r/r	rrrr
r;r?rHr�r<r�<module>rXs;�� � �������	�	�	�	�
�
�
�
�
�
�
�
���������,�,�,�,�,�,�,�,�,�,�
&�
&�
&�����
��
�	��
�
�
���� 
(�
(�
(����$&�&�&�P������"'�5�)�)�)�)�:"�e������r<

ZeroDay Forums Mini