diff options
author | Karol Lewandowski <k.lewandowsk@samsung.com> | 2013-05-16 10:40:03 +0200 |
---|---|---|
committer | Auke Kok <auke-jan.h.kok@intel.com> | 2013-05-17 09:58:28 -0700 |
commit | 2b3e18de74ca89b374dd4f7a2c30e5731d347841 (patch) | |
tree | 305669069e73f82fd838117c93709dce7d0b0b3f /src/core/smack-setup.c | |
parent | 264ad849a4a0acf1ca392da62b7018d4fe7b66b3 (diff) |
Make it possible to disable smack separately from xattr support
Additionally, compile out rule loading if feature is disabled.
Diffstat (limited to 'src/core/smack-setup.c')
-rw-r--r-- | src/core/smack-setup.c | 10 |
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; } |