]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
d682b3a7 LP |
2 | /*** |
3 | This file is part of systemd. | |
4 | ||
5 | Copyright 2013 Lennart Poettering | |
6 | ||
7 | systemd is free software; you can redistribute it and/or modify it | |
8 | under the terms of the GNU Lesser General Public License as published by | |
9 | the Free Software Foundation; either version 2.1 of the License, or | |
10 | (at your option) any later version. | |
11 | ||
12 | systemd is distributed in the hope that it will be useful, but | |
13 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | Lesser General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU Lesser General Public License | |
18 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
19 | ***/ | |
20 | ||
21 | #include <unistd.h> | |
22 | ||
5a045dad | 23 | #include "ima-util.h" |
d682b3a7 LP |
24 | |
25 | static int use_ima_cached = -1; | |
26 | ||
27 | bool use_ima(void) { | |
28 | ||
29 | if (use_ima_cached < 0) | |
30 | use_ima_cached = access("/sys/kernel/security/ima/", F_OK) >= 0; | |
31 | ||
32 | return use_ima_cached; | |
33 | } |