path: root/include
diff options
authorDaniel Wagner <>2012-11-02 16:26:13 (GMT)
committerDaniel Wagner <>2012-11-23 12:47:22 (GMT)
commit861a04bab6b19cb275c137f1cdfe559879a79565 (patch)
treeb0a89b78ba7e6549bb8a1e3e47f071b3f26952b8 /include
parentdb4b9c326ebc4dda44a72b6832382301920925be (diff)
dbus: Add SELinux support
ConnMan needs to identify application in a secure way when they are using the Session API. The current D-Bus server implemention supports two types of LSM, POSIX and SELinux. In order to support SMACK or TOMOYO the D-Bus code base needs to be patch. This is the initial work to support at least POSIX and SELinux. Maybe in the future we are able to support also the other LSMs. The idea behind gsec is to keep the LSM related code together in one directory. The API introduces in this patch is not any way final. It will need some more time figuring out how are able to intregrate this in a nice way. The current API introduces g_sec_get_selinux_label() which will return the SELinux context. The function will issuing a GetConnectionSELinuxSecurityContext method call. Note, that this function is not documented in the D-Bus specification. See for more details the source code dbus/bus/drivers.c and dbus/bus/selinux.c in the D-Bus reference implementation.
Diffstat (limited to 'include')
1 files changed, 8 insertions, 0 deletions
diff --git a/include/dbus.h b/include/dbus.h
index bf5f8c1..c00488e 100644
--- a/include/dbus.h
+++ b/include/dbus.h
@@ -171,6 +171,14 @@ static inline void connman_dbus_dict_append_fixed_array(DBusMessageIter *dict,
dbus_bool_t connman_dbus_validate_ident(const char *ident);
char *connman_dbus_encode_string(const char *value);
+typedef void (* connman_dbus_get_context_cb_t) (const unsigned char *context,
+ void *user_data, int err);
+int connman_dbus_get_selinux_context(DBusConnection *connection,
+ const char *service,
+ connman_dbus_get_context_cb_t func,
+ void *user_data);
#ifdef __cplusplus