mirror of
https://github.com/systemd/systemd.git
synced 2025-01-11 09:18:07 +03:00
smack: set loaded_policy in smack_setup()
With loaded_policy set to true mount_setup() relabels /dev properly.
This commit is contained in:
parent
2453d7e447
commit
e49d3c0167
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user