Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback for local address returned by the server for PASV #5763

Closed
cyberduck opened this issue Mar 10, 2011 · 14 comments
Closed

Fallback for local address returned by the server for PASV #5763

cyberduck opened this issue Mar 10, 2011 · 14 comments
Assignees
Labels
bug fixed ftp FTP Protocol Implementation
Milestone

Comments

@cyberduck
Copy link
Collaborator

0da2740 created the issue

After upgrading on 4.xx (4.01 and 4.02) version my ftp stuck every time on directory listing and after while Operation timed out error (regular ftp and ftp-tls). On 3.8.1 version everything is working fine.
Here is log:

220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 2 of 5 allowed.
220-Local time is now 13:23. Server port: 21.
220 You will be disconnected after 10 minutes of inactivity.
AUTH TLS
234 AUTH TLS OK.
USER gost
331 User gost OK. Password required
PASS ********
230 OK. Current restricted directory is /
PBSZ 0
200 PBSZ=0
PROT P
200 Data protection level set to "private"
FEAT
211-Extensions supported:
 EPRT
 IDLE
 MDTM
 SIZE
 REST STREAM
 MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;
 MLSD
 ESTP
 PASV
 EPSV
 SPSV
 ESTA
 AUTH TLS
 PBSZ
 PROT
 UTF8
211 End.
OPTS UTF8 ON
200 OK, UTF-8 enabled
PWD
257 "/" is your current location
NOOP
200 Zzz...
SYST
215 UNIX Type: L8
CWD /
250 OK. Current directory is /
TYPE A
200 TYPE is now ASCII
PASV
227 Entering Passive Mode (192,168,100,51,27,100)
@cyberduck
Copy link
Collaborator Author

0da2740 commented

here is log with working 3.8.1:

220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 1 of 5 allowed.
220-Local time is now 13:52. Server port: 21.
220 You will be disconnected after 10 minutes of inactivity.
AUTH TLS
234 AUTH TLS OK.
USER gost
331 User gost OK. Password required
PASS ********
230 OK. Current restricted directory is /
PBSZ 0
200 PBSZ=0
PROT P
200 Data protection level set to "private"
FEAT
211-Extensions supported:
 EPRT
 IDLE
 MDTM
 SIZE
 REST STREAM
 MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;
 MLSD
 ESTP
 PASV
 EPSV
 SPSV
 ESTA
 AUTH TLS
 PBSZ
 PROT
 UTF8
211 End.
OPTS UTF8 ON
200 OK, UTF-8 enabled
PWD
257 "/" is your current location
NOOP
200 Zzz...
SYST
215 UNIX Type: L8
STAT /
213-STAT
drwxr-xr-x    2 0          0                1024 Mar 10 08:59 .
drwxr-xr-x    2 0          0                1024 Mar 10 08:59 ..
drwxrwxrwx    1 0          0                  20 Mar 10 08:59 public
213 End.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Default back to use STAT in 4e127d9. There is still a configuration issue with this server advertising a local adress for the passive data connection. File transfers will possibly fail.

@cyberduck
Copy link
Collaborator Author

0da2740 commented

ftp server is behind DynDNS service, and it's working fine with 3.8.1 - no problems with download/upload files.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Replying to [comment:4 g0ran]:

ftp server is behind DynDNS service, and it's working fine with 3.8.1 - no problems with download/upload files.

It might work. If the server returns a local network address such as above in reply to PASV and you have connected to a non local address, it will ignore the address and use the address you connected to initially.

@cyberduck
Copy link
Collaborator Author

0da2740 commented

I upgraded to (8537) and it is partially working. I now can access listing and some dirs but some stucks again.

STAT /Volume_1
213-STAT
drwxrwxrwx   16 0          0                4096 Mar 10 14:37 .
drwxr-xr-x    2 0          0                1024 Mar 10 14:32 ..
drwx------    3 0          0                4096 Mar  9 20:30 .systemfile
drwxr-xr-x    5 501        allaccount       4096 Mar 10 08:58 .transmission-daemon
drwxrwxrwx    3 0          0                4096 Mar  9 16:37 Ajaxpf
drwxrwxrwx    2 501        allaccount       4096 Mar  9 20:31 DNS-320 files
drwxrwxrwx    2 501        allaccount       4096 Mar 10 14:41 Download
drwxrwxrwx    5 goran      allaccount       4096 Mar  9 22:30 GPS
drwx------    2 501        allaccount       4096 Mar  9 16:37 Nas_Prog
drwxrwxrwx    4 goran      allaccount       4096 Mar  9 23:25 backup
drwxr-xr-x   16 0          0                4096 Feb  8 22:58 ffp
-rw-r--r--    1 0          0                7062 Mar 10 08:58 ffp.log
drwxrwsrwx   10 501        allaccount       4096 Mar  9 22:39 filmovi
-rwxrwxrwx    1 goran      allaccount       1790 Mar  2 20:03 fun_plug
-rwxrwxrwx    1 501        allaccount        569 Sep 21 21:34 fun_plug.debian
-rwxrwxrwx    1 501        allaccount       1790 Mar  2 20:03 fun_plug.ffp
drwxrwxrwx   16 501        allaccount       4096 Mar  6 21:07 iTunes
drwxrwxrwx    2 501        allaccount       4096 Mar 10 14:45 public
drwxr-xr-x   20 0          0                4096 Mar  4 00:42 squeeze
drwxr-xr-x    5 0          0                4096 Mar  4 16:06 transmission-daemon
213 End.
NOOP
200 Zzz...
STAT /Volume_1/public
213-STAT
drwxrwxrwx    2 501        allaccount       4096 Mar 10 14:45 .
drwxrwxrwx    1 0          0                  13 Mar 10 14:32 ..
-rwxrwxrwx    1 goran      allaccount       1865 Mar 27  2010 goran.jpg
213 End.
NOOP
200 Zzz...
STAT /Volume_1/Download
213-STAT
drwxrwxrwx    2 501        allaccount       4096 Mar 10 14:41 .
drwxrwxrwx    1 0          0                  13 Mar 10 14:32 ..
213 End.
CWD /Volume_1/Download
250 OK. Current directory is /Volume_1/Download
TYPE A
200 TYPE is now ASCII
PASV
227 Entering Passive Mode (192,168,100,51,27,99)

@cyberduck
Copy link
Collaborator Author

0da2740 commented

I just checked in local network and everything is working fine. It seems that there is an issue with "..it will ignore the address and use the address you connected to initially." I tried also with some other clients and ftp from terminal and server is responding Passive mode is OK.
Filezilla (working) responds with:

Response:	227 Entering Passive Mode (192,168,100,51,27,105)
Status:	Server sent passive reply with unroutable address. Using server address instead.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

When STAT does not return any file we also request a directory listing with LIST for interoperability reasons (some servers do not send anything meaninful for STAT). LIST does need a seperate data connection for the transfer.

The log message from Filezilla is the same what I suggested above what Cyberduck would do as well but was indeed not previuosly the case. Not trust the local address returned by the server for PASV. I have fixed this with 05d3f6a.

@cyberduck
Copy link
Collaborator Author

0da2740 commented

Thank you, you are really great (and extremely fast). I am almost embarrassed to bother you more but I now noticed one more issue - in one moment after uploading file and disconnecting on next session I can't delete/move/rename file.

STAT /Volume_1/Download
213-STAT
drwxrwxrwx    2 501        allaccount       4096 Mar 10 17:48 .
drwxrwxrwx    1 0          0                  13 Mar 10 14:32 ..
-rwxrwxrwx    1 goran      allaccount       1865 Mar 10 17:48 goran.jpg
213 End.
NOOP
200 Zzz...
DELE /Volume_1/Download/goran.jpg
550 Anonymous users can not delete files

I don't think that I'm anonymous (anonymous is disabled) and permissions are right. ;)
It somehow thinks that I'm anonymous user.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Replying to [comment:9 g0ran]:

Thank you, you are really great (and extremely fast). I am almost embarrassed to bother you more but I now noticed one more issue - in one moment after uploading file and disconnecting on next session I can't delete/move/rename file.

STAT /Volume_1/Download
213-STAT
drwxrwxrwx    2 501        allaccount       4096 Mar 10 17:48 .
drwxrwxrwx    1 0          0                  13 Mar 10 14:32 ..
-rwxrwxrwx    1 goran      allaccount       1865 Mar 10 17:48 goran.jpg
213 End.
NOOP
200 Zzz...
DELE /Volume_1/Download/goran.jpg
550 Anonymous users can not delete files

I don't think that I'm anonymous (anonymous is disabled) and permissions are right. ;)
It somehow thinks that I'm anonymous user.

That is most certainly a bug with the server. Please contact the vendor.

@cyberduck
Copy link
Collaborator Author

0da2740 commented

I don't think so. It just happens with Cyberduck. I tried several Mac and Win clients and also terminal ftp on Mac and Debian. Everywhere else works without any issues.
I now receive error "553 Users may not upload files." and "550 Sorry, users are not allowed to create directories". version (8542)
With 3.8.1 everything works as it should.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Replying to [comment:11 g0ran]:

I don't think so. It just happens with Cyberduck. I tried several Mac and Win clients and also terminal ftp on Mac and Debian. Everywhere else works without any issues.
I now receive error "553 Users may not upload files." and "550 Sorry, users are not allowed to create directories". version (8542)
With 3.8.1 everything works as it should.

Can you again post both the working and non-working transcripts.

@cyberduck
Copy link
Collaborator Author

0da2740 commented

3.8.1 (working everything ex. upload and mkdir):

220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 1 of 5 allowed.
220-Local time is now 08:49. Server port: 21.
220 You will be disconnected after 10 minutes of inactivity.
AUTH TLS
234 AUTH TLS OK.
USER gost
331 User gost OK. Password required
PASS ********
230 OK. Current restricted directory is /
PBSZ 0
200 PBSZ=0
PROT P
200 Data protection level set to "private"
FEAT
211-Extensions supported:
 EPRT
 IDLE
 MDTM
 SIZE
 REST STREAM
 MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;
 MLSD
 ESTP
 PASV
 EPSV
 SPSV
 ESTA
 AUTH TLS
 PBSZ
 PROT
 UTF8
211 End.
OPTS UTF8 ON
200 OK, UTF-8 enabled
PWD
257 "/" is your current location
NOOP
200 Zzz...
SYST
215 UNIX Type: L8
STAT /
213-STAT
drwxr-xr-x    2 0          0                1024 Mar 10 23:55 .
drwxr-xr-x    2 0          0                1024 Mar 10 23:55 ..
drwxrwxrwx    1 0          0                  20 Mar 10 23:55 public
213 End.
NOOP
200 Zzz...
CWD /public
250 OK. Current directory is /public
STAT /public
213-STAT
drwxrwxrwx    2 501        allaccount       4096 Mar 10 14:45 .
drwxr-xr-x    2 0          0                1024 Mar 10 23:55 ..
-rwxrwxrwx    1 1007       allaccount       1865 Mar 27  2010 goran.jpg
213 End.
NOOP
200 Zzz...
STAT /public
213-STAT
drwxrwxrwx    2 501        allaccount       4096 Mar 11 08:49 .
drwxr-xr-x    2 0          0                1024 Mar 10 23:55 ..
-rwxrwxrwx    1 1007       allaccount       1865 Mar 27  2010 goran.jpg
-rw-r--r--    1 gost       allaccount       6014 Mar 11 08:49 propomed.jpg
213 End.
NOOP
200 Zzz...
MKD /public/qwe
257 "/public/qwe" : The directory was successfully created
NOOP
200 Zzz...
STAT /public
213-STAT
drwxrwxrwx    3 501        allaccount       4096 Mar 11 08:51 .
drwxr-xr-x    2 0          0                1024 Mar 10 23:55 ..
-rwxrwxrwx    1 1007       allaccount       1865 Mar 27  2010 goran.jpg
-rw-r--r--    1 gost       allaccount       6014 Mar 11 08:49 propomed.jpg
drwxrwxrwx    2 gost       allaccount       4096 Mar 11 08:51 qwe
213 End.

4.0.2 (8542) (not working upload/mkdir/rename/...)

220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 1 of 5 allowed.
220-Local time is now 08:55. Server port: 21.
220 You will be disconnected after 10 minutes of inactivity.
AUTH TLS
234 AUTH TLS OK.
USER gost
331 User gost OK. Password required
PASS ********
230 OK. Current restricted directory is /
PBSZ 0
200 PBSZ=0
PROT P
200 Data protection level set to "private"
FEAT
211-Extensions supported:
 EPRT
 IDLE
 MDTM
 SIZE
 REST STREAM
 MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;
 MLSD
 ESTP
 PASV
 EPSV
 SPSV
 ESTA
 AUTH TLS
 PBSZ
 PROT
 UTF8
211 End.
OPTS UTF8 ON
200 OK, UTF-8 enabled
NOOP
200 Zzz...
SYST
215 UNIX Type: L8
STAT /public
213-STAT
drwxrwxrwx    2 501        allaccount       4096 Mar 11 08:54 .
drwxr-xr-x    2 0          0                1024 Mar 10 23:55 ..
-rwxrwxrwx    1 1007       allaccount       1865 Mar 27  2010 goran.jpg
213 End.
NOOP
200 Zzz...
MKD /public/qwe
550 Sorry, users are not allowed to create directories

Also I receive when try to upload:

553 Users may not upload files.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Replying to [comment:13 g0ran]:

3.8.1 (working everything ex. upload and mkdir):

The issue is we are no more issueing a CWD command to change the current working directory when working with absolute paths. It is a Pure-FTPd bug if it can't cope with that. Can you please open an issue with the above transcript in their issue tracker.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

#5781 closed as duplicate.

@iterate-ch iterate-ch locked as resolved and limited conversation to collaborators Nov 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fixed ftp FTP Protocol Implementation
Projects
None yet
Development

No branches or pull requests

2 participants