Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 71868e7

Browse files
committed
Add another point in the "Restrictions" section about how the handling of FTP
URLs will seemingly succeed to read a URL that points to a file whose permissions you do not have to read. Backport candidate once everyone agrees with the wording.
1 parent 12ac3e1 commit 71868e7

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

Doc/lib/liburllib.tex

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,23 @@ \section{\module{urllib} ---
328328
returned data is HTML, you can use the module
329329
\refmodule{htmllib}\refstmodindex{htmllib} to parse it.
330330

331+
\item
332+
The code handling the FTP\index{FTP} protocol cannot differentiate between a
333+
file and a directory and can lead to unexpected behavior when attempting to
334+
read a URL that points to a file that is not accessible.
335+
If the URL ends in a \code{/} then it is assumed to be a
336+
directory and will be handled as such only. But if an attempt to read a file
337+
leads to a 550 error (signaling the URL cannot be found or is not accessible,
338+
often for permission reasons), then the path is treated as a directory in order
339+
to handle the case of when a directory is specified by a URL but a trailing
340+
\code{/} is left off.
341+
This can lead to the apparent successful fetching of a file whose read
342+
permissions you do not have by still succeeding by returning the directory
343+
listing for the file from treating it as a directory.
344+
If more fine-grained control is needed, consider using the \module{ftplib}
345+
module, subclassing \class{FancyURLOpener}, or changing \var{_urlopener} to
346+
meet your needs.
347+
331348
\item
332349
This module does not support the use of proxies which require
333350
authentication. This may be implemented in the future.

0 commit comments

Comments
 (0)