Skip to content
Snippets Groups Projects
Commit 3b989049 authored by rswindell's avatar rswindell
Browse files

If the nopen() call fails for sending a file (it's already open in an

incompatible share mode, probably by FDSZ/CEXYZ), then re-attempt the open
using fopen (shareable open).
parent 3e145818
No related branches found
No related tags found
No related merge requests found
...@@ -1382,7 +1382,8 @@ static void send_thread(void* arg) ...@@ -1382,7 +1382,8 @@ static void send_thread(void* arg)
length=flength(xfer.filename); length=flength(xfer.filename);
if((fp=fnopen(NULL,xfer.filename,O_RDONLY|O_BINARY))==NULL) { /* was fopen(...,"rb") */ if((fp=fnopen(NULL,xfer.filename,O_RDONLY|O_BINARY))==NULL /* non-shareable open failed */
&& (fp=fopen(xfer.filename,"rb"))==NULL) { /* shareable open failed */
lprintf(LOG_ERR,"%04d !DATA ERROR %d opening %s",xfer.ctrl_sock,errno,xfer.filename); lprintf(LOG_ERR,"%04d !DATA ERROR %d opening %s",xfer.ctrl_sock,errno,xfer.filename);
sockprintf(xfer.ctrl_sock,"450 ERROR %d opening %s.",errno,xfer.filename); sockprintf(xfer.ctrl_sock,"450 ERROR %d opening %s.",errno,xfer.filename);
if(xfer.tmpfile && !(startup->options&FTP_OPT_KEEP_TEMP_FILES)) if(xfer.tmpfile && !(startup->options&FTP_OPT_KEEP_TEMP_FILES))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment