Commit f90706d
assessor: handle escaped quotes in MOF GetValue (#1276)
The MOF format escapes inner double quotes as " inside quoted string
values. The previous GetValue() implementation searched for the next '"'
literally, which truncated values like:
DesiredObjectValue = "{"mountPoint":"/tmp"}";
to just '{\' before the JSON parser ever saw them. The compliance
engine then fell back to a key=value parser, which rejected '{' as a
key character and emitted "Invalid key: only alphanumeric and underscore
characters are allowed" once per rule with structured parameters.
Walk the string instead, honouring " and \ escape sequences, so a
JSON-encoded DesiredObjectValue arrives at UpdateUserParameters() in
its original unescaped form.
Co-authored-by: copilot <copilot@local>1 parent ef858b0 commit f90706d
1 file changed
Lines changed: 24 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
25 | 30 | | |
26 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
27 | 47 | | |
28 | | - | |
| 48 | + | |
29 | 49 | | |
30 | 50 | | |
31 | 51 | | |
| |||
0 commit comments