diff options
| author | Yaroslav Tykhiy <ytykhiy@gmail.com> | 2003-01-31 13:18:55 +0000 |
|---|---|---|
| committer | Yaroslav Tykhiy <ytykhiy@gmail.com> | 2003-01-31 13:18:55 +0000 |
| commit | ea7012261a25bd6460ea44fcadb0eb130c77432a (patch) | |
| tree | c3af2c8ef31e3273def6a99bd478871a3b7af89e | |
| parent | 5654cc45c092c6e422972f8f802f5a47e5d8b1e1 (diff) | |
Notes
| -rw-r--r-- | libexec/ftpd/ftpd.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index cf7d73de2a14..477102aa448f 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -1663,9 +1663,19 @@ retrieve(char *cmd, char *name) return; } byte_count = -1; - if (cmd == 0 && (fstat(fileno(fin), &st) < 0 || !S_ISREG(st.st_mode))) { - reply(550, "%s: not a plain file.", name); - goto done; + if (cmd == 0) { + if (fstat(fileno(fin), &st) < 0) { + perror_reply(550, name); + goto done; + } + if (!S_ISREG(st.st_mode)) { + if (guest) { + reply(550, "%s: not a plain file.", name); + goto done; + } + st.st_size = -1; + /* st.st_blksize is set for all descriptor types */ + } } if (restart_point) { if (type == TYPE_A) { |
