Closed Bug 291792 Opened 20 years ago Closed 20 years ago

"undefined" folder created because installDroppedInFiles doesn't check for return value of getIDForLocation

Categories

(Toolkit :: Add-ons Manager, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: asqueella, Assigned: robert.strong.bugs)

References

Details

(Whiteboard: [steps to repro in comment 2])

Attachments

(2 obsolete files)

This code is wrong (installDroppedInFiles function, nsExtensionManager.js): -- var id = location.getIDForLocation(entry); actualItems[id] = entry; -- Should be -- var id = location.getIDForLocation(entry); if(!id) continue; actualItems[id] = entry; -- The symptoms are: put a "{3f0da09b-c1ab-40c5-8d7f-53f475ac3fe8}~" (i.e. not a GUID) file pointing to a correct extension location in profile/extensions. Firefox creates an "undefined" folder in profile/extensions and says in the JS console it tries to register item with ID=undefined.
Patches welcome!
Flags: blocking-aviary1.1+
QA Contact: bugs → benjamin
Whiteboard: [does not block 1.1a]
dang. Scratch that. Steps to reproduce are simpler: just create a non-GUID named folder in extensions/ with install.rdf in it. Why not just read the ID from install.rdf? That would allow for simpler folder names, as some people prefer. If you want to save time on parsing install.rdf you could create a plaintext file with GUID inside the folder and then first try to read from it. I'd make a patch if I had a tree. Gavin? ;-)
Attached patch Patch (untested) (obsolete) — Splinter Review
Attachment #181815 - Flags: review?(bugs)
Similar fix appears to be included in attachment 181795 [details] [diff] [review] (second patch in bug 291831).
Based on comment #4 and the fact that the second patch in 291831 has landed, is this bug fixed?
Comment on attachment 181815 [details] [diff] [review] Patch (untested) Seems so, but I don't have a recent build. If anyone can confirm this is fixed, please mark it as such. Removing obsolete review request, sorry for wasting your time, Gavin.
Attachment #181815 - Flags: review?(bugs)
Attachment #181815 - Attachment is obsolete: true
Nope, not fixed.
Whiteboard: [does not block 1.1a] → [does not block 1.1a] [steps to repro in comment 2]
(In reply to comment #3) > Created an attachment (id=181815) [edit] > Patch (untested) > Gavin, your approach is correct. Would you please attach new patch?
Attached patch Unbitrotted (obsolete) — Splinter Review
This should be OK, since getIDForLocation clearly can return undefined, but I'm not able to actually test it, nor have I taken the time to really understand any of this code.
Attachment #182594 - Flags: review?(bugs)
robert, can you look at this patch and see if it can be updated?
Assignee: bugs → rob_strong
Gavin or Nickolay (if you are around) - could you check if you are able to still reproduce this bug? I just tried and it did not create an undefined folder for me when using the steps in comment #0. Thanks - if I can find the time I'll verify it also by inspecting the code.
Comment on attachment 182594 [details] [diff] [review] Unbitrotted Benjamin - this patch from gavin.sharp does fix the problem as stated in comment #2 by skipping invalid id's and it still applies.
Attachment #182594 - Flags: review?(bugs) → review?(benjamin)
Attachment #182594 - Flags: review?(benjamin)
Attachment #182594 - Flags: review+
Attachment #182594 - Flags: approval-aviary1.1a2+
Whiteboard: [does not block 1.1a] [steps to repro in comment 2] → [checkin needed] [steps to repro in comment 2]
Whiteboard: [checkin needed] [steps to repro in comment 2] → [checkin needed][a+] [steps to repro in comment 2]
Comment on attachment 182594 [details] [diff] [review] Unbitrotted mozilla/toolkit/mozapps/extensions/src/nsExtensionManager.js.in 1.118
Attachment #182594 - Attachment is obsolete: true
Whiteboard: [checkin needed][a+] [steps to repro in comment 2] → [steps to repro in comment 2]
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: