file is not defined in DirInstallLocation__readDirectoryFromFile

VERIFIED FIXED in mozilla7

Status

()

VERIFIED FIXED
8 years ago
8 years ago

People

(Reporter: timeless, Assigned: Unfocused)

Tracking

Trunk
mozilla7
Points:
---
Bug Flags:
in-testsuite +
in-litmus -

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

8 years ago
Mozilla/5.0 (Windows NT 6.1; rv:2.2a1pre) Gecko/20110329 Firefox/4.2a1pre

Warning: WARN addons.xpi: Failed to add directory install location app-profile: ReferenceError: file is not defined
Source File: resource://gre/modules/XPIProvider.jsm
Line: 6882

902   _readDirectoryFromFile: function DirInstallLocation__readDirectoryFromFile(aFile) {
6903     let fis = Cc["@mozilla.org/network/file-input-stream;1"].
6904               createInstance(Ci.nsIFileInputStream);
6905     fis.init(aFile, -1, -1, false);
6906     let line = { value: "" };
6907     if (fis instanceof Ci.nsILineInputStream)
6908       fis.readLine(line);
6909     fis.close();
6910     if (line.value) {
6911       let linkedDirectory = Cc["@mozilla.org/file/local;1"].
6912                             createInstance(Ci.nsILocalFile);
6913 
6914       try {
6915         linkedDirectory.initWithPath(line.value);
6916       }
6917       catch (e) {
6918         linkedDirectory.setRelativeDescriptor(file.parent, line.value);

'aFile' is defined in this function, 'file' is not...
Created attachment 522901 [details] [diff] [review]
Patch v1

Disclaimer: I have no clue when it comes to testing this.
Assignee: nobody → bmcbride
Status: NEW → ASSIGNED
Attachment #522901 - Flags: review?(dtownsend)
test_filepointer.js would be a good guide, it looks like it'll be failing right now if the pointer file contains a relative path.
Comment on attachment 522901 [details] [diff] [review]
Patch v1

Looks good, would very much like to see a test for this case though
Attachment #522901 - Flags: review?(dtownsend) → review+
(Reporter)

Comment 4

8 years ago
fwiw i hit this using unpacked omni.jar
Keywords: checkin-needed
Needs a test before landing
Keywords: checkin-needed
Created attachment 536227 [details] [diff] [review]
Patch v1.1

Now with test.
Attachment #522901 - Attachment is obsolete: true
Attachment #536227 - Flags: review?(dtownsend)
OS: Windows 7 → All
Hardware: x86 → All
Comment on attachment 536227 [details] [diff] [review]
Patch v1.1

Review of attachment 536227 [details] [diff] [review]:
-----------------------------------------------------------------

Awesome, thanks
Attachment #536227 - Flags: review?(dtownsend) → review+
http://hg.mozilla.org/mozilla-central/rev/c5e0aaaff9e1
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Flags: in-testsuite+
Flags: in-litmus-
Resolution: --- → FIXED
Target Milestone: --- → mozilla7
Verified fixed by check-in and passing tests.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.