summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorƁukasz Stelmach <l.stelmach@samsung.com>2013-12-19 15:15:54 +0100
committerLennart Poettering <lennart@poettering.net>2014-02-24 17:36:13 +0100
commite49d3c016751c03e544697656e8e596af8a664d7 (patch)
treef9bf2c589b1a3b8d70c019355aa553b042f5c7cd /src
parentsmack: relabel directories and files created by systemd (diff)
downloadsystemd-e49d3c016751c03e544697656e8e596af8a664d7.tar.xz
systemd-e49d3c016751c03e544697656e8e596af8a664d7.zip
smack: set loaded_policy in smack_setup()
With loaded_policy set to true mount_setup() relabels /dev properly.
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);