
    \d                         d Z ddlZddlmZ ddlmZmZmZ ddlm	Z	 ddl
mZmZmZ  G d dej        ej                  Zd	 ZdS )
z>
I am the support module for making a ftp server with twistd.
    N)internet)checkersportalstrcred)ftp)	deprecateusageversionsc                   |    e Zd ZdZg dg dg dgZ ej        d ej        d          i          Zd	Z	d
 Z
d ZdS )OptionszP[options].
    WARNING: This FTP server is probably INSECURE do not use it.
    )portp2121zset the port number)rootrz/usr/local/ftpz define the root of the ftp-site.)userAnonymous 	anonymouszName of the anonymous user.r   zroot of the ftp site)descr)
optActionsr   c                     t          j        j        | g|R i | |                     t	          j                               d S )N)r	   r   __init__
addCheckerr   AllowAnonymousAccess)selfakws      /lib/python3.11/site-packages/twisted/tap/ftp.pyr   zOptions.__init__"   sF    t.a...2...57788888    c           	          || d<   t          j        | j        t          j        dddd                    }t          j        |t          d           |                     t          j
        |d	                     d
S )z
        Specify a file containing username:password login info for
        authenticated connections. (DEPRECATED; see --help-auth instead)
        zpassword-fileTwisted      r      )category
stacklevelT)cacheN)r   getDeprecationWarningStringopt_password_filer
   VersionwarningswarnDeprecationWarningr   r   FilePasswordDB)r   filenamemsgs      r   r)   zOptions.opt_password_file&   s{    
 !)_3"H$4YAq$I$I
 
 	c$61EEEE/EEEFFFFFr   N)__name__
__module____qualname__synopsisoptParametersr	   CompletionsCompleteDirscompDatalongdescr   r)    r   r   r   r      s        H 	544KKKIIIM !u .E.5KLLLM  H H9 9 9
G 
G 
G 
G 
Gr   r   c                    t          j                    }t          j        | d                   }t          j        ||                     dg                     }| d         |_        | d         |_        ||_        t           j        |_	        	 t          | d                   }n# t          $ r d}Y nw xY wt          j        ||          S )Nr   credCheckersr   r   iI  )r   
FTPFactoryFTPRealmr   Portalgettldr   FTPprotocolintKeyErrorr   	TCPServer)configfr   r   portnos        r   makeServicerJ   3   s    AVF^$$AaNB7788A6NAE_-AOAHAJVF^$$   fa(((s   
B   B/.B/)__doc__r+   twisted.applicationr   twisted.credr   r   r   twisted.protocolsr   twisted.pythonr   r	   r
   r   AuthOptionMixinrJ   r:   r   r   <module>rQ      s      ( ( ( ( ( ( 2 2 2 2 2 2 2 2 2 2 ! ! ! ! ! ! 5 5 5 5 5 5 5 5 5 5G G G G GemW4 G G GB) ) ) ) )r   