summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2012-11-02 17:26:13 +0100
committerDaniel Wagner <daniel.wagner@bmw-carit.de>2012-11-23 13:47:22 +0100
commit861a04bab6b19cb275c137f1cdfe559879a79565 (patch)
treeb0a89b78ba7e6549bb8a1e3e47f071b3f26952b8 /include
parentdb4b9c326ebc4dda44a72b6832382301920925be (diff)
downloadconnman-861a04bab6b19cb275c137f1cdfe559879a79565.tar.gz
connman-861a04bab6b19cb275c137f1cdfe559879a79565.tar.bz2
connman-861a04bab6b19cb275c137f1cdfe559879a79565.zip
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')
-rw-r--r--include/dbus.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/dbus.h b/include/dbus.h
index bf5f8c14..c00488e2 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
}
#endif