1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-25 11:37:56 +00:00

Let real users access special files through FTP

if allowed by their filesystem permissions.

This doesn't break anything since using sendfile(2)
is triggered later by a separate S_ISREG conditional.

PR:		bin/20824
MFC after:	1 week
This commit is contained in:
Yaroslav Tykhiy 2003-01-31 13:18:55 +00:00
parent 5654cc45c0
commit ea7012261a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=110144

View File

@ -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) {