summaryrefslogtreecommitdiff
path: root/src/shared/ima-util.c
blob: ae27748de4e49ca7517b2780dc671553e41da73e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* SPDX-License-Identifier: LGPL-2.1+ */
/***
  This file is part of systemd.

  Copyright 2013 Lennart Poettering
***/

#include <unistd.h>

#include "ima-util.h"

static int use_ima_cached = -1;

bool use_ima(void) {

        if (use_ima_cached < 0)
                use_ima_cached = access("/sys/kernel/security/ima/", F_OK) >= 0;

        return use_ima_cached;
}