pure-ftpd fails on download

Hi,

I tried the binary as well as the source of pure-ftpd from the
Third-Party CD, but it failes when I download a file. Uploading goed
fine.
In file ftpd.c line 2679 mmap on the file descriptor returns -1;
perror(“mmap:”) tells me:
mmap: Not supported
The uid=0 so it’s not a permission problem.
I am using QNX 6.2.
Did anyone solve this ?

Thanks,
Pim

Hello, pimb!

p> I tried the binary as well as the source of pure-ftpd from the
p> Third-Party CD, but it failes when I download a file. Uploading goed
p> fine.
p> In file ftpd.c line 2679 mmap on the file descriptor returns -1;
p> perror(“mmap:”) tells me:
p> mmap: Not supported
p> The uid=0 so it’s not a permission problem.
p> I am using QNX 6.2.
p> Did anyone solve this ?

Do not use mmap in file mapping (that’s the best solution), or pass the
MAP_NOSYNCFILE to mmap (But memory will not be synced to file). With this
flag you will able to read file from memory, but not to write to that
memory, in which file was mapped. In case of write you’ll get SEGFAULT.

With best regards, Mike Gorchak. E-mail: mike@malva.com.ua

I found the solution in another topic:
http://www.openqnx.com/PNphpBB2-viewtopic-t1906-.html

I had to use the undocumented flag MMAP_NOSYNCFILE for the mmap call.

CU
Pim

Mike Gorchakwrote:

Do not use mmap in file mapping (that’s the best solution), or pass
the
MAP_NOSYNCFILE to mmap (But memory will not be synced to file).
With this
flag you will able to read file from memory, but not to write to
that
memory, in which file was mapped. In case of write you’ll get
SEGFAULT.

With best regards, Mike Gorchak. E-mail: > mike@malva.com.ua

Thanks Mike,

I posted my solution before checking for a reply :slight_smile:
pure-ftpd is only reading the file with mmap so that should be no
problem.

Pim