From: Daniel Mack Date: Mon, 5 Jan 2015 13:32:26 +0000 (+0100) Subject: connection: handle KDBUS_MSG_SIGNAL X-Git-Tag: upstream/0.20150129.081441utc~98 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=59373e6cb1bfb686f5d74f0927409d4fd27c6ac6;p=platform%2Fcore%2Fsystem%2Fkdbus-bus.git connection: handle KDBUS_MSG_SIGNAL Add missed hunks for handling KDBUS_MSG_SIGNAL. Signed-off-by: Daniel Mack --- diff --git a/connection.c b/connection.c index 5879833..8c2e7d8 100644 --- a/connection.c +++ b/connection.c @@ -989,8 +989,8 @@ int kdbus_cmd_msg_send(struct kdbus_conn *conn_src, goto exit_unref; if (msg->flags & KDBUS_MSG_EXPECT_REPLY) { - ret = kdbus_conn_check_access(conn_src, conn_dst, msg, - NULL); + ret = kdbus_conn_check_access(conn_src, conn_dst, + msg, NULL); if (ret < 0) goto exit_unref; @@ -1000,9 +1000,20 @@ int kdbus_cmd_msg_send(struct kdbus_conn *conn_src, ret = PTR_ERR(reply_wait); goto exit_unref; } + } else if (msg->flags & KDBUS_MSG_SIGNAL) { + ret = kdbus_conn_check_access(conn_dst, conn_src, + msg, NULL); + if (ret < 0) + goto exit_unref; + + if (!kdbus_match_db_match_kmsg(conn_dst->match_db, + conn_src, kmsg)) { + ret = -EPERM; + goto exit_unref; + } } else { - ret = kdbus_conn_check_access(conn_src, conn_dst, msg, - &reply_wake); + ret = kdbus_conn_check_access(conn_src, conn_dst, + msg, &reply_wake); if (ret < 0) goto exit_unref; }