Closed
Bug 1150199
Opened 11 years ago
Closed 11 years ago
Allow Langpacks to be signed and un-privileged
Categories
(Core Graveyard :: DOM: Apps, defect)
Tracking
(firefox38 wontfix, firefox39 wontfix, firefox40 fixed, b2g-v2.2 fixed, b2g-master fixed)
RESOLVED
FIXED
mozilla40
People
(Reporter: stas, Assigned: fabrice)
Details
Attachments
(1 file)
|
2.39 KB,
patch
|
ferjm
:
review+
stas
:
feedback+
bajaj
:
approval-mozilla-b2g37+
|
Details | Diff | Splinter Review |
I'm filing this in the Marketplace product but this might also be a Gecko bug.
Despite bug 1122277, it's not possible to install langpacks unless the following pref is set:
user_pref("dom.apps.allow_unsigned_langpacks", true);
Could it be that we're not actually signing langpacks?
| Assignee | ||
Comment 1•11 years ago
|
||
I downloaded the first langpack from the answer of https://marketplace.firefox.com/api/v2/langpacks/?dev=firefoxos&fxos_version=3.0 and it seems signed.
I'm investigating further.
| Reporter | ||
Comment 2•11 years ago
|
||
Thanks, Fabrice. The comment in line 506 and the code in http://mxr.mozilla.org/mozilla-central/source/dom/apps/AppsUtils.jsm#514 seem to imply that Gecko expects langpacks to be privileged, while they shouldn't. They're regular un-privileged apps with signed packages. Could this be related?
| Assignee | ||
Comment 3•11 years ago
|
||
Yes, this is it. You need to set the type to "privileged" since we don't really support unprivileged signed apps.
How bad is that to do this change on your side?
| Reporter | ||
Comment 4•11 years ago
|
||
We wanted to default to the more open setting and since langpacks don't use any APIs, un-privileged seemed good. I recall Mat's first implementation of the Marketplace's langpack chacker actually required langpacks to be privileged but I asked him to change that.
If we were to require langpacks to be privileged, we'll need to:
- change the langpack builder to add type: privileged to langpacks' manifests,
- change the langpack checker to require submitted langpacks to be privileged,
- re-upload existing (testing) langpacks (no biggie).
Before we move on, can we make sure this is the only way? I really appreciated the fact that we managed to keep langpacks un-privileged and changing that would seem like a step backwards.
Also NI'ing Freddy in case this has security implications. Privileged langpacks could in theory access some device APIs, but then, they don't have any code in them, so maybe that's fine. Especially given that they are already run in the context of other apps which are often certified.
Flags: needinfo?(fbraun)
| Assignee | ||
Comment 5•11 years ago
|
||
I'm sorry for the misunderstanding there. Until now we always considered that signed === privileged.
We could special case apps with a langpack role to need a signature even if they are not privileged. I'm a bit nervous doing that so late in the 2.2 cycle but that's possible.
| Assignee | ||
Comment 6•11 years ago
|
||
That passes tests.
Stas, can you verify with a langpack from the marketplace?
Assignee: nobody → fabrice
Attachment #8587048 -
Flags: feedback?(stas)
| Reporter | ||
Updated•11 years ago
|
Component: General → DOM: Apps
Product: Marketplace → Core
Summary: Langpacks are not signed on Marketplace → Allow Langpacks to be signed and un-privileged
Version: Avenir → 40 Branch
Comment 7•11 years ago
|
||
The special case that Fabrice suggests in comment 5 is indeed the desired path:
We'd prefer Langpacks to remain unprivileged, even if they do not contain code.
Flags: needinfo?(fbraun)
| Reporter | ||
Comment 8•11 years ago
|
||
Comment on attachment 8587048 [details] [diff] [review]
unprivileged-langpacks.patch
I tested with
user_pref("dom.apps.allow_unsigned_langpacks", false);
and it works fine.
Attachment #8587048 -
Flags: feedback?(stas) → feedback+
| Assignee | ||
Updated•11 years ago
|
Attachment #8587048 -
Flags: review?(ferjmoreno)
Comment 9•11 years ago
|
||
Comment on attachment 8587048 [details] [diff] [review]
unprivileged-langpacks.patch
Review of attachment 8587048 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/apps/Webapps.jsm
@@ +3900,5 @@
> + allowUnsignedLangpack =
> + Services.prefs.getBoolPref("dom.apps.allow_unsigned_langpacks");
> + } catch(e) {}
> + let isLangPack = newManifest.role === "langpack" &&
> + (aIsSigned || allowUnsignedLangpack);
nit: maybe we can avoid getting the pref if status <= maxStatus
Attachment #8587048 -
Flags: review?(ferjmoreno) → review+
| Assignee | ||
Comment 10•11 years ago
|
||
Comment 11•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
status-firefox40:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
| Assignee | ||
Comment 12•11 years ago
|
||
Comment on attachment 8587048 [details] [diff] [review]
unprivileged-langpacks.patch
NOTE: Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings.
[Approval Request Comment]
Bug caused by (feature/regressing bug #): Mis-interpretation of requirement when doing the initial implementation.
User impact if declined: Can't install langpacks from the marketplace.
Testing completed: yes, manual with existing marketplace packages.
Risk to taking this patch (and alternatives if risky): low risk, no alternative.
String or UUID changes made by this patch: none.
Attachment #8587048 -
Flags: approval-mozilla-b2g37?
Updated•11 years ago
|
Attachment #8587048 -
Flags: approval-mozilla-b2g37? → approval-mozilla-b2g37+
Comment 13•11 years ago
|
||
status-b2g-v2.2:
--- → fixed
status-b2g-master:
--- → fixed
status-firefox38:
--- → wontfix
status-firefox39:
--- → wontfix
| Reporter | ||
Comment 14•11 years ago
|
||
Thanks, Fabrice, for fixing this so quickly!
Updated•8 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•