summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/main.c2
-rw-r--r--src/core/smack-setup.c6
-rw-r--r--src/core/smack-setup.h2
3 files changed, 7 insertions, 3 deletions
diff --git a/src/core/main.c b/src/core/main.c
index 086e283dc6..4e24f851e2 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 611bfdb2df..a68605c272 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 ffe91843c3..892709669b 100644
--- a/src/core/smack-setup.h
+++ b/src/core/smack-setup.h
@@ -23,4 +23,4 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-int smack_setup(void);
+int smack_setup(bool *loaded_policy);