chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
security: rework selinux, smack, ima, apparmor detection logic
[elogind.git]
/
src
/
shared
/
smack-util.c
diff --git
a/src/shared/smack-util.c
b/src/shared/smack-util.c
index a73eaac6de26559cce83a56020e4104be8d1f497..4e8cf796d38ffcc0d6ecc456bc69e31b259d41f9 100644
(file)
--- a/
src/shared/smack-util.c
+++ b/
src/shared/smack-util.c
@@
-21,16
+21,21
@@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "smack-util.h"
-
#include <unistd.h>
#include <unistd.h>
-static int use_smack_cached = -1;
+#include "smack-util.h"
bool use_smack(void) {
bool use_smack(void) {
+#ifdef HAVE_SMACK
+ static int use_smack_cached = -1;
+
if (use_smack_cached < 0)
if (use_smack_cached < 0)
- use_smack_cached =
(access("/sys/fs/smackfs", F_OK) >= 0)
;
+ use_smack_cached =
access("/sys/fs/smackfs/", F_OK) >= 0
;
return use_smack_cached;
return use_smack_cached;
+#else
+ return false;
+#endif
+
}
}