diff options
Diffstat (limited to 'cpukit/ftpd')
-rw-r--r-- | cpukit/ftpd/ftpd.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cpukit/ftpd/ftpd.c b/cpukit/ftpd/ftpd.c index 51fd93f428..f6895754ca 100644 --- a/cpukit/ftpd/ftpd.c +++ b/cpukit/ftpd/ftpd.c @@ -795,6 +795,7 @@ command_retrieve(FTPD_SessionInfo_t *info, char const *filename) int s = -1; int fd = -1; char buf[FTPD_DATASIZE]; + struct stat stat_buf; int res = 0; if(!can_read()) @@ -809,6 +810,14 @@ command_retrieve(FTPD_SessionInfo_t *info, char const *filename) return; } + if (fstat(fd, &stat_buf) == 0 && S_ISDIR(stat_buf.st_mode)) + { + if (-1 != fd) + close(fd); + send_reply(info, 550, "Is a directory."); + return; + } + send_mode_reply(info); s = data_socket(info); |