DBus Over multiple machines
Willem Dantuma
willem.dantuma@dobs.nl
19 Dec 2003 16:37:39 +0100
On Fri, 2003-12-19 at 15:45, Jason Keirstead wrote:
> Ok, I get how to set the username and password functions for the connecting
> client.
>
> I do not, however, see how I set what usernames and passwords are authorized
> on the server end. Do you have to call something after dbus_bus_register ?
You don't call dbus_bus_register on the server end
Do you connect to a d-bus bus ( daemon ) or did you write your own
server ?
Authorization in the bus is done by setting a policy in the
configuration file ( see the system.conf )
If you wrote your own server you have to register a checking function
with the connection.
---------------
static dbus_bool_t
allow_user_function (DBusConnection *connection,
unsigned long uid,
void *data)
{
if(uid == <your userid>)
return TRUE;
return FALSE;
}
dbus_connection_set_unix_user_function (connection,
allow_user_function,
NULL, NULL);
---------------
Willem