From 1f7ba56c9ced669951061d13b06e31d96a170e37 Mon Sep 17 00:00:00 2001 From: Jacek Bukarewicz Date: Tue, 23 Jun 2015 11:08:48 +0200 Subject: [PATCH 5/8] Perform Cynara runtime policy checks by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change introduces http://tizen.org/privilege/internal/dbus privilege which is supposed to be available only to trusted system resources. Checks for this privilege are used in place of certain allow rules to make security policy more strict. For system bus sending and receiving signals now requires http://tizen.org/privilege/internal/dbus privilege. Requesting name ownership and sending methods is still denied by default. For session bus http://tizen.org/privilege/internal/dbus privilege is now required for requesting name, calling methods, sending and receiving signals. Services are supposed to override these default settings to implement their own security policy. Cherry picked from e8610297cf7031e94eb314a2e8c11246f4405403 by Jose Bollo Updated for dbus 1.10.20 by Scott Murray and José Bollo Signed-off-by: Jacek Bukarewicz Signed-off-by: José Bollo Signed-off-by: Scott Murray --- bus/activation.c | 42 ++++++++++++++++++++++++++---------------- bus/session.conf.in | 32 ++++++++++++++++++++++++++------ bus/system.conf.in | 19 +++++++++++++++---- 3 files changed, 67 insertions(+), 26 deletions(-) diff --git a/bus/activation.c b/bus/activation.c index d4b597c..8aabeaa 100644 --- a/bus/activation.c +++ b/bus/activation.c @@ -1840,22 +1840,32 @@ bus_activation_activate_service (BusActivation *activation, } if (auto_activation && - entry != NULL && - BUS_RESULT_TRUE != bus_context_check_security_policy (activation->context, - transaction, - connection, /* sender */ - NULL, /* addressed recipient */ - NULL, /* proposed recipient */ - activation_message, - entry, - error, - NULL)) - { - _DBUS_ASSERT_ERROR_IS_SET (error); - _dbus_verbose ("activation not authorized: %s: %s\n", - error != NULL ? error->name : "(error ignored)", - error != NULL ? error->message : "(error ignored)"); - return FALSE; + entry != NULL) + { + BusResult result; + + result = bus_context_check_security_policy (activation->context, + transaction, + connection, /* sender */ + NULL, /* addressed recipient */ + NULL, /* proposed recipient */ + activation_message, + entry, + error, + NULL); + if (result == BUS_RESULT_FALSE) + { + _DBUS_ASSERT_ERROR_IS_SET (error); + _dbus_verbose ("activation not authorized: %s: %s\n", + error != NULL ? error->name : "(error ignored)", + error != NULL ? error->message : "(error ignored)"); + return FALSE; + } + if (result == BUS_RESULT_LATER) + { + /* TODO */ + _dbus_verbose ("ALERT FIX ME!!!!!!!!!!!!!!!"); + } } /* Bypass the registry lookup if we're auto-activating, bus_dispatch would not diff --git a/bus/session.conf.in b/bus/session.conf.in index affa7f1..157dfb4 100644 --- a/bus/session.conf.in +++ b/bus/session.conf.in @@ -27,12 +27,32 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/bus/system.conf.in b/bus/system.conf.in index f139b55..19d0c04 100644 --- a/bus/system.conf.in +++ b/bus/system.conf.in @@ -50,17 +50,20 @@ - + + + + - - + - + + +