[wp-trac] [WordPress Trac] #51170: FTP automatic updates are not RFC 959 compliant for NLST command

WordPress Trac noreply at wordpress.org
Mon Aug 8 17:13:15 UTC 2022


#51170: FTP automatic updates are not RFC 959 compliant for NLST command
------------------------------------+-----------------------
 Reporter:  giox069                 |       Owner:  audrasjb
     Type:  defect (bug)            |      Status:  closed
 Priority:  normal                  |   Milestone:  6.1
Component:  Filesystem API          |     Version:  3.7
 Severity:  normal                  |  Resolution:  fixed
 Keywords:  has-patch early commit  |     Focuses:
------------------------------------+-----------------------

Comment (by SergeyBiryukov):

 In [changeset:"53862" 53862]:
 {{{
 #!CommitTicketReference repository="" revision="53862"
 Docs: Improve `@since` notes for some `WP_Filesystem_*` methods:

 * `WP_Filesystem_FTPext::exists()`
 * `WP_Filesystem_FTPext::size()`
 * `WP_Filesystem_ftpsockets::exists()`

 The `::exists()` methods were previously using the FTP `NLST` command,
 which works for directories, but is not intended to be applied to a file.
 This only worked most of the time due to many FTP servers being permissive
 and allowing to execute `NLST` on files, which cannot be guaranteed and
 appears to not be the case in newer versions of Pure-FTPd (1.0.48 or
 later).

 With a recent change in [53860], both methods were updated for
 compatibility with RFC 959:

 * Both methods check if the path is a directory that can be changed into
 (and therefore exists).
 * `WP_Filesystem_FTPext` uses `ftp_rawlist()` (FTP `LIST` command) to
 check for file existence.
 * `WP_Filesystem_ftpsockets` uses file size to check for file existence.

 Reference: [https://www.ietf.org/rfc/rfc959.txt RFC 959: File Transfer
 Protocol (FTP)]

 Follow-up to [6779], [11821], [25274], [33648], [34733], [35944], [35946],
 [53860].

 See #51170.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51170#comment:57>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list