From 1e9b185b0c274ef0d684b1e43418388225321e72 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Fri, 30 Jul 2004 05:59:34 +0000 Subject: 2004-07-24 Havoc Pennington SELinux support from Matthew Rickard * bus/selinux.c, bus/selinux.h: new file encapsulating selinux functionality * configure.in: add --enable-selinux * bus/policy.c (bus_policy_merge): add FIXME to a comment * bus/main.c (main): initialize and shut down selinux * bus/connection.c: store SELinux ID on each connection, to avoid repeated getting of the string context and converting it into an ID * bus/bus.c (bus_context_get_policy): new accessor, though it isn't used (bus_context_check_security_policy): check whether the security context of sender connection can send to the security context of recipient connection * bus/config-parser.c: add parsing for and * dbus/dbus-transport.c (_dbus_transport_get_unix_fd): to implement dbus_connection_get_unix_fd() * dbus/dbus-connection.c (dbus_connection_get_unix_fd): new function, used by the selinux stuff --- bus/bus.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bus/bus.h') diff --git a/bus/bus.h b/bus/bus.h index 7d05508b..eab79347 100644 --- a/bus/bus.h +++ b/bus/bus.h @@ -38,6 +38,7 @@ typedef struct BusPolicy BusPolicy; typedef struct BusClientPolicy BusClientPolicy; typedef struct BusPolicyRule BusPolicyRule; typedef struct BusRegistry BusRegistry; +typedef struct BusSELinuxID BusSELinuxID; typedef struct BusService BusService; typedef struct BusTransaction BusTransaction; typedef struct BusMatchmaker BusMatchmaker; @@ -78,8 +79,11 @@ BusActivation* bus_context_get_activation (BusContext BusMatchmaker* bus_context_get_matchmaker (BusContext *context); DBusLoop* bus_context_get_loop (BusContext *context); DBusUserDatabase* bus_context_get_user_database (BusContext *context); + dbus_bool_t bus_context_allow_user (BusContext *context, unsigned long uid); +BusPolicy* bus_context_get_policy (BusContext *context); + BusClientPolicy* bus_context_create_client_policy (BusContext *context, DBusConnection *connection, DBusError *error); @@ -101,5 +105,4 @@ dbus_bool_t bus_context_check_security_policy (BusContext DBusMessage *message, DBusError *error); - #endif /* BUS_BUS_H */ -- cgit