diff options
author | Djalal Harouni <tixxdz@opendz.org> | 2014-10-25 12:30:14 +0100 |
---|---|---|
committer | Djalal Harouni <tixxdz@opendz.org> | 2014-10-25 12:30:14 +0100 |
commit | ad8ea54a3e08c32da857a4748ceb25ccbecbebd6 (patch) | |
tree | b54709a04a430b253e19c65f967195e09f60fbc7 | |
parent | 9e894108a9f022637e8150c31490094a8dc00a9a (diff) | |
download | kdbus-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.c | 7 | ||||
-rw-r--r-- | handle.c | 3 | ||||
-rw-r--r-- | kdbus.txt | 2 |
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; @@ -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 |