Closed
Bug 867407
Opened 11 years ago
Closed 9 years ago
Navigating to local file through a (local) symlink strips query (?a=b) and fragment identifier (#anchor) from the link
Categories
(Core :: Networking: File, defect)
Tracking
()
RESOLVED
FIXED
mozilla45
People
(Reporter: megan.smith, Assigned: billm)
References
Details
(Keywords: regression)
Attachments
(1 file)
1.38 KB,
patch
|
sworkman
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.63 Safari/537.31 Steps to reproduce: 1) Create a local html file that is a symlink to a source local html file. 2) In the URL bar, type file://<path to symlink>#<an anchor in the source file> 3) Hit enter Actual results: Firefox navigates to the beginning of the source file, minus the anchor link. Expected results: Firefox navigates to the correct anchor in the source file.
Comment 1•11 years ago
|
||
Confirmed with 2013-05-06-03-09-25-mozilla-central-firefox-23.0a1.ru.linux-x86_64.
Updated•11 years ago
|
Summary: Navigating to local symlinked file with an anchor link strips anchor link → Navigating to local file through a (local) symlink strips anchor from the link
Comment 2•11 years ago
|
||
Since Fx 15: https://bugzilla.mozilla.org/show_bug.cgi?id=670514#c63
Version: 16 Branch → 15 Branch
Comment 3•9 years ago
|
||
(In reply to [:Aleksej] from comment #2) > Since Fx 15: https://bugzilla.mozilla.org/show_bug.cgi?id=670514#c63 -g 2012-05-03-03-05-12-mozilla-central-firefox-15.0a1.en-US.linux-x86_64 807403a04a6a -b 2012-05-04-12-29-39-mozilla-central-firefox-15.0a1.en-US.linux-x86_64 9ebf3dc839c5 https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=807403a04a6a&tochange=9ebf3dc839c5 -b 2015-03-30-03-02-03-mozilla-central-firefox-39.0a1.ru.linux-x86_64
Blocks: CVE-2012-1945
Component: Untriaged → Networking: File
No longer depends on: CVE-2012-1945
Keywords: regression
Product: Firefox → Core
See Also: → 1051117
Updated•9 years ago
|
See Also: → 1148173
Summary: Navigating to local file through a (local) symlink strips anchor from the link → Navigating to local file through a (local) symlink strips fragment identifier (anchor) from the link
Comment 4•9 years ago
|
||
This still reproduces in Firefox Nightly 39, FWIW. (I just tried it with a file in /tmp and a symlink to that file.)
Comment 6•9 years ago
|
||
As noted in bug 1051117 comment 17, the symlink translation-to-actual-file happens in nsFileChannel::nsFileChannel() -- that's where we lose the fragment identifier (and anything else after the filename). MXR link: http://mxr.mozilla.org/mozilla-central/source/netwerk/protocol/file/nsFileChannel.cpp?rev=ac4464790ec4&mark=260-269#260 There, 'uri' (and hence 'fileURL') has the fragment identifier, but 'targetURI' (produced by the long 'if' statement) does not -- and that's the problem.
Updated•9 years ago
|
Summary: Navigating to local file through a (local) symlink strips fragment identifier (anchor) from the link → Navigating to local file through a (local) symlink strips query (?a=b) and fragment identifier (#anchor) from the link
Updated•9 years ago
|
Assignee: nobody → netzen
Comment 7•9 years ago
|
||
I won't have time for this in the near future so unassigned myself for now.
Assignee | ||
Comment 8•9 years ago
|
||
This fixes the problem I was experiencing with a test not running locally.
Comment 9•9 years ago
|
||
Comment on attachment 8634798 [details] [diff] [review] patch Review of attachment 8634798 [details] [diff] [review]: ----------------------------------------------------------------- Looks sane to me. Can we get a try run for this before landing please? Pending that and the naming nit, r=me. ::: netwerk/protocol/file/nsFileChannel.cpp @@ +276,5 @@ > + nsCOMPtr<nsIURL> origURL = do_QueryInterface(uri); > + nsCOMPtr<nsIURL> targetURL = do_QueryInterface(targetURI); > + nsAutoCString search; > + if (origURL && targetURL && NS_SUCCEEDED(origURL->GetQuery(search))) { > + targetURL->SetQuery(search); s/search/queryString/
Attachment #8634798 -
Flags: review?(sworkman) → review+
Comment 11•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/16ab2ae184c0
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Comment 12•9 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-b2g44_v2_5/rev/16ab2ae184c0
status-b2g-v2.5:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•