日期:2014-05-16  浏览次数:20814 次

关于DBUS建立连接的问题
请教各位大侠一个问题:
使用dbus进行进程通信时,建立一个连接,如
DBusConnection **ppstDBusConn;
DBusError err;
*ppstDBusConn = dbus_bus_get(DBUS_BUS_SYSTEM, &err); 

在dbus_bus_request_name(*ppstDBusConn, "com.app.player", DBUS_NAME_FLAG_REPLACE_EXISTING , &err); 后报如下错误:
Connection ":01" is not allowed to own the service "com.app.player" due to security policies in the configuration file

请问这是因为在dbus_bus_get()时使用了参数DBUS_BUS_SYSTEM的原因吗?怎样使得连接":01" 有权获取服务"com.app.player"?
谢谢!


------解决方案--------------------
不是使用参数DBUS_BUS_SYSTEM的原因!
修改dbus配置文件即可