Fix a "sockfilt" leak. When a new 'data' connection sockfilt server is started,
make sure that a previously used one is killed first (since they re-use the same .pid file etc)
This commit is contained in:
parent
1128029599
commit
ef66497a0d
@ -521,10 +521,17 @@ sub STOR_command {
|
|||||||
sub PASV_command {
|
sub PASV_command {
|
||||||
my ($arg, $cmd)=@_;
|
my ($arg, $cmd)=@_;
|
||||||
my $pasvport;
|
my $pasvport;
|
||||||
|
my $pidf=".sockdata$ftpdnum$ext.pid";
|
||||||
|
|
||||||
|
my $prev = checkserver($pidf);
|
||||||
|
if($prev > 0) {
|
||||||
|
print "kill existing server: $prev\n" if($verbose);
|
||||||
|
kill(9, $prev);
|
||||||
|
}
|
||||||
|
|
||||||
# We fire up a new sockfilt to do the data tranfer for us.
|
# We fire up a new sockfilt to do the data tranfer for us.
|
||||||
$slavepid = open2(\*DREAD, \*DWRITE,
|
$slavepid = open2(\*DREAD, \*DWRITE,
|
||||||
"./server/sockfilt --port 0 --logfile log/sockdata$ftpdnum$ext.log --pidfile .sockdata$ftpdnum$ext.pid $ipv6");
|
"./server/sockfilt --port 0 --logfile log/sockdata$ftpdnum$ext.log --pidfile $pidf $ipv6");
|
||||||
|
|
||||||
print DWRITE "PING\n";
|
print DWRITE "PING\n";
|
||||||
my $pong;
|
my $pong;
|
||||||
@ -662,6 +669,7 @@ sub PORT_command {
|
|||||||
logmsg "Failed sockfilt for data connection\n";
|
logmsg "Failed sockfilt for data connection\n";
|
||||||
kill(9, $slavepid);
|
kill(9, $slavepid);
|
||||||
}
|
}
|
||||||
|
|
||||||
logmsg "====> Client DATA connect to port $port\n";
|
logmsg "====> Client DATA connect to port $port\n";
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user