diff --git a/changes/26443-xml-comments b/changes/26443-xml-comments new file mode 100644 index 0000000000..90439da266 --- /dev/null +++ b/changes/26443-xml-comments @@ -0,0 +1 @@ +* Allow for any number of comments at the top of XML files for Windows MDM profile CSPs \ No newline at end of file diff --git a/server/fleet/windows_mdm.go b/server/fleet/windows_mdm.go index 98198c4084..adbabff60e 100644 --- a/server/fleet/windows_mdm.go +++ b/server/fleet/windows_mdm.go @@ -96,6 +96,9 @@ func (m *MDMWindowsConfigProfile) ValidateUserProvided() error { case xml.ProcInst: return errors.New("The file should include valid XML: processing instructions are not allowed.") + case xml.Comment: + continue + case xml.StartElement: switch t.Name.Local { case "Replace", "Add": diff --git a/server/fleet/windows_mdm_test.go b/server/fleet/windows_mdm_test.go index 0a16717546..2738e703fa 100644 --- a/server/fleet/windows_mdm_test.go +++ b/server/fleet/windows_mdm_test.go @@ -411,7 +411,9 @@ func TestValidateUserProvided(t *testing.T) { profile: MDMWindowsConfigProfile{ SyncML: []byte(` + + Custom/URI