[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Net::FTPServer] NetFTPServer - BugFix - New Features - request for feed
From: |
Yair Lenga |
Subject: |
[Net::FTPServer] NetFTPServer - BugFix - New Features - request for feedback |
Date: |
Fri, 10 Oct 2003 11:17:30 -0400 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 |
Greetings,
We have recenetly deployed Net-FTPServer. During the deployment we made
several changes to the code to make the server more friendly with agressive
firewalls and FTP clients. I would like to commit those changes back into
future releases. Attached below is a summary of changes. I will appreciate any
feedback. I have sent separate email regarding some of the issues in the past 2
months - I apologize the the duplication.
I have all the code changes ready for submission. I hope that all the changes
are acceptable.
Thanks,
Yair
- High Priority items - bugs
1. Fix MDTM to use GMTIME.
The proposed FTP extension
http://www.ietf.org/internet-drafts/draft-ietf-ftpext-mlst-16.txt, section 3.4 (MDTM
example) specified "The times are in GMT, ... The
location where the file was modified, and consequently the local wall clock time at
that location, is not available.". To make the code comply with the spec, a
change in _MDTM_command as follows:
6630c6635
< my $fmt_time = strftime "%Y%m%d%H%M%S", localtime ($time);
---
> my $fmt_time = strftime "%Y%m%d%H%M%S", gmtime ($time);
2. Binding to service name under chroot.
When Net::FTPServer is chroot-ing to the user home directory, it is
currently not possible to use service name to specify the port to bind -
when the /etc/services files was used. The suggested solution (other
than using service numbers), is to remember the translated port number
(config option "ftp data port") - in the _drop_privs procedure) in the
server object: (line ~4727), and use it in _PASV_command and
open_data_connection.
($self->{ftpdataport} = scalar getservbyname($ftpdata,"tcp"))) >= 1024
3. Binding to specific interface card.
When Net::FTPServer is running on a server with multiple network cards -
with active connection - it will create the data connection without
specifying "localAddr" - creating the connection on the first available
address. If the FTP client can only access the second interface, it will
not be able to setup the data connection. The bug fix is to add to
missing LocalAddr to open_data_connection (line ~7300, and line ~7312)
LocalAddr => $self->{sockaddrstring},
4. Symbolic links to directories:
Net::FTPServer will die when trying to access a symbolic link to a
directory. This is caused because Net/FTPServer/Full/DirHandle is using
'stat' in the get method, and lstat in the 'status' method - causing
inconsisnt handling of those links. The solution is to use lstat in the
'get' method (line ~82).
- New Features:
1. Allow date components (%Y, %d, ...) to be used in the 'error' and
'xfer' logging.
This option will allow the log files to include %Y, %m, ... to create
date base log files. This is similar to ncftpd. The implementation is to
use the following simple functions to resolve a file name. The code was
also changed to make check if the log file has to be switched when
running the server in deamon mode.
sub resolve_log_file_name {
my ($self, $log_file) = @_ ;
$log_file =~ s/\$(\w+)/$self->{$1}/g
if $log_file =~ /\$/ ;
$log_file = strftime($log_file, localtime())
if $log_file =~ /\%/ ;
return $log_file;
}
2. Controllable delay for unauthenticate user.
This option allow us to disable the 5 seconds delay for unathorized
access. The server can be access from other applications that are hosted
on our own server. For certain hosts, the delay is not required.
3. Easier subclassing
Extending the server to use new "personality" require simple
implementation of the 'root_directory_hook' method. However, extending
the existing DirHandle module (i.e. Full/DirHandle.pm) require complete
reimplemnation of the get method. The proposed change will add a new
'file_handle_hook' that will be used to create instances of file
handles. With this change, there will be no need to hard code the
'Net::FTPServer::Full::DirHandle' classes in the DirHandle module.
Instead the code will look like:
sub get {
# find out if we need to have a directory or file object
if ( directory object) {
return $self->new(...)
} else {
return $self->ftps->file_handle_hook(...)
}
}
--
Yair Lenga
Vice President
The Yield Book
Phone: 212-816-7468
Fax: 212-816-7766
Email: address@hidden
Citigroup Global Markets Inc.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Net::FTPServer] NetFTPServer - BugFix - New Features - request for feedback,
Yair Lenga <=