Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
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;
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;
}
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