HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/twisted/runner/__pycache__/inetdconf.cpython-38.pyc
U

��W[5�@s�dZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGd	d
�d
�ZGdd�d�ZGd
d�de�ZGdd�de�Z	dS)z
Parser for inetd.conf files
c@seZdZdZdS)�InvalidConfErrorz$
    Invalid configuration file
    N��__name__�
__module__�__qualname__�__doc__�rr�:/usr/lib/python3/dist-packages/twisted/runner/inetdconf.pyr
src@seZdZdZdS)�InvalidInetdConfErrorz!
    Invalid inetd.conf file
    Nrrrrrr	sr	c@seZdZdZdS)�InvalidServicesConfErrorz
    Invalid services file
    Nrrrrrr
sr
c@seZdZdZdS)�UnknownServicez
    Unknown service name
    Nrrrrrrsrc@s2eZdZdZdZdZd
dd�Zdd�Zdd	�ZdS)�SimpleConfFilez�
    Simple configuration file parser superclass.

    Filters out comments and empty lines (which includes lines that only
    contain comments).

    To use this class, override parseLine or parseFields.
    �#NcCs�d}|dkr"|jr"t|jd�}d}zJ|��D]<}|�|j�}|dkrP|d|�}|��}|s^q,|�|�q,W5|rz|��XdS)z�
        Parse a configuration file

        If file is None and self.defaultFilename is set, it will open
        defaultFilename and use it.
        FN�rT���)�defaultFilename�open�close�	readlines�find�commentChar�strip�	parseLine)�self�filer�lineZcommentrrr�	parseFile3szSimpleConfFile.parseFilecCs<z|j|���Wn$tk
r6tdt|���YnXdS)z�
        Override this.

        By default, this will split the line on whitespace and call
        self.parseFields (catching any errors).
        zInvalid line: N)�parseFields�split�
ValueErrorr	�repr)rrrrrrSszSimpleConfFile.parseLinecGsdS)z 
        Override this.
        Nr)rZfieldsrrrr`szSimpleConfFile.parseFields)N)	rrrrrrrrrrrrrr&s	
 
rc@s<eZdZdZdZdZdZdZdZdZ	dZ
dZdZdd�Z
dS)�InetdServicez3
    A simple description of an inetd service.
    Nc

Cs:||_||_||_||_||_||_||_||_|	|_dS�N)	�name�port�
socketType�protocol�wait�user�group�program�programArgs)
rr"r#r$r%r&r'r(r)r*rrr�__init__uszInetdService.__init__)rrrrr"r#r$r%r&r'r(r)r*r+rrrrr gsr c@s&eZdZdZdZddd�Zdd�ZdS)	�	InetdConfz>
    Configuration parser for a traditional UNIX inetd(8)
    z/etc/inetd.confNcCs&g|_|dkrt�}|��||_dSr!)�services�ServicesConfr�
knownServices)rr/rrrr+�s
zInetdConf.__init__c
Gs�|�d�dgdd�\}}|jj�||fd�}	|	sl|�d�slzt|�}	d}Wntd||f��YnX|j�t||	|||||||�	�dS)zx
        Parse an inetd.conf file.

        Implemented from the description in the Debian inetd.conf man page.
        �.N�zrpc/�unknownzUnknown service: %s (%s))	rr/r-�get�
startswith�intr�appendr )
rZserviceNamer$r%r&r'r)r*r(r#rrrr�s&��zInetdConf.parseFields)N�rrrrrr+rrrrrr,�s
	r,c@s$eZdZdZdZdd�Zdd�ZdS)r.zj
    /etc/services parser

    @ivar services: dict mapping service names to (port, protocol) tuples.
    z
/etc/servicescCs
i|_dSr!)r-)rrrrr+�szServicesConf.__init__cGsdz|�d�\}}t|�}Wntdt|�f��YnX||j||f<|D]}||j||f<qLdS)N�/zInvalid port/protocol: %s)rr5r
rr-)rr"ZportAndProtocol�aliasesr#r%�aliasrrrr�s�
zServicesConf.parseFieldsNr7rrrrr.�sr.N)
r�	Exceptionrr	r
rrr r,r.rrrr�<module>sA,