Can't LIST -A but can write

Need help with FileZilla Server? Something does not work as expected? In this forum you may find an answer.

Moderator: Project members

Post Reply
Message
Author
flamer
500 Command not understood
Posts: 2
Joined: 2022-05-23 22:33
First name: minu
Last name: mattew

Can't LIST -A but can write

#1 Post by flamer » 2022-05-23 22:45

Hi guys,

I have a php script which does a site backup. It doesnt support sftp only ftp.

What it does is, connects to the ftp, creates a file called "is_it_writable" which succeeds as I can see the file get created in its virtual root, but then it does a "LIST" and "CWD" looking for that file and filezilla responds with a 550. The script fails saying it doesn't have write access to the directory. Full log below.

I am behind a router and I have specified custom port list, which are all forwarded on the router, and I can see the incoming connection via wireshark on the ephemeral port so it seems like everything is working in that sense.

Its filezilla 1.4.1. The user has full read+write access to the directory

Code: Select all

<Date> Info [Type] Message
<24/05/2022 10:37:45 AM> FTP Session 72 31.220.xxx.xxx [Trace] Session 0x252c1a7aa60 with ID 72 created.
<24/05/2022 10:37:45 AM> FTP Session 72 31.220.xxx.xxx [Response] 220-FileZilla Server 1.4.1
<24/05/2022 10:37:45 AM> FTP Session 72 31.220.xxx.xxx [Response] 220 Please visit https://filezilla-project.org/
<24/05/2022 10:37:46 AM> FTP Session 72 31.220.xxx.xxx [Command] USER ftpuser1
<24/05/2022 10:37:46 AM> FTP Session 72 31.220.xxx.xxx [Response] 331 Please, specify the password.
<24/05/2022 10:37:46 AM> FTP Session 72 31.220.xxx.xxx [Command] PASS ****
<24/05/2022 10:37:46 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Response] 230 Login successful.
<24/05/2022 10:37:46 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Command] PASV
<24/05/2022 10:37:46 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Response] 227 Entering Passive Mode (202,xxx,xxx,xxx,191,112)
<24/05/2022 10:37:46 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Command] PWD
<24/05/2022 10:37:46 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Response] 257 "/" is current directory.
<24/05/2022 10:37:47 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Command] HELP
<24/05/2022 10:37:47 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Response] 214-The following commands are recognized.
<24/05/2022 10:37:47 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Response] 214 Help ok.
<24/05/2022 10:37:47 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Command] NOOP
<24/05/2022 10:37:47 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Response] 200 Noop ok.
<24/05/2022 10:37:47 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Command] TYPE A
<24/05/2022 10:37:47 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Response] 200 Type set to A
<24/05/2022 10:37:47 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Command] LIST -aln 
<24/05/2022 10:37:47 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Response] 550 Permission denied
<24/05/2022 10:37:48 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Command] NOOP
<24/05/2022 10:37:48 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Response] 200 Noop ok.
<24/05/2022 10:37:48 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Command] CWD test_if_writable
<24/05/2022 10:37:48 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Response] 550 Couldn't open the file or directory
<24/05/2022 10:37:48 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Command] NOOP
<24/05/2022 10:37:48 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Response] 200 Noop ok.
<24/05/2022 10:37:48 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Command] PASV
<24/05/2022 10:37:48 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Response] 227 Entering Passive Mode (202,xxx,xxx,xxx,191,113)
<24/05/2022 10:37:49 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Command] LIST -A test_if_writable
<24/05/2022 10:37:49 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Response] 550 Couldn't open the file or directory
<24/05/2022 10:37:49 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Command] NOOP
<24/05/2022 10:37:49 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Response] 200 Noop ok.
<24/05/2022 10:37:49 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Command] TYPE I
<24/05/2022 10:37:49 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Response] 200 Type set to I
<24/05/2022 10:37:49 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Command] PASV
<24/05/2022 10:37:49 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Response] 227 Entering Passive Mode (202,xxx,xxx,xxx,191,111)
<24/05/2022 10:37:50 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Command] STOR test_if_writable
<24/05/2022 10:37:50 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Response] 150 Starting data transfer.
<24/05/2022 10:37:50 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Response] 226 Operation successful
<24/05/2022 10:37:50 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Command] NOOP
<24/05/2022 10:37:50 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Response] 200 Noop ok.
<24/05/2022 10:37:50 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Command] CWD test_if_writable
<24/05/2022 10:37:50 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Response] 550 Couldn't open the directory
<24/05/2022 10:37:51 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Command] NOOP
<24/05/2022 10:37:51 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Response] 200 Noop ok.
<24/05/2022 10:37:51 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Command] TYPE A
<24/05/2022 10:37:51 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Response] 200 Type set to A
<24/05/2022 10:37:51 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Command] PASV
<24/05/2022 10:37:51 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Response] 227 Entering Passive Mode (202,xxx,xxx,xxx,191,110)
<24/05/2022 10:37:51 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Command] LIST -A test_if_writable
<24/05/2022 10:37:51 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Response] 550 Couldn't open the file or directory
<24/05/2022 10:37:52 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Command] QUIT
<24/05/2022 10:37:52 AM> FTP Session 72 31.220.xxx.xxx ftpuser1 [Response] 221 Goodbye.
<24/05/2022 10:37:52 AM> FTP Server [Status] Session 72 ended gracefully.

User avatar
botg
Site Admin
Posts: 35507
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Can't LIST -A but can write

#2 Post by botg » 2022-05-23 22:49

LIST -aln
As per the FTP specifications: List the file named -aln or the contents of the directory named -aln
LIST -A test_if_writable
List the file named -A test_if_writable or the contents of the directory named -A test_if_writable

User avatar
boco
Contributor
Posts: 26912
Joined: 2006-05-01 03:28
Location: Germany

Re: Can't LIST -A but can write

#3 Post by boco » 2022-05-24 00:27

In other words, LIST only takes a filename or directory as parameter. Additional options like -a or -aln officially never existed and FileZilla Server doesn't support them.

Recommended command is MLSD.
No support requests over PM! You will NOT get any reply!!!
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org

flamer
500 Command not understood
Posts: 2
Joined: 2022-05-23 22:33
First name: minu
Last name: mattew

Re: Can't LIST -A but can write

#4 Post by flamer » 2022-05-24 02:43

thank you, I renamed the file from "test_if_writable" to "-A test_if_writable" and it actually worked.

Trying to fix the php function correctly now.

Post Reply