Bug 9771 - wrong setenv() in dbus-bus.c
Summary: wrong setenv() in dbus-bus.c
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Havoc Pennington
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-26 08:08 UTC by Havoc Pennington
Modified: 2013-11-03 02:45 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Havoc Pennington 2007-01-26 08:08:45 UTC
There are two setenv() at the end of init_connections_unlocked() that look wrong.
 - DBUS_ACTIVATION_BUS_TYPE is now called DBUS_STARTER_BUS_TYPE
 - not sure whether DBUS_ACTIVATION_ADDRESS is still set or used
 - if you dbus_shutdown() then re-init, the env variables would be gone, so we need to save them permanently in some way or something
Comment 1 Simon McVittie 2011-02-28 09:18:52 UTC
(In reply to comment #0)
> There are two setenv() at the end of init_connections_unlocked() that look
> wrong.
>  - DBUS_ACTIVATION_BUS_TYPE is now called DBUS_STARTER_BUS_TYPE

Indeed.

>  - not sure whether DBUS_ACTIVATION_ADDRESS is still set or used

No, it's not (says git grep). DBUS_STARTER_ADDRESS is respected, though.

>  - if you dbus_shutdown() then re-init, the env variables would be gone, so we
> need to save them permanently in some way or something

It looks as though these setenv calls are entirely unnecessary anyway: init_connections_unlocked seems to be idempotent, and addresses_shutdown_func resets activation_bus_type and all three addresses, so they'll be re-retrieved from the environment. What was the point of the setenv calls? The commit introducing them, nearly 8 years ago, doesn't say:

commit eeb88949d8d2ca84d9cbe54c07e73b9907d3163e
Author: Havoc Pennington <hp@redhat.com>
Date:   2003-04-03 05:22:49 +0000

    2003-04-03  Havoc Pennington  <hp@pobox.com>
    
        * 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 <type> to specify well-known type
    
        * doc/dbus-specification.sgml: document the env variables to
        locate well-known buses and find service activator
Comment 2 Simon McVittie 2012-02-08 06:33:41 UTC
Havoc? Any idea why your commit eeb88949d8d2 did this?
Comment 3 Chengwei Yang 2013-10-22 13:24:06 UTC
We're on the way to remove them, #bug68308
Comment 4 Chengwei Yang 2013-11-03 02:45:05 UTC
see #bug68308


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.