label: Introduce LabelOps to do pre/post labelling operations

By default, label_ops is initialized with a NULL pointer which translates
to noop labelling operations. In mac_selinux_init() and the new mac_smack_init(),
we initialize label_ops with a MAC specific LabelOps pointer.

We also introduce mac_init() to initialize any configured MACs and replace all
usages of mac_selinux_init() with mac_init().
This commit is contained in:
Daan De Meyer
2023-05-31 13:15:53 +02:00
parent 0690160e2c
commit a452c807a4
25 changed files with 120 additions and 20 deletions
+1 -1
View File
@@ -2178,7 +2178,7 @@ static int run(int argc, char *argv[]) {
umask(0022);
r = mac_selinux_init();
r = mac_init();
if (r < 0)
return r;