From eeb88949d8d2ca84d9cbe54c07e73b9907d3163e Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Thu, 3 Apr 2003 05:22:49 +0000 Subject: 2003-04-03 Havoc Pennington * bus/config-parser.c (bus_config_parser_unref): free list of mechanisms, bug discovered by test suite enhancements (putting system.conf and session.conf into suite) * test/Makefile.am, test/test-service.c: add placeholder for a test service that we'll activate as part of test suite. Doesn't do anything yet. * dbus/dbus-sysdeps.c (_dbus_setenv): support unsetenv by setting NULL value, and use system malloc not dbus_malloc() when we have unavoidable memleakage. * dbus/dbus-bus.c (dbus_bus_get): fix bug where bus type of 0 didn't work, and support DBUS_BUS_ACTIVATION. * bus/activation.c (child_setup): pass our well-known bus type to the child * bus/config-parser.c: support to specify well-known type * doc/dbus-specification.sgml: document the env variables to locate well-known buses and find service activator --- bus/bus.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'bus/bus.c') diff --git a/bus/bus.c b/bus/bus.c index 82452d07..381f6317 100644 --- a/bus/bus.c +++ b/bus/bus.c @@ -36,6 +36,7 @@ struct BusContext { int refcount; + char *type; char *address; DBusList *servers; BusConnections *connections; @@ -290,6 +291,9 @@ bus_context_new (const DBusString *config_file, if (!_dbus_change_identity (creds.uid, creds.gid, error)) goto failed; } + + /* note that type may be NULL */ + context->type = _dbus_strdup (bus_config_parser_get_type (parser)); /* We have to build the address backward, so that * later in the config file have priority @@ -496,12 +500,20 @@ bus_context_unref (BusContext *context) _dbus_hash_table_unref (context->rules_by_gid); context->rules_by_gid = NULL; } - + + dbus_free (context->type); dbus_free (context->address); dbus_free (context); } } +/* type may be NULL */ +const char* +bus_context_get_type (BusContext *context) +{ + return context->type; +} + BusRegistry* bus_context_get_registry (BusContext *context) { -- cgit