diff options
author | Vinicius Costa Gomes <vinicius.gomes@openbossa.org> | 2013-03-25 19:05:20 -0300 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2013-03-26 23:24:18 -0500 |
commit | 798ff5887ba95609cd12a0d5955ca60d33888029 (patch) | |
tree | 0567eef532bf6f77f2f2ff8fddaa60cab1db0e4b /src/handsfree-audio.c | |
parent | cc5a86f1dbd6cd78efeaa859cfddad646d8b8065 (diff) | |
download | ofono-798ff5887ba95609cd12a0d5955ca60d33888029.tar.bz2 |
handsfree-audio: Reject .Connect() from other senders
Only the agent should be able to call .Connect() on the card.
Diffstat (limited to 'src/handsfree-audio.c')
-rw-r--r-- | src/handsfree-audio.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c index 4232074f..f8df6d61 100644 --- a/src/handsfree-audio.c +++ b/src/handsfree-audio.c @@ -312,11 +312,17 @@ static DBusMessage *card_connect(DBusConnection *conn, { struct ofono_handsfree_card *card = data; GIOChannel *io; + const char *sender; int sk; if (agent == NULL) return __ofono_error_not_available(msg); + sender = dbus_message_get_sender(msg); + + if (!g_str_equal(sender, agent->owner)) + return __ofono_error_not_allowed(msg); + if (card->msg) return __ofono_error_busy(msg); |