PhilippC / keepass2android

Password manager app for Android
https://play.google.com/store/apps/details?id=keepass2android.keepass2android
GNU General Public License v3.0
4.57k stars 377 forks source link

FTP(ES) Won't list any files once connected to ftp server [BUG] #2585

Open agentx3 opened 2 months ago

agentx3 commented 2 months ago

Checks

Describe the bug you encountered:

I am attempting to open a remote database for the first time, via the "Open file..." button on the main screen.

When I put in the connection string and details, it connects but then shows the "Root" directory as "empty". The FTP user in question is in a chroot so if the "Root" directory is "/" then that should be correct. However, the directory should not be empty.

When I connect with a different FTP client I am able to see and read the *.kdbx files so it is not a permission issue. I can also verify that the connection was successful, as my server logs reveal the authentication was successful.

Describe what you expected to happen:

I expected to see existing files and directories once FTP connection was established.


I am opening this as a new issue because it seems like other FTP((E)S) issues are at least able to view the files.

For additional context I am running my own FTP server using vsftpd

What version of Keepass2Android are you using?

1.10-pre

Which version of Android are you on?

14

agentx3 commented 2 months ago

Sorry, I had not look in closed issues. Possibly related to https://github.com/PhilippC/keepass2android/issues/2423, but since I'm not 100% sure I'll let you decide if this is the same or different issue.

agentx3 commented 2 months ago

Here is the output log that I was able to dig up for a connection attempt. I've redacted out some information such as the domain and IP.

[FluentFTP] Connecting to IP #1= ***:21
4/10/2024 9:40:05 PM:981 -- [FluentFTP] Waiting for a response
4/10/2024 9:40:06 PM:7 -- [FluentFTP] Response: 220 (vsFTPd *.*.*) [738985.903d]
4/10/2024 9:40:06 PM:8 -- [FluentFTP] Status:   Detected FTP server: VsFTPd
4/10/2024 9:40:06 PM:8 -- [FluentFTP] Command:  AUTH TLS
4/10/2024 9:40:06 PM:9 -- [FluentFTP] Waiting for response to: AUTH TLS
4/10/2024 9:40:06 PM:35 -- [FluentFTP] Response: 234 Proceed with negotiation. [25ms]
4/10/2024 9:40:06 PM:124 -- [FluentFTP] FTPS authentication successful, lib = .NET SslStream, cipher suite = Tls12 (None, None, 0) [86ms]
4/10/2024 9:40:06 PM:125 -- [FluentFTP] Command:  USER ***
4/10/2024 9:40:06 PM:127 -- [FluentFTP] Waiting for response to: USER ***
4/10/2024 9:40:06 PM:158 -- [FluentFTP] Response: 331 Please specify the password. [30ms]
4/10/2024 9:40:06 PM:159 -- [FluentFTP] Command:  PASS ***
4/10/2024 9:40:06 PM:161 -- [FluentFTP] Waiting for response to: PASS ***
4/10/2024 9:40:06 PM:197 -- [FluentFTP] Response: 230 Login successful. [34ms]
4/10/2024 9:40:06 PM:198 -- [FluentFTP] Command:  PBSZ 0
4/10/2024 9:40:06 PM:201 -- [FluentFTP] Waiting for response to: PBSZ 0
4/10/2024 9:40:06 PM:230 -- [FluentFTP] Response: 200 PBSZ set to 0. [29ms]
4/10/2024 9:40:06 PM:231 -- [FluentFTP] Command:  PROT P
4/10/2024 9:40:06 PM:233 -- [FluentFTP] Waiting for response to: PROT P
4/10/2024 9:40:06 PM:264 -- [FluentFTP] Response: 200 PROT now Private. [30ms]
4/10/2024 9:40:06 PM:266 -- [FluentFTP] Command:  FEAT
4/10/2024 9:40:06 PM:268 -- [FluentFTP] Waiting for response to: FEAT
4/10/2024 9:40:06 PM:322 -- [FluentFTP] Response: 211-Features:
Response: EPRT
Response: EPSV
Response: MDTM
Response: PASV
Response: PBSZ
Response: PROT
Response: REST STREAM
Response: SIZE
Response: TVFS
Response: UTF8
4/10/2024 9:40:06 PM:323 -- [FluentFTP] Response: 211 End [55ms]
4/10/2024 9:40:06 PM:324 -- [FluentFTP] Text encoding: System.Text.UTF8Encoding
4/10/2024 9:40:06 PM:325 -- [FluentFTP] Command:  OPTS UTF8 ON
4/10/2024 9:40:06 PM:327 -- [FluentFTP] Waiting for response to: OPTS UTF8 ON
4/10/2024 9:40:06 PM:367 -- [FluentFTP] Response: 200 Always in UTF8 mode. [39ms]
4/10/2024 9:40:06 PM:368 -- [FluentFTP] Command:  SYST
4/10/2024 9:40:06 PM:370 -- [FluentFTP] Waiting for response to: SYST
4/10/2024 9:40:06 PM:401 -- [FluentFTP] Response: 215 UNIX Type: L8 [28ms]
4/10/2024 9:40:06 PM:402 -- [FluentFTP] Listing parser set to: Unix
4/10/2024 9:40:06 PM:403 -- [FluentFTP] Command:  PWD
4/10/2024 9:40:06 PM:405 -- [FluentFTP] Waiting for response to: PWD
4/10/2024 9:40:06 PM:439 -- [FluentFTP] Response: 257 "/" is the current directory [33ms]
4/10/2024 9:40:06 PM:440 -- FTP: IocToUri out = ftp://foo.bar.example/
4/10/2024 9:40:06 PM:441 -- [FluentFTP] >         SetWorkingDirectory("/")
4/10/2024 9:40:06 PM:442 -- [FluentFTP] Command:  CWD /
4/10/2024 9:40:06 PM:444 -- [FluentFTP] Waiting for response to: CWD /
4/10/2024 9:40:06 PM:484 -- [FluentFTP] Response: 250 Directory successfully changed. [39ms]
4/10/2024 9:40:06 PM:485 -- [FluentFTP] Command:  PWD
4/10/2024 9:40:06 PM:487 -- [FluentFTP] Waiting for response to: PWD
4/10/2024 9:40:06 PM:516 -- [FluentFTP] Response: 257 "/" is the current directory [27ms]
4/10/2024 9:40:06 PM:517 -- [FluentFTP] >         GetListing(null, SizeModify, AllFiles)
4/10/2024 9:40:06 PM:518 -- [FluentFTP] Command:  TYPE I
4/10/2024 9:40:06 PM:519 -- [FluentFTP] Waiting for response to: TYPE I
4/10/2024 9:40:06 PM:662 -- [FluentFTP] Response: 200 Switching to Binary mode. [142ms]
4/10/2024 9:40:06 PM:662 -- [FluentFTP] >         OpenDataStream("LIST -a /", 0)
4/10/2024 9:40:06 PM:662 -- [FluentFTP] >         OpenPassiveDataStream(AutoPassive, "LIST -a /", 0)
4/10/2024 9:40:06 PM:663 -- [FluentFTP] Command:  EPSV
4/10/2024 9:40:06 PM:663 -- [FluentFTP] Waiting for response to: EPSV
4/10/2024 9:40:06 PM:694 -- [FluentFTP] Response: 229 Entering Extended Passive Mode (|||45837|) [29ms]
4/10/2024 9:40:06 PM:694 -- [FluentFTP] Connecting to IP #1= ***:45837
4/10/2024 9:40:06 PM:721 -- [FluentFTP] Command:  LIST -a /
4/10/2024 9:40:06 PM:723 -- [FluentFTP] Waiting for response to: LIST -a /
4/10/2024 9:40:06 PM:753 -- [FluentFTP] Response: 150 Here comes the directory listing. [28ms]
4/10/2024 9:40:06 PM:832 -- [FluentFTP] FTPS authentication successful, lib = .NET SslStream, cipher suite = Tls12 (None, None, 0) [78ms]
4/10/2024 9:40:06 PM:833 -- [FluentFTP]
+---------------------------------------+
4/10/2024 9:40:06 PM:834 -- [FluentFTP] -----------------------------------------
4/10/2024 9:40:06 PM:834 -- [FluentFTP] Closing/Disposing FtpSocketStream(data connection)
4/10/2024 9:40:06 PM:835 -- [FluentFTP] >         CloseDataStream()
4/10/2024 9:40:06 PM:835 -- [FluentFTP] Waiting for response to: LIST -a /
4/10/2024 9:40:06 PM:865 -- [FluentFTP] Response: 522 SSL connection failed [141ms]
4/10/2024 9:40:06 PM:865 -- [FluentFTP] Closing/Disposing FtpSocketStream(data connection)
4/10/2024 9:40:06 PM:866 -- [FluentFTP] >         Dispose()
4/10/2024 9:40:06 PM:866 -- [FluentFTP] Disposing FtpClient object...
4/10/2024 9:40:06 PM:866 -- [FluentFTP] Command:  QUIT
4/10/2024 9:40:06 PM:872 -- [FluentFTP] Waiting for response to: QUIT
4/10/2024 9:40:06 PM:896 -- [FluentFTP] Response: 221 Goodbye. [27ms]
4/10/2024 9:40:06 PM:897 -- [FluentFTP] Closing/Disposing FtpSocketStream(control connection)
4/10/2024 9:40:06 PM:898 -- [FluentFTP] Closing/Disposing FtpSocketStream(control connection)
4/10/2024 9:40:06 PM:901 -- FluentFTP.Exceptions.FtpCommandException: Code: 522 Message: SSL connection failed
  at keepass2android.Io.NetFtpFileStorage.ListContents (KeePassLib.Serialization.IOConnectionInfo ioc) [0x00176] in <4387dcce18dd490eadd43a838bbc0f3d>:0 
  at keepass2android.Io.OfflineSwitchableFileStorage.ListContents (KeePassLib.Serialization.IOConnectionInfo ioc) [0x00000] in <4387dcce18dd490eadd43a838bbc0f3d>:0 
  at keepass2android.Io.CachingFileStorage.ListContents (KeePassLib.Serialization.IOConnectionInfo ioc) [0x00000] in <4387dcce18dd490eadd43a838bbc0f3d>:0 
  at keepass2android.FileChooserFileProvider.ListFiles (System.Int32 taskId, System.String dirName, System.Boolean showHiddenFiles, System.Int32 filterMode, System.Int32 limit, System.String positiveRegex, System.String negativeRegex, System.Collections.Generic.IList`1[T] fileList, System.Boolean[] hasMoreFiles) [0x00012] in <dabeaecbf9c0465bb1ce8a7bcc561766>:0