From 2b3e18de74ca89b374dd4f7a2c30e5731d347841 Mon Sep 17 00:00:00 2001 From: Karol Lewandowski Date: Thu, 16 May 2013 10:40:03 +0200 Subject: Make it possible to disable smack separately from xattr support Additionally, compile out rule loading if feature is disabled. --- src/core/smack-setup.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/core/smack-setup.c') diff --git a/src/core/smack-setup.c b/src/core/smack-setup.c index 73eeb0419..d67a84a58 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; } -- cgit v1.2.3