2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-22 01:57:43 +00:00
Christian Boltz f72c001643
aa-status: Fix malformed json output
In some cases (if profiles in complain and enforce mode are loaded), the
`i` loop runs more than once, which also means `j == 0` is true in the
middle of the json. This causes invalid json.

This patch fixes this.

This is a regression related to 22aa9b61615b72c20d96f8eeeac0a3f6ff0a5d1e
/ https://gitlab.com/apparmor/apparmor/-/merge_requests/964 /
https://gitlab.com/apparmor/apparmor/-/issues/295
which fixed another case of invalid json if a process was unconfined
while having a profile defined.

Note: I also tested this patch for the "unconfined, but has a profile
defined" case to ensure it doesn't break what
22aa9b61615b72c20d96f8eeeac0a3f6ff0a5d1e fixed.
2023-05-19 22:25:05 +02:00
..
2020-10-25 11:54:56 +00:00
2020-10-25 11:54:56 +00:00
2020-10-25 11:54:56 +00:00
2020-10-07 06:30:33 -07:00