From 5a827a287451d9916a6bcb6eae90770add971be9 Mon Sep 17 00:00:00 2001 From: José Bollo Date: Mon, 29 Jan 2018 16:18:10 +0100 Subject: dbus-cynara: Upgrade to 1.10.20 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The main patches from dbus to make it cynara aware are cherry-picked on top of the dbus 1.10.20 that is the upstream version for rocko. Change-Id: Ib7b07f335543cb56c4c96ef8f55305e61bc69b5c Signed-off-by: José Bollo --- ...onnectionSmackContext-D-Bus-daemon-method.patch | 99 ++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 meta-security/recipes-core/dbus-cynara/dbus-cynara/0008-Add-GetConnectionSmackContext-D-Bus-daemon-method.patch (limited to 'meta-security/recipes-core/dbus-cynara/dbus-cynara/0008-Add-GetConnectionSmackContext-D-Bus-daemon-method.patch') diff --git a/meta-security/recipes-core/dbus-cynara/dbus-cynara/0008-Add-GetConnectionSmackContext-D-Bus-daemon-method.patch b/meta-security/recipes-core/dbus-cynara/dbus-cynara/0008-Add-GetConnectionSmackContext-D-Bus-daemon-method.patch new file mode 100644 index 000000000..43a1ef658 --- /dev/null +++ b/meta-security/recipes-core/dbus-cynara/dbus-cynara/0008-Add-GetConnectionSmackContext-D-Bus-daemon-method.patch @@ -0,0 +1,99 @@ +From 6c9997fb1cdff4281166e8c2fb8276018b1025dd Mon Sep 17 00:00:00 2001 +From: Jacek Bukarewicz +Date: Mon, 15 Jun 2015 11:46:47 +0200 +Subject: [PATCH 8/8] Add "GetConnectionSmackContext" D-Bus daemon method + +This method is used to obtain smack label of given D-Bus client. +Note that it is deprecated and is included only for compatilibity with +existing D-Bus users. GetConnectionCredentials should be used to obtain +client's credentials. + +Change-Id: Idf9648032ca5cbd9605ffab055e6384baa4eb9b4 +--- + bus/driver.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 63 insertions(+) + +diff --git a/bus/driver.c b/bus/driver.c +index 9708f49..4e76224 100644 +--- a/bus/driver.c ++++ b/bus/driver.c +@@ -1759,6 +1759,65 @@ bus_driver_handle_get_id (DBusConnection *connection, + return BUS_RESULT_FALSE; + } + ++static BusResult ++bus_driver_handle_get_connection_smack_context (DBusConnection *connection, ++ BusTransaction *transaction, ++ DBusMessage *message, ++ DBusError *error) ++{ ++ DBusConnection *conn; ++ DBusMessage *reply = NULL; ++ char *label = NULL; ++ const char *service; ++ ++ _DBUS_ASSERT_ERROR_IS_CLEAR (error); ++ ++ conn = bus_driver_get_conn_helper (connection, message, "credentials", ++ &service, error); ++ if (conn == NULL) ++ goto err; ++ ++ reply = dbus_message_new_method_return (message); ++ if (reply == NULL) ++ goto oom; ++ ++ if (!_dbus_connection_get_linux_security_label (conn, &label)) ++ { ++ dbus_set_error (error, DBUS_ERROR_FAILED, ++ "Failed to get smack label of connection", ++ conn); ++ goto err; ++ } ++ ++ if (label == NULL) ++ goto oom; ++ ++ if (!dbus_message_append_args (reply, ++ DBUS_TYPE_STRING, &label, ++ DBUS_TYPE_INVALID)) ++ goto oom; ++ ++ if (!bus_transaction_send_from_driver (transaction, connection, reply)) ++ goto oom; ++ ++ dbus_message_unref (reply); ++ dbus_free(label); ++ ++ return BUS_RESULT_TRUE; ++ ++oom: ++ BUS_SET_OOM (error); ++ ++err: ++ if (reply != NULL) ++ dbus_message_unref (reply); ++ ++ dbus_free(label); ++ ++ return BUS_RESULT_FALSE; ++} ++ ++ + typedef struct + { + const char *name; +@@ -1849,6 +1908,10 @@ static const MessageHandler dbus_message_handlers[] = { + bus_driver_handle_get_id }, + { "GetConnectionCredentials", "s", "a{sv}", + bus_driver_handle_get_connection_credentials }, ++ { "GetConnectionSmackContext", /* deprecated - you should use GetConnectionCredentials instead */ ++ DBUS_TYPE_STRING_AS_STRING, ++ DBUS_TYPE_STRING_AS_STRING, ++ bus_driver_handle_get_connection_smack_context }, + { NULL, NULL, NULL, NULL } + }; + +-- +2.1.4 + -- cgit 1.2.3-korg