From: sgunderson Date: Wed, 16 Aug 2000 21:03:23 +0000 (+0000) Subject: Report "File not found" etc. instead of just "Not a plain file" (contrary to traditio... X-Git-Url: https://git.sesse.net/?p=betaftpd;a=commitdiff_plain;h=00bc8103dc2171defe1f3d05d9c94bf57a84d41c Report "File not found" etc. instead of just "Not a plain file" (contrary to traditional FTP daemons). --- diff --git a/cmds.c b/cmds.c index 64e4c1a..3af02a3 100644 --- a/cmds.c +++ b/cmds.c @@ -1745,9 +1745,9 @@ int do_openfile(struct conn * const c, char * const path, #if WANT_UPLOAD if ((flags & O_CREAT) == 0) { #endif - stat(ptr, &buf); + TRAP_ERROR(stat(ptr, &buf) == -1, 550, return -2); if (!S_ISREG(buf.st_mode)) { - numeric(c, 550, "%s: Not a plain file.", ptr); + numeric(c, 550, "Not a plain file.", ptr); return -2; } #if WANT_UPLOAD