New issue
Advanced search Search tips

Issue 853719 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 3
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

No error message shown for invalid JSON policy value

Project Member Reported by olsen@chromium.org, Jun 18 2018

Issue description

Using chromad, set the ManagedBookmarks policy to a simple string like:
test

(instead of a JSON string as it should be, i.e.)
{ "url": "//google.com", "name": "Google"

Go to chrome://policy and observe that the ManagedBookmarks policy does not show up at all - as if it has no value set - and there is no error message explaining what has happened.

It should show the invalid value "test" and show an error message about the malformed JSON.
 

Comment 1 by olsen@chromium.org, Jun 19 2018

Status: Started (was: Assigned)
Project Member

Comment 2 by bugdroid1@chromium.org, Jun 29 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ee12168335bb938345797e2926c83968d5ccad9a

commit ee12168335bb938345797e2926c83968d5ccad9a
Author: A Olsen <olsen@chromium.org>
Date: Fri Jun 29 12:45:29 2018

Wire JSON parsing errors to chrome://policy

cloud_policy_generated.cc parses JSON for certain policies in a
function called DecodeJSON - however, if the JSON is invalid, it
simply drops the invalid policy with no visible warning. This CL
wires errors through by adding an error field to PolicyMap.
The different possible designs are compared internally at
go/decodejsonfix

Bug:  853719 
Change-Id: I98979183ac54278710f1ac57e5a48f2a9eee0b59
Reviewed-on: https://chromium-review.googlesource.com/1104354
Reviewed-by: Pavol Marko <pmarko@chromium.org>
Reviewed-by: Lutz Justen <ljusten@chromium.org>
Commit-Queue: A Olsen <olsen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571449}
[modify] https://crrev.com/ee12168335bb938345797e2926c83968d5ccad9a/chrome/browser/policy/policy_conversions.cc
[modify] https://crrev.com/ee12168335bb938345797e2926c83968d5ccad9a/components/policy/core/common/policy_map.cc
[modify] https://crrev.com/ee12168335bb938345797e2926c83968d5ccad9a/components/policy/core/common/policy_map.h
[modify] https://crrev.com/ee12168335bb938345797e2926c83968d5ccad9a/components/policy/core/common/policy_map_unittest.cc
[modify] https://crrev.com/ee12168335bb938345797e2926c83968d5ccad9a/components/policy/tools/generate_policy_source.py

Status: Fixed (was: Started)

Sign in to add a comment