smack: set loaded_policy in smack_setup()

With loaded_policy set to true mount_setup() relabels /dev properly.
This commit is contained in:
Łukasz Stelmach 2013-12-19 15:15:54 +01:00 committed by Lennart Poettering
parent 2453d7e447
commit e49d3c0167
3 changed files with 7 additions and 3 deletions

View file

@ -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);
}

View file

@ -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;

View file

@ -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);