aboutsummaryrefslogtreecommitdiff
path: root/nscd/nscd_stat.c
diff options
context:
space:
mode:
Diffstat (limited to 'nscd/nscd_stat.c')
-rw-r--r--nscd/nscd_stat.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/nscd/nscd_stat.c b/nscd/nscd_stat.c
index ebdfeac..3e3be5b 100644
--- a/nscd/nscd_stat.c
+++ b/nscd/nscd_stat.c
@@ -29,6 +29,12 @@
#include "nscd.h"
#include "dbg_log.h"
+#include "selinux.h"
+#ifdef HAVE_SELINUX
+# include <selinux/selinux.h>
+# include <selinux/avc.h>
+#endif /* HAVE_SELINUX */
+
/* We use this to make sure the receiver is the same. */
static const char compilation[21] = __DATE__ " " __TIME__;
@@ -71,6 +77,9 @@ struct statdata
unsigned long int client_queued;
int ndbs;
struct dbstat dbs[lastdb];
+#ifdef HAVE_SELINUX
+ struct avc_cache_stats cstats;
+#endif /* HAVE_SELINUX */
};
@@ -113,6 +122,9 @@ send_stats (int fd, struct database_dyn dbs[lastdb])
}
}
+ if (selinux_enabled)
+ nscd_avc_cache_stats (&data.cstats);
+
if (TEMP_FAILURE_RETRY (write (fd, &data, sizeof (data))) != sizeof (data))
{
char buf[256];
@@ -276,6 +288,9 @@ receive_print_stats (void)
data.dbs[i].addfailed, check_file, dbnames[i]);
}
+ if (selinux_enabled)
+ nscd_avc_print_stats (&data.cstats);
+
close (fd);
exit (0);