This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 22940 - NbfsURLConnection doesn't handle /./ and /../ in a path
Summary: NbfsURLConnection doesn't handle /./ and /../ in a path
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Execution (show other bugs)
Version: 3.x
Hardware: All All
: P2 blocker (vote)
Assignee: David Strupl
URL:
Keywords:
: 8938 (view as bug list)
Depends on:
Blocks: 19578 22958 22965
  Show dependency tree
 
Reported: 2002-04-29 17:05 UTC by _ pkuzel
Modified: 2008-12-22 21:43 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Testing class that sucessfully parsed the x.xml with added end quote (2.21 KB, text/plain)
2002-05-06 13:51 UTC, Petr Nejedly
Details
Previous example using FileObject to get x.xml document. (2.67 KB, text/plain)
2002-05-06 15:25 UTC, _ lkramolis
Details
Changed test (2.97 KB, text/plain)
2002-05-06 16:18 UTC, Petr Nejedly
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ pkuzel 2002-04-29 17:05:54 UTC
Imagine x.xml:

<!DOCTYPE x SYSTEM "./x.dtd> 
<x/>

and x.dtd:

<!ELEMENT x EMPTY>

Bundled XML non-validating parser reports fatal
error.
Comment 1 _ pkuzel 2002-04-29 17:28:31 UTC
that is not caused by missing '"' in the example.
Comment 2 _ lkramolis 2002-04-30 14:28:23 UTC
This bug blocks at least two XML module features. Please fix it in
Crimson or use Xerces instead which does not have such problems.
Comment 3 _ ttran 2002-05-02 12:18:55 UTC
x
Comment 4 Petr Nejedly 2002-05-06 13:46:11 UTC
Please explain what kind of problem does it cause.
I've tried creating a simple application parsing given xml
and it worked w/o single problem when started 
I'll attach the source.
Isn't the problem in your entity resolver?
Comment 5 Petr Nejedly 2002-05-06 13:51:44 UTC
Created attachment 5650 [details]
Testing class that sucessfully parsed the x.xml with added end quote
Comment 6 _ lkramolis 2002-05-06 15:25:05 UTC
Created attachment 5653 [details]
Previous example using FileObject to get x.xml document.
Comment 7 _ lkramolis 2002-05-06 15:26:58 UTC
Petre I have updated your example to use FileObject as source of XML
document. Now described problem is reproducible.
Comment 8 Petr Nejedly 2002-05-06 16:18:55 UTC
Created attachment 5655 [details]
Changed test
Comment 9 Petr Nejedly 2002-05-06 16:30:23 UTC
OK, I've enhanced the test even more to reveal where THE problem is:

java.io.IOException: Cannot find: nbfs:QBtmpQBjav/./x.dtd
at o.o.execution.NbfsURLConnection.connect(NbfsURLConnection.java:100)
at o.o.e.NbfsURLConnection.getInputStream(NbfsURLConnection.java:111)
at java.net.URL.openStream(URL.java:798)
at org.apache.crimson.parser.InputEntity.init(InputEntity.java:209)

I believe that now it is clean where the problem is.
The fact that Xerces normalizes the URL before using it as a SID
doesn't mean that Crimson is wrong.

I'm reassigning this to openide/execution to let them fix the
NbfsURLConnection.
Comment 10 Petr Nejedly 2002-05-06 16:31:49 UTC
Updated summary
Comment 11 David Strupl 2002-05-07 08:38:54 UTC
Who are they? I suppose you were joking when you put the plural there.
Comment 12 Petr Nejedly 2002-05-07 09:17:12 UTC
They, David Strupl, the Emperor :-)
Comment 13 David Strupl 2002-05-07 13:30:12 UTC
in o.o.execution.NbfsURLConnection.connect(..) lines 86-87:

FileSystem fsys = repo.findFileSystem(fileSystemName);
return (fsys == null) ? null : fsys.findResource (resourceName);

So - I think it could be handled in the filesystem.findResource. What
do others think?

Radek, is this reasonable? - if not please reassign back. Thanks.
Comment 14 Petr Nejedly 2002-05-07 13:52:10 UTC
I think that the URL itself should be able to cover it, but it
doesn't handle it, so we should better catch it in our handler
(it is more generic than catching it in FileSystems).
But its just my opinion.
Comment 15 rmatous 2002-05-07 14:14:40 UTC
I think that filesystems cann handle it, but I think its more
confusing than usefull.
Comment 16 David Strupl 2002-05-09 10:08:52 UTC
Ok, I will do it in NbfsURLConnection.
Comment 17 David Strupl 2002-05-09 13:09:09 UTC
Fixed in 
NbfsURLConnection 1.18
Comment 18 rmatous 2002-07-23 10:46:10 UTC
*** Issue 8938 has been marked as a duplicate of this issue. ***
Comment 19 pzajac 2002-10-21 14:02:44 UTC
verified
Comment 20 Quality Engineering 2003-07-01 16:38:06 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.