Closed Bug 1666836 Opened 1 month ago Closed 1 month ago

Legacy boolean preferences don't work in GPO or macOS

Categories

(Firefox :: Enterprise Policies, defect, P1)

defect

Tracking

()

VERIFIED FIXED
83 Branch
Tracking Status
relnote-firefox --- 81+
firefox-esr78 81+ verified
firefox81 + verified
firefox82 + verified
firefox83 + verified

People

(Reporter: mkaply, Assigned: mkaply)

References

Details

Attachments

(1 file, 1 obsolete file)

When I moved to the new preferences model, I put in code for handling legacy preferences, but I missed the fact that we were using the explicit schema type (boolean) to allow 0/1 to be converted to a boolean before it was passed to the preferences APIs.

As a result, we are now trying to get the prefs with a 0/1 value which isn't working.

[Tracking Requested - why for this release]: If we do a dot release, we'll need to fix this. I'm not sure how wide spread it is yet.

Pushed by mozilla@kaply.com:
https://hg.mozilla.org/integration/autoland/rev/fe060ab6199d
Set bools correct with legacy preferences. r=emalysz
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch

Comment on attachment 9177441 [details]
Bug 1666836 - Set bools correct with legacy preferences. r?emalysz!

Beta/Release Uplift Approval Request

  • User impact if declined: Legacy preference policy doesn't work correctly.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Automated test, policy only.
  • String changes made/needed:

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Policy related fix.
  • User impact if declined: Legacy preference policy doesn't work correctly.
  • Fix Landed on Version: 83
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Automated test, policy only.
  • String or UUID changes made by this patch:
Attachment #9177441 - Flags: approval-mozilla-release?
Attachment #9177441 - Flags: approval-mozilla-esr78?
Attachment #9177441 - Flags: approval-mozilla-beta?

If we're thinking we should take this in a dot release, we should also probably get QA to give this a test when they get a chance.

Flags: qe-verify+
Flags: in-testsuite+

Good call.

So to test, install the Firefox ADMX from here on Windows:

https://github.com/mozilla/policy-templates/releases/tag/v2.3

And verify that any of the boolean Preferences in the Preferences category properly set and lock their values.

For example:

geo.enabled

Comment on attachment 9177441 [details]
Bug 1666836 - Set bools correct with legacy preferences. r?emalysz!

Approved for 82.0b3 so we can get some wider testing. I'd still feel better if we were able to do more exploratory testing around this before shipping it in dot releases.

Attachment #9177441 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [qa-triaged]

This is a worse problem than I realized. macOS converts everything to 0/1 as well. Unfortunately we don't have good mobileconfig tests either.

I have a more inclusive patch and I'm adding tests to handle the 0/1 case.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Summary: Legacy boolean preferences don't work in GPO → Legacy boolean preferences don't work in GPO/Legacy and new prefs don't work on macOS
Attachment #9177995 - Attachment description: Bug 1666836 - Treat 0/1 as boolean in policy unless there is an existing int type. r?emalysz! → Bug 1666836 - Treat 0/1 as boolean in policy unless there is an existing int pref. r?emalysz!

It seems to affect also the enterprise policies.
For example the policy "extensions.blocklist.enabled":1 is not applied any more since 81.

Target Milestone: 83 Branch → ---
Pushed by mozilla@kaply.com:
https://hg.mozilla.org/integration/autoland/rev/f9ad61f28238
Treat 0/1 as boolean in policy unless there is an existing int pref. r=emalysz
Backout by csabou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7e9c740d3bd7
Backed out changeset f9ad61f28238 for bc failures on browser_policies_setAndLockPref_API.js. CLOSED TREE

I'm closing this because the first patch fixed this problem and stands alone. I'm going to open a new bug for the second issue.

Status: REOPENED → RESOLVED
Closed: 1 month ago1 month ago
Flags: needinfo?(mozilla)
Resolution: --- → FIXED
Summary: Legacy boolean preferences don't work in GPO/Legacy and new prefs don't work on macOS → Legacy boolean preferences don't work in GPO or macOS
Target Milestone: --- → 83 Branch

Comment on attachment 9177995 [details]
Bug 1666836 - Treat 0/1 as boolean in policy unless there is an existing int pref. r?emalysz!

This is being moved to a new bug.

Attachment #9177995 - Attachment is obsolete: true

Comment on attachment 9177441 [details]
Bug 1666836 - Set bools correct with legacy preferences. r?emalysz!

Approved for 81.0.1 and 78.3.1esr.

Attachment #9177441 - Flags: approval-mozilla-release?
Attachment #9177441 - Flags: approval-mozilla-release+
Attachment #9177441 - Flags: approval-mozilla-esr78?
Attachment #9177441 - Flags: approval-mozilla-esr78+

I have managed to reproduce this issue using Firefox 81.0 (BuildId:20200917005511) on Windows 10 64bit by encountering the "Error running" policy error for some boolean preferences (from the GPO legacy Preferences category folder).

This issue seems to be fixed using Firefox 82.0b4 (BuildId:20200926073307) and Firefox 83.0a1 (BuildId:20200928212824).

Windows: I've went through the majority of the legacy Preferences displayed inside the Preferences folder via GPO and verified the following preferences states:

  • Verified the Locked to Enabled state (1)
  • Verified the Locked to Disabled state (0)
  • Verified the Disabled state (0) (no effect state - where applicable)

macOS 10.13: I've set up a mobileconfig file which contained several legacy preferences (browser.urlbar.suggest.openpage , dom.allow_scripts_to_close_windows and network.dns.disableIPv6) and it worked for me (the preferences are successfully locked to true/false.

Leaving a ni? on myself to verify this once it lands in other versions as well.

Added to the Firefox 81.0.1 and 78.3.1esr relnotes:

Fixed legacy preferences not being properly applied when set via GPO

Duplicate of this bug: 1667757

This issue is verified fixed using Firefox 81.0.1 (BuildId: 20200930150533) and Firefox 78.3.1esr (BuildId:20200929151419) on Windows 10 64bit (via GPO) and macOS 10.13 (via mobileconfig)

Status: RESOLVED → VERIFIED
Flags: qe-verify+
Flags: needinfo?(emil.ghitta)
You need to log in before you can comment on or make changes to this bug.