summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDjalal Harouni <tixxdz@opendz.org>2014-10-25 12:30:14 +0100
committerDjalal Harouni <tixxdz@opendz.org>2014-10-25 12:30:14 +0100
commitad8ea54a3e08c32da857a4748ceb25ccbecbebd6 (patch)
treeb54709a04a430b253e19c65f967195e09f60fbc7
parent9e894108a9f022637e8150c31490094a8dc00a9a (diff)
downloadkdbus-bus-ad8ea54a3e08c32da857a4748ceb25ccbecbebd6.tar.gz
kdbus-bus-ad8ea54a3e08c32da857a4748ceb25ccbecbebd6.tar.bz2
kdbus-bus-ad8ea54a3e08c32da857a4748ceb25ccbecbebd6.zip
connection: make KDBUS_CMD_CONN_UPDATE ioctl available for monitor connections
Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
-rw-r--r--connection.c7
-rw-r--r--handle.c3
-rw-r--r--kdbus.txt2
3 files changed, 7 insertions, 5 deletions
diff --git a/connection.c b/connection.c
index 9e84b45f852..771fdafb7f9 100644
--- a/connection.c
+++ b/connection.c
@@ -1377,9 +1377,10 @@ int kdbus_cmd_conn_update(struct kdbus_conn *conn,
KDBUS_ITEMS_FOREACH(item, cmd->items, KDBUS_ITEMS_SIZE(cmd, items)) {
switch (item->type) {
case KDBUS_ITEM_ATTACH_FLAGS:
- /* Only ordinary connections may update their
- * attach-flags */
- if (!kdbus_conn_is_connected(conn))
+ /* Only ordinary or monitor connections
+ * may update their attach-flags */
+ if (!kdbus_conn_is_connected(conn) &&
+ !kdbus_conn_is_monitor(conn))
return -EOPNOTSUPP;
flags_provided = true;
diff --git a/handle.c b/handle.c
index dabafad7b26..97259494910 100644
--- a/handle.c
+++ b/handle.c
@@ -886,7 +886,8 @@ static long kdbus_handle_ioctl_ep_connected(struct file *file, unsigned int cmd,
struct kdbus_cmd_update *cmd_update;
if (!kdbus_conn_is_connected(conn) &&
- !kdbus_conn_is_policy_holder(conn)) {
+ !kdbus_conn_is_policy_holder(conn) &&
+ !kdbus_conn_is_monitor(conn)) {
ret = -EOPNOTSUPP;
break;
}
diff --git a/kdbus.txt b/kdbus.txt
index 00ee9dd9fa7..b491293acc2 100644
--- a/kdbus.txt
+++ b/kdbus.txt
@@ -1790,7 +1790,7 @@ For KDBUS_CMD_CONN_INFO:
For KDBUS_CMD_CONN_UPDATE:
-EINVAL Illegal flags or items
- -EOPNOTSUPP Connection is not attached to bus
+ -EOPNOTSUPP Operation not supported by connection.
-E2BIG Too many policy items attached
-EINVAL Wildcards submitted in policy entries, or illegal sequence
of policy items