From: Ɓukasz Stelmach Date: Thu, 19 Dec 2013 14:15:54 +0000 (+0100) Subject: smack: set loaded_policy in smack_setup() X-Git-Tag: v210~7 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=e49d3c016751c03e544697656e8e596af8a664d7 smack: set loaded_policy in smack_setup() With loaded_policy set to true mount_setup() relabels /dev properly. --- diff --git a/src/core/main.c b/src/core/main.c index 086e283dc..4e24f851e 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -1310,7 +1310,7 @@ int main(int argc, char *argv[]) { goto finish; if (ima_setup() < 0) goto finish; - if (smack_setup() < 0) + if (smack_setup(&loaded_policy) < 0) goto finish; dual_timestamp_get(&security_finish_timestamp); } diff --git a/src/core/smack-setup.c b/src/core/smack-setup.c index 611bfdb2d..a68605c27 100644 --- a/src/core/smack-setup.c +++ b/src/core/smack-setup.c @@ -116,12 +116,14 @@ static int write_rules(const char* dstpath, const char* srcdir) { #endif -int smack_setup(void) { +int smack_setup(bool *loaded_policy) { #ifdef HAVE_SMACK int r; + assert(loaded_policy); + r = write_rules("/sys/fs/smackfs/load2", SMACK_CONFIG); switch(r) { case -ENOENT: @@ -163,6 +165,8 @@ int smack_setup(void) { return 0; } + *loaded_policy = true; + #endif return 0; diff --git a/src/core/smack-setup.h b/src/core/smack-setup.h index ffe91843c..892709669 100644 --- a/src/core/smack-setup.h +++ b/src/core/smack-setup.h @@ -23,4 +23,4 @@ along with systemd; If not, see . ***/ -int smack_setup(void); +int smack_setup(bool *loaded_policy);