Closed Bug 130428 Opened 23 years ago Closed 23 years ago

Triggering xpi with URL argument is not installing on WIN only

Categories

(Core Graveyard :: Installer: XPInstall Engine, defect)

x86
Windows 2000
defect
Not set
major

Tracking

(Not tracked)

VERIFIED FIXED
mozilla1.0

People

(Reporter: jimmykenlee, Assigned: dprice)

Details

(Keywords: platform-parity, regression, Whiteboard: [adt1][ETA 4-23])

Attachments

(1 file, 1 obsolete file)

Build: 2002-03-12-10-trunk(WIN) 1. Open http://jimbob/jars/a_trigger_args.html 2. Click Trigger button 3. Click Install button from Software Installation dialog RESULT: Download dialog appears and disappears very quickly. No installation takes place. Install.log shows nothing. Mac and Linux behave fine. EXPECTED RESULT: Installs gracefully.
Nominating for beta. This needs to get fixed in order to be able to install packages with URL parameters. This is a problem on all Windows platforms. This used to work, and it is broken now.
Keywords: nsbeta1, pp, regression
http://jimbob/jars/u_new65_arg.html is another test that fails, too.
adt1 per adt triage
Whiteboard: [adt1]
Target Milestone: --- → mozilla1.0
prohibits installs from a cgi-bin script, reason this is adt1
--> dprice
Assignee: dveditz → dprice
When I run this test on windows, I get an error "Not a valid install package" The install log tells me it failed with error -207
I get the same thing. Also, http://jimbob/jars/u_new65_arg.html fails as well. I tried both Win 2000 and Win 98. Something has gone wrong. I can confirm that an older browser does trigger as expected, so the test cases are working.
I am seeing two different problems while debugging this. First I'm getting assertions in onStopRequest mItem->mOutputStream is null Second GetScriptFromJarfile is failing. It is passing the filename with the query string still appended to nsJar::Open and no one in nsJar is bothering to strip it away before trying to open the file
nsJAR shouldn't have to worry about bogus filenames, XPInstall code should be stripping that. But how does that happen? The query string is attached to the URL, but the filename should be a temp file that we generate. Looks like a bug when dealing with file: urls, is it our bug or in the xpcom file routines we use? In any case it's quite different from the reported problem which involves downloading files from a server, which would use our own filenames.
Whiteboard: [adt1] → [adt1][ETA 4-17]
Whiteboard: [adt1][ETA 4-17] → [adt1][ETA 4-19]
Attached patch patch 1 (obsolete) — Splinter Review
The patch defaults to the filename to tmp.xpi in the case for non-chrome installs. Filed bug 137911 to handle the case for chrome installs. The chrome case is extremely rare because you must trigger the download through javascript. It is also more complicated to fix because we want to have a meaningful filename.
+ tempFilename.Assign(NS_LITERAL_STRING("tmp.xpi")); + temp->AppendUnicode(tempFilename.get()); does tempFilename.get() yield Unicode? Or do we need to extract from tempFilename and convert to Unicode before doing the append?
Comment on attachment 79580 [details] [diff] [review] patch 1 r=curt
Attachment #79580 - Flags: review+
It is my understanding that AppendUnicode handles all of the required conversions. Is that right Dan?
AppendUnicode() handles all the conversions, and tempFilename is an nsString (not nsCString) so it's also Unicode. However, now that we're no longer dealing with user-supplied base names we're doing a lot of extra work :-) I haven't yet looked at the patch (will in a moment) but the snippet syd quoted you could just do temp->Append("tmp.xpi"); now that we use a fixed filename with all safe chars.
Comment on attachment 79580 [details] [diff] [review] patch 1 >+ nsString tempFilename; >+ tempFilename.Assign(NS_LITERAL_STRING("tmp.xpi")); > nsCOMPtr<nsILocalFile> temp; > directoryService->Get(NS_OS_TEMP_DIR, > NS_GET_IID(nsIFile), > getter_AddRefs(temp)); >- temp->AppendUnicode(leaf.get()); >+ temp->AppendUnicode(tempFilename.get()); As long as we're changing this code let's add a null check for temp before we dereference it, or check the rv of the directoryService call.
Attached patch patch 2Splinter Review
Attachment #79580 - Attachment is obsolete: true
Looks good to me, can you describe the testing behind this?
Comment on attachment 79843 [details] [diff] [review] patch 2 Do file:// urls with query strings work? This fix won't touch that, but nsIFileURL might be doing the right thing already. Jimmy, could you test and file a bug as appropriate? For this patch, sr=dveditz
Attachment #79843 - Flags: superreview+
Whiteboard: [adt1][ETA 4-19] → [adt1][ETA 4-23]
Status: NEW → RESOLVED
Closed: 23 years ago
Keywords: adt1.0.0
Resolution: --- → FIXED
landed on the trunk
testing included both test cases listed in the bug, and it was in my tree when I built and ran mozilla and netscape installers. But the installers don't use query strings so they didn't run the code.
adding adt1.0.0+. Please check into the branch as soon as possible and add the fixed1.0.0 keyword.
Keywords: adt1.0.0adt1.0.0+
Build: 2002-04-23-10-trunk(WIN), 2002-04-23-09-trunk(LINUX), 2002-04-23-08-trunk(MAC 10.x, MAC 9.x) Checked trunk builds for all platforms. This is working as expected. Marking Verified for TRUNK.
Status: RESOLVED → VERIFIED
Comment on attachment 79843 [details] [diff] [review] patch 2 technically, this needs an r= before I can approve it for anything, let alone the branch. Can you get an r= and resubmit?
Comment on attachment 79843 [details] [diff] [review] patch 2 (by decision of drivers, we'll assume the r= rolled forward) a=scc for checkin to the mozilla 1.0 branch
Attachment #79843 - Flags: approval+
Keywords: fixed1.0.0
Build: 2002-04-25-08-1.0.0(WIN), 2002-04-25-05-1.0.0(MAC), 2002-04-25-08-1.0.0(LINUX) Looks good on all platforms. Adding keyword verified1.0.0.
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: