Attachment "ftpd1.2.5-bug3357765.diff" to
ticket [3357765fff]
added by
rkeene
2011-07-07 22:54:47.
diff -uNr ftpd1.2.5-orig/ftpd.tcl ftpd1.2.5-bug3357765/ftpd.tcl
--- ftpd1.2.5-orig/ftpd.tcl 2011-03-30 21:16:41.000000000 +0000
+++ ftpd1.2.5-bug3357765/ftpd.tcl 2011-07-07 15:44:23.945484922 +0000
@@ -765,6 +765,11 @@
#
if {![catch {::ftpd::Fs append $path $data(mode)} f]} {
puts $sock "150 Copy Started ($data(mode))"
+
+ if {$data(sock2) == ""} {
+ vwait ::ftpd::${sock}(sock2)
+ }
+
fcopy $data(sock2) $f -command [list ::ftpd::GetDone $sock $data(sock2) $f ""]
} else {
puts $sock "500 Copy Failed: $path $f"
@@ -1239,6 +1244,11 @@
#
if {![catch {::ftpd::Fs retr $path $data(mode)} f]} {
puts $sock "150 Copy Started ($data(mode))"
+
+ if {$data(sock2) == ""} {
+ vwait ::ftpd::${sock}(sock2)
+ }
+
fcopy $f $data(sock2) -command [list ::ftpd::GetDone $sock $data(sock2) $f ""]
} else {
puts $sock "500 Copy Failed: $path $f"
@@ -1428,6 +1438,11 @@
#
if {![catch {::ftpd::Fs store $path $data(mode)} f]} {
puts $sock "150 Copy Started ($data(mode))"
+
+ if {$data(sock2) == ""} {
+ vwait ::ftpd::${sock}(sock2)
+ }
+
fcopy $data(sock2) $f -command [list ::ftpd::GetDone $sock $data(sock2) $f ""]
} else {
puts $sock "500 Copy Failed: $path $f"
@@ -1478,6 +1493,11 @@
#
if {![catch {::ftpd::Fs store $file $data(mode)} f]} {
puts $sock "150 Copy Started ($data(mode))"
+
+ if {$data(sock2) == ""} {
+ vwait ::ftpd::${sock}(sock2)
+ }
+
fcopy $data(sock2) $f -command [list ::ftpd::GetDone $sock $data(sock2) $f $file]
} else {
puts $sock "500 Copy Failed: $path $f"
@@ -1646,6 +1666,10 @@
set path [file join $data(cwd) $filename]
+ if {$data(sock2) == ""} {
+ vwait ::ftpd::${sock}(sock2)
+ }
+
Fs dlist $path $style $data(sock2)
FinishData $sock
@@ -2019,6 +2043,9 @@
lappend ans [expr {($port >> 8) & 0xff}] [expr {$port & 0xff}]
set ans [join $ans {,}]
puts $sock "227 Entering Passive Mode ($ans)."
+
+ set data(sock2) ""
+
return
}