selinux: rework selinux access check logic

a) Instead of parsing the bus messages inside of selinux-access.c
simply pass everything pre-parsed in the functions

b) implement the access checking with a macro that resolves to nothing
on non-selinux builds

c) split out the selinux checks into their own sources
selinux-util.[ch]

d) this unifies the job creation code behind the D-Bus calls
Manager.StartUnit() and Unit.Start().
This commit is contained in:
Lennart Poettering
2012-10-02 17:07:00 -04:00
parent 71ef24d095
commit cad45ba11e
24 changed files with 693 additions and 697 deletions
+3
View File
@@ -26,6 +26,7 @@
#include "dbus-execute.h"
#include "dbus-kill.h"
#include "dbus-common.h"
#include "selinux-access.h"
#define BUS_SOCKET_INTERFACE \
" <interface name=\"org.freedesktop.systemd1.Socket\">\n" \
@@ -138,5 +139,7 @@ DBusHandlerResult bus_socket_message_handler(Unit *u, DBusConnection *c, DBusMes
{ NULL, }
};
SELINUX_UNIT_ACCESS_CHECK(u, c, message, "status");
return bus_default_message_handler(c, message, INTROSPECTION, INTERFACES_LIST, bps);
}