summaryrefslogtreecommitdiff
path: root/src/core/smack-setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/smack-setup.c')
-rw-r--r--src/core/smack-setup.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/smack-setup.c b/src/core/smack-setup.c
index 73eeb04190..d67a84a583 100644
--- a/src/core/smack-setup.c
+++ b/src/core/smack-setup.c
@@ -42,6 +42,8 @@
#define SMACK_CONFIG "/etc/smack/accesses.d/"
#define CIPSO_CONFIG "/etc/smack/cipso/"
+#ifdef HAVE_SMACK
+
static int write_rules(const char* dstpath, const char* srcdir) {
_cleanup_fclose_ FILE *dst = NULL;
_cleanup_closedir_ DIR *dir = NULL;
@@ -111,8 +113,12 @@ static int write_rules(const char* dstpath, const char* srcdir) {
return r;
}
+#endif
int smack_setup(void) {
+
+#ifdef HAVE_SMACK
+
int r;
r = write_rules("/sys/fs/smackfs/load2", SMACK_CONFIG);
@@ -148,4 +154,8 @@ int smack_setup(void) {
strerror(abs(r)));
return 0;
}
+
+#endif
+
+ return 0;
}