mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
aa_status: separate out version info
Separate out the aa-status json version info out from being a magic element embedded in a string in the middle of the json emitter, and move it to an early location, along with a comment to edit it whenthe format changes. Signed-off-by: Steve Beattie <steve.beattie@canonical.com> Acked-by: John Johansen <john.johansen@canonical.com> https://gitlab.com/apparmor/apparmor/-/merge_requests/517
This commit is contained in:
parent
2acb93c21a
commit
3d0d0c69bc
1 changed files with 4 additions and 1 deletions
|
@ -33,6 +33,9 @@
|
|||
#define AA_EXIT_NO_PERM 4
|
||||
#define AA_EXIT_INTERNAL_ERROR 42
|
||||
|
||||
/* NOTE: Increment this whenever the JSON format changes */
|
||||
static const unsigned char aa_status_json_version[] = "2";
|
||||
|
||||
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
|
||||
|
||||
struct profile {
|
||||
|
@ -451,7 +454,7 @@ static int detailed_output(FILE *json) {
|
|||
}
|
||||
|
||||
if (json) {
|
||||
printf("{\"version\": \"2\", \"profiles\": {");
|
||||
fprintf(json, "{\"version\": \"%s\", \"profiles\": {", aa_status_json_version);
|
||||
} else {
|
||||
dprintf("%zd profiles are loaded.\n", nprofiles);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue