Package: twoftpd
Version: 1.41-1
Tags: patch
When executing LIST on a non-existing file, twoftpd answers "550 Could not access
file" AND opens data connection which contains no data. This behavior violates FTP
protocol and breaks some clients.
Proposed patch:
--- a/list.c
+++ b/list.c
@@ -272,7 +272,7 @@
static int handle_listing(int longfmt)
{
- int result;
+ //int result;
struct stat statbuf;
long count;
int striplen;
@@ -328,10 +328,10 @@
return respond_internal_error();
if (stat(entries.s, &statbuf) == -1) {
- if (errno == EEXIST)
- result = respond(550, 1, "File or directory does not exist.");
+ if (errno == ENOENT)
+ return respond(550, 1, "File or directory does not exist.");
else
- result = respond(550, 1, "Could not access file.");
+ return respond(550, 1, "Could not access file.");
}
else if (S_ISDIR(statbuf.st_mode)) {
if (!str_copys(&fullpath, "/") ||
--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org