Home | Trees | Index | Help |
|
---|
Package twisted :: Package protocols :: Module ftp :: Class FTP |
|
Factory
--+ |ClientFactory
--+ |DTPFactory
--+ |BaseProtocol
--+ | | |Protocol
--+ | | |LineReceiver
--+ | FTP
An FTP server.
This class is unstable (it will be heavily refactored to support dynamic content, etc).Method Summary | |
---|---|
Build a new path, from a relative path based on the current wd This routine is not fully tested, and I fear that it can be exploited by building clever paths | |
Will return None if the user has been authorized This must be run in front of all commands except USER, PASS and QUIT | |
Called when a connection is made. | |
ftp_Abor(self,
params)
| |
ftp_Cdup(self,
params)
| |
ftp_Cwd(self,
params)
| |
ftp_Dele(self,
params)
| |
Request for a Extended Passive connection | |
ftp_List(self,
params)
| |
ftp_Mkd(self,
params)
| |
ftp_Nlst(self,
params)
| |
Do nothing, and reply an OK-message Sometimes used by clients to avoid a time-out. | |
Authorize the USER and the submitted password | |
Request for a passive connection | |
Request for an active connection This command may be potentially abused, and the only countermeasure so far is that no port below 1024 may be targeted. | |
ftp_Pwd(self,
params)
| |
ftp_Quit(self,
params)
| |
ftp_Retr(self,
params)
| |
ftp_Rmd(self,
params)
| |
ftp_Size(self,
params)
| |
ftp_Stor(self,
params)
| |
Return the running operating system to the client However, due to security-measures, it will return a standard 'L8' reply | |
ftp_Type(self,
params)
| |
Get the login name, and reset the session PASS is expected to follow | |
getListing(self,
params,
action)
| |
Process the input from the client | |
reply(self,
key,
s)
| |
Alias for DTP.setAction Since there's no guarantee an instance of dtp exists | |
Inherited from LineReceiver | |
Clear buffered data. | |
Protocol.dataReceived. | |
Called when the maximum line length has been reached. | |
Override this for when raw data is received. | |
Sends a line to the other end of the connection. | |
Sets the line-mode of this receiver. | |
Sets the raw mode of this receiver. | |
Inherited from Protocol | |
(Deprecated) | |
Called when the connection is shut down. | |
Inherited from BaseProtocol | |
Make a connection to a transport and a server. | |
Inherited from DTPFactory | |
Create an instance of a subclass of Protocol. | |
| |
| |
Inherited from ClientFactory | |
Called when a connection has failed. | |
Called when a connection is lost. | |
Called when a connection has been started. | |
Inherited from Factory | |
Make sure startFactory is called. | |
Make sure stopFactory is called. | |
This will be called before I begin listening on a Port or Connector. | |
This will be called before I stop listening on all Ports/Connectors. |
Class Variable Summary | |
---|---|
int |
debug = 0 |
NoneType |
passwd = None |
NoneType |
peerhost = None |
NoneType |
peerport = None |
NoneType |
queuedfile = None |
NoneType |
root = None |
NoneType |
type = None |
NoneType |
user = None |
NoneType |
wd = None |
Inherited from LineReceiver | |
str |
_LineReceiver__buffer = ''
|
str |
delimiter : The line-ending delimiter to use. |
int |
line_mode = 1 |
int |
MAX_LENGTH : The maximum length of a line to allow (If a sent line is longer than
this, the connection is dropped). |
Inherited from Protocol | |
tuple |
__implements__ = (<class twisted.internet.interfaces.IPr...
|
Inherited from BaseProtocol | |
int |
connected = 0 |
NoneType |
transport = None |
Inherited from DTPFactory | |
NoneType |
action = None |
NoneType |
dtp = None |
NoneType |
dtpPort = None |
Inherited from Factory | |
str |
noisy = 'sure, why not'
|
int |
numPorts = 0 |
NoneType |
protocol = None |
Method Details |
---|
buildFullpath(self, rpath)Build a new path, from a relative path based on the current wd This routine is not fully tested, and I fear that it can be exploited by building clever paths |
checkauth(self)Will return None if the user has been authorized This must be run in front of all commands except USER, PASS and QUIT |
connectionMade(self)Called when a connection is made. This may be considered the initializer of the protocol, because it is called when the connection is completed. For clients, this is called once the connection to the server has been established; for servers, this is called after an accept() call stops blocking and a socket has been received. If you need to send any greeting or initial message, do it here.
|
ftp_Epsv(self, params)Request for a Extended Passive connection |
ftp_Noop(self, params)Do nothing, and reply an OK-message Sometimes used by clients to avoid a time-out. TODO: Add time-out, let Noop extend this time-out. Add a No-Transfer-Time-out as well to get rid of idlers. |
ftp_Pass(self, params)Authorize the USER and the submitted password |
ftp_Pasv(self, params)Request for a passive connection |
ftp_Port(self, params)Request for an active connection This command may be potentially abused, and the only countermeasure so far is that no port below 1024 may be targeted. An extra approach is to disable port'ing to a third-party ip, which is optional through ALLOW_THIRDPARTY. Note that this disables 'Cross-ftp' |
ftp_Syst(self, params)Return the running operating system to the client However, due to security-measures, it will return a standard 'L8' reply |
ftp_User(self, params)Get the login name, and reset the session PASS is expected to follow |
lineReceived(self, line)Process the input from the client |
setAction(self, action)Alias for DTP.setAction Since there's no guarantee an instance of dtp exists |
Class Variable Details |
---|
debug
|
passwd
|
peerhost
|
peerport
|
queuedfile
|
root
|
type
|
user
|
wd
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.0 on Sat Oct 25 00:55:07 2003 | http://epydoc.sf.net |