
    Ϫf                         d Z ddlZddlmZmZmZ ddlmZmZ ddl	m
Z
 e
j                  e
j                  e
j                  e
j                  e
j                  dZ G d de      Z G d	 d
e      Zy)z
Twisted inetd.

Maintainer: Andrew Bennetts

Future Plans: Bugfixes.  Specifically for UDP and Sun-RPC, which don't work
correctly yet.
    N)fdescprocessreactor)ProtocolServerFactory)wire)echochargendiscarddaytimetimec                       e Zd ZdZd Zy)InetdProtocolzDForks a child process on connectionMade, passing the socket as fd 0.c                    | j                   j                         }||d}| j                  j                  r'| j                  j                  j                         |d<   t	        j
                  |       d|v rt	        j
                  |d          | j                  j                  }|j                  }|j                  }|t        j                         k(  rd }|t        j                         k(  rd }t        j                  d |j                  |j                  t        j                   d d |||	       t#        j$                  | j                          t#        j&                  | j                          y )N)r         )	transportfilenofactory
stderrFiler   setBlockingserviceusergrouposgetuidgetgidr   ProcessprogramprogramArgsenvironr   removeReaderremoveWriter)selfsockFDchildFDsr   uidgids         6/usr/lib/python3/dist-packages/twisted/runner/inetd.pyconnectionMadezInetdProtocol.connectionMade#   s   &&(&)<<"",,1188:HQK
 	&!=hqk*,,&&llmm "))+C"))+COOJJ
	
 	T^^,T^^,    N)__name__
__module____qualname____doc__r*    r+   r)   r   r       s
    N%-r+   r   c                       e Zd ZeZdZd Zy)InetdFactoryNc                     || _         y )N)r   )r$   r   s     r)   __init__zInetdFactory.__init__O   s	    r+   )r,   r-   r.   r   protocolr   r4   r0   r+   r)   r2   r2   K   s    HJr+   r2   )r/   r   twisted.internetr   r   r   twisted.internet.protocolr   r   twisted.protocolsr   EchoChargenDiscardDaytimeTimeinternalProtocolsr   r2   r0   r+   r)   <module>r?      sa    
 4 4 = "
 II||||||II (-H (-V= r+   