mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-25 23:21:33 +03:00
selinux: let's fully (and statically) initialize log callback union (#8512)
We can make this const and static, and initialize this ahead of time and fully, hence let's do that.
This commit is contained in:
parent
9d8c9125ed
commit
2062ada74c
@ -47,13 +47,15 @@ int mac_selinux_setup(bool *loaded_policy) {
|
||||
usec_t before_load, after_load;
|
||||
char *con;
|
||||
int r;
|
||||
union selinux_callback cb;
|
||||
static const union selinux_callback cb = {
|
||||
.func_log = null_log,
|
||||
};
|
||||
|
||||
bool initialized = false;
|
||||
|
||||
assert(loaded_policy);
|
||||
|
||||
/* Turn off all of SELinux' own logging, we want to do that */
|
||||
cb.func_log = null_log;
|
||||
selinux_set_callback(SELINUX_CB_LOG, cb);
|
||||
|
||||
/* Don't load policy in the initrd if we don't appear to have
|
||||
|
Loading…
Reference in New Issue
Block a user