Skip to content

Commit b1e522a

Browse files
committed
Add integrity value to state report
1 parent 67a68aa commit b1e522a

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- Various code cleanups, hardening, and performance optimizing
77
- Classify ELF files with an unknown interpreter as application/x-bad-elf
88
- Consolidate the fapolicyd-cli return codes
9+
- Add integrity value to state report
910

1011
1.4.2
1112
- Correct identification of kworker threads

src/daemon/fapolicyd.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,10 @@ static void close_memory_report(void)
765765

766766
void do_stat_report(FILE *f, int shutdown)
767767
{
768+
const char *ptr = lookup_integrity(config.integrity);
769+
768770
fprintf(f, "Permissive: %s\n", config.permissive ? "true" : "false");
771+
fprintf(f, "Integrity: %s\n", ptr ? ptr : "unknown");
769772
fprintf(f, "CPU cores: %ld\n", sysconf(_SC_NPROCESSORS_ONLN));
770773
fprintf(f, "q_size: %u\n", config.q_size);
771774
q_report(f);

src/library/daemon-config.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,13 @@ static int integrity_parser(const struct nv_pair *nv, int line,
631631
return 1;
632632
}
633633

634+
const char *lookup_integrity(unsigned value)
635+
{
636+
if (value > 3)
637+
return NULL;
638+
639+
return integrity_schemes[value].name;
640+
}
634641

635642
static int syslog_format_parser(const struct nv_pair *nv, int line,
636643
conf_t *config)

src/library/daemon-config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@
2929

3030
int load_daemon_config(conf_t *config);
3131
void free_daemon_config(conf_t *config);
32+
const char *lookup_integrity(unsigned value);
3233

3334
#endif

0 commit comments

Comments
 (0)