summaryrefslogtreecommitdiff
path: root/bus/bus.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2012-01-04 17:44:23 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2012-01-04 17:44:23 +0000
commit5df8c3db12590edd68e968975a335da9d0415e5a (patch)
treedf1452c78f549722ccc8d8c3b1b7ac047a494681 /bus/bus.c
parent5ec835dac93a084ff5f697a9b83b640689462e00 (diff)
downloaddbus-5df8c3db12590edd68e968975a335da9d0415e5a.tar.gz
Revert all changes since a36d4918a6f646e085
Someone seems to have merged part of master into 1.4. Again. Let's go back to the "last known good" point (the branch-point of some 1.4 branches I had locally), then we can cherry-pick the changes that should have gone in.
Diffstat (limited to 'bus/bus.c')
-rw-r--r--bus/bus.c43
1 files changed, 39 insertions, 4 deletions
diff --git a/bus/bus.c b/bus/bus.c
index 748ee90a..6b0dc088 100644
--- a/bus/bus.c
+++ b/bus/bus.c
@@ -103,6 +103,19 @@ server_get_context (DBusServer *server)
}
static dbus_bool_t
+server_watch_callback (DBusWatch *watch,
+ unsigned int condition,
+ void *data)
+{
+ /* FIXME this can be done in dbus-mainloop.c
+ * if the code in activation.c for the babysitter
+ * watch handler is fixed.
+ */
+
+ return dbus_watch_handle (watch, condition);
+}
+
+static dbus_bool_t
add_server_watch (DBusWatch *watch,
void *data)
{
@@ -111,7 +124,9 @@ add_server_watch (DBusWatch *watch,
context = server_get_context (server);
- return _dbus_loop_add_watch (context->loop, watch);
+ return _dbus_loop_add_watch (context->loop,
+ watch, server_watch_callback, server,
+ NULL);
}
static void
@@ -123,7 +138,17 @@ remove_server_watch (DBusWatch *watch,
context = server_get_context (server);
- _dbus_loop_remove_watch (context->loop, watch);
+ _dbus_loop_remove_watch (context->loop,
+ watch, server_watch_callback, server);
+}
+
+
+static void
+server_timeout_callback (DBusTimeout *timeout,
+ void *data)
+{
+ /* can return FALSE on OOM but we just let it fire again later */
+ dbus_timeout_handle (timeout);
}
static dbus_bool_t
@@ -135,7 +160,8 @@ add_server_timeout (DBusTimeout *timeout,
context = server_get_context (server);
- return _dbus_loop_add_timeout (context->loop, timeout);
+ return _dbus_loop_add_timeout (context->loop,
+ timeout, server_timeout_callback, server, NULL);
}
static void
@@ -147,7 +173,8 @@ remove_server_timeout (DBusTimeout *timeout,
context = server_get_context (server);
- _dbus_loop_remove_timeout (context->loop, timeout);
+ _dbus_loop_remove_timeout (context->loop,
+ timeout, server_timeout_callback, server);
}
static void
@@ -481,6 +508,7 @@ process_config_every_time (BusContext *context,
DBusString full_address;
DBusList *link;
DBusList **dirs;
+ BusActivation *new_activation;
char *addr;
const char *servicehelper;
char *s;
@@ -687,6 +715,7 @@ bus_context_new (const DBusString *config_file,
dbus_bool_t systemd_activation,
DBusError *error)
{
+ DBusString log_prefix;
BusContext *context;
BusConfigParser *parser;
@@ -1391,6 +1420,9 @@ bus_context_check_security_policy (BusContext *context,
dbus_bool_t log;
int type;
dbus_bool_t requested_reply;
+ const char *sender_name;
+ const char *sender_loginfo;
+ const char *proposed_recipient_loginfo;
type = dbus_message_get_type (message);
dest = dbus_message_get_destination (message);
@@ -1556,6 +1588,9 @@ bus_context_check_security_policy (BusContext *context,
proposed_recipient,
message, &toggles, &log))
{
+ const char *msg = "Rejected send message, %d matched rules; "
+ "type=\"%s\", sender=\"%s\" (%s) interface=\"%s\" member=\"%s\" error name=\"%s\" requested_reply=%d destination=\"%s\" (%s))";
+
complain_about_message (context, DBUS_ERROR_ACCESS_DENIED,
"Rejected send message", toggles,
message, sender, proposed_recipient, requested_reply,