After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 303068 - document() function does not load xml file via ftp
document() function does not load xml file via ftp
Status: RESOLVED OBSOLETE
Product: libxslt
Classification: Platform
Component: general
1.1.14
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2005-05-04 22:24 UTC by Bruce Rindahl
Modified: 2021-07-05 10:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
xslt stylesheet (663 bytes, text/plain)
2005-05-05 14:46 UTC, Bruce Rindahl
Details
xml file (235 bytes, text/plain)
2005-05-05 14:47 UTC, Bruce Rindahl
Details

Description Bruce Rindahl 2005-05-04 22:24:44 UTC
Please describe the problem:
When using the document function in xslt and giving a URL such as:
document('ftp://ftp.foo.com/test.xml') for anonymous ftp or
document('ftp://user:pass@ftp.foo.com/test.xml') gives the error:
warning: failed to load external entity "ftp://ftp.foo.com/test.xml"

Permissions heve been checked and loads under IE msxml.

Works fine if http://



Steps to reproduce:
1. Load external document using select="document('ftp://....')"
2. 
3. 


Actual results:
Returns
warning: failed to load external entity "ftp://...."

Expected results:
Loads xml document into tree

Does this happen every time?
Yes

Other information:
Comment 1 John Fleck 2005-05-05 01:51:01 UTC
Could you provide a test script that exhibits the problem?

http://www.xmlsoft.org/bugs.html
Comment 2 Bruce Rindahl 2005-05-05 14:46:42 UTC
Created attachment 46060 [details]
xslt stylesheet

I found some additional details.  Attached are x.xml and x.xsl for test case. 
Note the ftp address value for TITAN storms in x.xml.  If the address is NOT
surrounded by single quotes you get the Unknown IO error.  If the address is
surrounded by single quotes yon do not get the error message but the document
still does not load.  Note the http address for Radar works fine without the
single quotes but throws an error if you add them.
Comment 3 Bruce Rindahl 2005-05-05 14:47:04 UTC
Created attachment 46061 [details]
xml file
Comment 4 Daniel Veillard 2005-05-05 15:19:19 UTC
The FTP server on ftp.rap.ucar.edu seems incompatible with libxml2
nanoftp implementation. Other FTP servers like vsftpd do work fine:

paphio:~/XML -> xmllint ftp://fr.rpmfind.net/pub/veillard/tst.xml
<?xml version="1.0"?>
<doc/>
paphio:~/XML -> xmllint ftp://ftp.rap.ucar.edu/pub/titan-cart/TitanCart.xml
error : Unknown IO error
warning: failed to load external entity
"ftp://ftp.rap.ucar.edu/pub/titan-cart/TitanCart.xml"
paphio:~/XML ->

  and strace xmllint ftp://ftp.rap.ucar.edu/pub/titan-cart/TitanCart.xml 
shows the sequence

socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(21),
sin_addr=inet_addr("128.117.192.211")}, 16) = 0
recv(3, "220-\r\n", 512, 0)             = 6
recv(3, "220-    ***        National Cent"..., 506, 0) = 506
send(3, "USER anonymous\r\n", 16, 0)    = 16
recv(3, "-\r\n220-  The local time is: Thu "..., 512, 0) = 447
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 4
send(3, "PASV\r\n", 6, 0)               = 6
recv(3, "331 Guest login ok, send your co"..., 512, 0) = 68
close(4)                                = 0
write(2, "error : ", 8error : )                 = 8
write(2, "Unknown IO error\n", 17Unknown IO error
)      = 17
close(3)

  There is something in this given FTP server answer 331 which breaks 
libxml2 FTP implementation. From a direct ftp session it's unclear:

paphio:~/XML -> ftp ftp.rap.ucar.edu
Connected to ftp.rap.ucar.edu (128.117.192.211).
220-
220-    ***        National Center for Atmospheric Research       ***
220-    ***             Research Applications Program             ***
220-
220-    ***   Use of this system for unauthorized purposes is a   ***
220-    ***   violation of federal law.  See Public Law 99-474.   ***
220-    ***   Any activity may be logged and monitored.  By       ***
220-    ***   using this system, you consent to such logging and  ***
220-    ***   monitoring.                                         ***
220-
220-  The local time is: Thu May  5 09:16:03 2005
220-
220-  If you have problems logging in, please try using a dash (-) as the
220-  first character of your password--this will turn off the continuation
220-  messages that may be confusing your ftp client.
220-
220-  If you have unusual problems, please contact: ftpadmin@rap.ucar.edu
220-
220 weave.rap.ucar.edu FTP server (Version wu-2.6.2(1) Mon Mar 28 19:08:01 UTC
2005) ready.
Name (ftp.rap.ucar.edu:veillard): anonymous
331 Guest login ok, send your complete e-mail address as password.
Password:

  FTP compatibility is harder to provide than HTTP, that's well-known.
I take patches, I may look for the problem but I don't consider this 
very urgent at the moment,

Daniel
Comment 5 Bruce Rindahl 2005-05-05 16:09:43 UTC
In looking at the strace is is possible the first 220 (FTP_COMMAND_OK) response 
is causing libxml2 to send the username:password too quickly?  I see the line
send(3, "PASV\r\n", 6, 0)               = 6
is sent before the request for a password.

Thanks
Bruce
Comment 6 GNOME Infrastructure Team 2021-07-05 10:59:53 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/libxslt/-/issues/

Thank you for your understanding and your help.