Lines 3654-3659
_dbus_lookup_session_address_launchd (DBusString *address, DBusError *error)
Link Here
|
3654 |
#endif |
3654 |
#endif |
3655 |
|
3655 |
|
3656 |
/** |
3656 |
/** |
|
|
3657 |
* Sets up the custom session bus address. |
3658 |
* |
3659 |
* This function is tend to be used by setuid/setgid |
3660 |
* programs to explicitly set up the desired bus address. |
3661 |
* To avoid security violations the address should be first |
3662 |
* carefully checked. |
3663 |
*/ |
3664 |
|
3665 |
static const char *custom_session_address = NULL; |
3666 |
void |
3667 |
dbus_setup_session_address(const char *addr) |
3668 |
{ |
3669 |
custom_session_address = addr; |
3670 |
} |
3671 |
|
3672 |
/** |
3657 |
* Determines the address of the session bus by querying a |
3673 |
* Determines the address of the session bus by querying a |
3658 |
* platform-specific method. |
3674 |
* platform-specific method. |
3659 |
* |
3675 |
* |
Lines 3681-3691
_dbus_lookup_session_address (dbus_bool_t *supported,
Link Here
|
3681 |
*supported = TRUE; |
3697 |
*supported = TRUE; |
3682 |
return _dbus_lookup_session_address_launchd (address, error); |
3698 |
return _dbus_lookup_session_address_launchd (address, error); |
3683 |
#else |
3699 |
#else |
3684 |
/* On non-Mac Unix platforms, if the session address isn't already |
3700 |
if (!custom_session_address) |
3685 |
* set in DBUS_SESSION_BUS_ADDRESS environment variable, we punt and |
3701 |
*supported = FALSE; |
3686 |
* fall back to the autolaunch: global default; see |
3702 |
else |
3687 |
* init_session_address in dbus/dbus-bus.c. */ |
3703 |
{ |
3688 |
*supported = FALSE; |
3704 |
*supported = TRUE; |
|
|
3705 |
if (!_dbus_string_append (address, custom_session_address)) |
3706 |
{ |
3707 |
_DBUS_SET_OOM (error); |
3708 |
return FALSE; |
3709 |
} |
3710 |
} |
3689 |
return TRUE; |
3711 |
return TRUE; |
3690 |
#endif |
3712 |
#endif |
3691 |
} |
3713 |
} |