diff options
author | des <des@FreeBSD.org> | 2000-07-17 22:24:52 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2000-07-17 22:24:52 +0000 |
commit | 08cda657c6683350a43523d22d85bbfdcc961c8f (patch) | |
tree | b05684e251de1e97a0641c64bed64da763937e9b /libexec | |
parent | 6bedb18bdeb3ac332b16725982da5de730a11117 (diff) | |
download | FreeBSD-src-08cda657c6683350a43523d22d85bbfdcc961c8f.zip FreeBSD-src-08cda657c6683350a43523d22d85bbfdcc961c8f.tar.gz |
Don't reply "not a plain file" when the requested file doesn't exist.
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/ftpd/ftpcmd.y | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libexec/ftpd/ftpcmd.y b/libexec/ftpd/ftpcmd.y index bb5bff9..9e34221 100644 --- a/libexec/ftpd/ftpcmd.y +++ b/libexec/ftpd/ftpcmd.y @@ -1481,7 +1481,9 @@ sizecmd(filename) case TYPE_L: case TYPE_I: { struct stat stbuf; - if (stat(filename, &stbuf) < 0 || !S_ISREG(stbuf.st_mode)) + if (stat(filename, &stbuf) < 0) + perror_reply(550, filename); + else if (!S_ISREG(stbuf.st_mode)) reply(550, "%s: not a plain file.", filename); else reply(213, "%qu", stbuf.st_size); @@ -1496,7 +1498,11 @@ sizecmd(filename) perror_reply(550, filename); return; } - if (fstat(fileno(fin), &stbuf) < 0 || !S_ISREG(stbuf.st_mode)) { + if (fstat(fileno(fin), &stbuf) < 0) { + perror_reply(550, filename); + (void) fclose(fin); + return; + } else if (!S_ISREG(stbuf.st_mode)) { reply(550, "%s: not a plain file.", filename); (void) fclose(fin); return; |