On Tue, 2014-02-04 at 19:03 -0300, jprvita at gmail.com wrote: > +static void hf_audio_agent_register(hf_audio_agent_data *hfdata) { > + DBusMessage *m; > + unsigned char codecs[2]; > + const unsigned char *pcodecs = codecs; s/unsigned char/uint8_t/ > static DBusMessage *hf_audio_agent_release(DBusConnection *c, DBusMessage *m, void *data) { > - DBusMessage *r = dbus_message_new_error(m, "org.ofono.Error.NotImplemented", "Operation is not implemented"); > + DBusMessage *r; > + const char *sender; > + hf_audio_agent_data *hfdata = data; > + > + pa_assert(hfdata); > + > + sender = dbus_message_get_sender(m); > + if (!pa_streq(hfdata->ofono_bus_id, sender)) { hfdata->ofono_bus_id may be NULL. > + pa_assert_se(r = dbus_message_new_error(m, "org.ofono.Error.NotAllowed", "Operation is not allowed by this sender")); > + return r; > + } > + > + r = dbus_message_new_error(m, "org.ofono.Error.NotImplemented", "Operation is not implemented"); > return r; > } > > static DBusMessage *hf_audio_agent_new_connection(DBusConnection *c, DBusMessage *m, void *data) { > - DBusMessage *r = dbus_message_new_error(m, "org.ofono.Error.NotImplemented", "Operation is not implemented"); > + DBusMessage *r; > + const char *sender; > + hf_audio_agent_data *hfdata = data; > + > + pa_assert(hfdata); > + > + sender = dbus_message_get_sender(m); > + if (!pa_streq(hfdata->ofono_bus_id, sender)) { hfdata->ofono_bus_id may be NULL. -- Tanu