Allow ftp server alternate replies to contain backslash-escaped control

characters.
This commit is contained in:
Dan Fandrich
2007-08-23 23:24:39 +00:00
parent bc0adcef1f
commit 9537580ba2
2 changed files with 4 additions and 4 deletions

View File

@@ -90,7 +90,8 @@ Special-commands for the server.
For FTP, these are supported: For FTP, these are supported:
REPLY [command] [return value] [response string] REPLY [command] [return value] [response string]
- Changes how the server responds to the [command] - Changes how the server responds to the [command]. [response string] is
evaluated as a perl string, so it can contain embedded \r\n, for example.
COUNT [command] [num] COUNT [command] [num]
- Do the REPLY change for [command] only [num] times and then go back to the - Do the REPLY change for [command] only [num] times and then go back to the
built-in approach built-in approach

View File

@@ -677,14 +677,13 @@ my %customreply;
my %customcount; my %customcount;
my %delayreply; my %delayreply;
sub customize { sub customize {
undef %customreply;
$nosave = 0; # default is to save as normal $nosave = 0; # default is to save as normal
$controldelay = 0; # default is no delaying the responses $controldelay = 0; # default is no delaying the responses
$retrweirdo = 0; $retrweirdo = 0;
$retrnosize = 0; $retrnosize = 0;
$pasvbadip = 0; $pasvbadip = 0;
$nosave = 0; $nosave = 0;
%customreply = ();
%customcount = (); %customcount = ();
%delayreply = (); %delayreply = ();
@@ -695,7 +694,7 @@ sub customize {
while(<CUSTOM>) { while(<CUSTOM>) {
if($_ =~ /REPLY ([A-Z]+) (.*)/) { if($_ =~ /REPLY ([A-Z]+) (.*)/) {
$customreply{$1}=$2; $customreply{$1}=eval "qq{$2}";
logmsg "FTPD: set custom reply for $1\n"; logmsg "FTPD: set custom reply for $1\n";
} }
if($_ =~ /COUNT ([A-Z]+) (.*)/) { if($_ =~ /COUNT ([A-Z]+) (.*)/) {