message: allow memfds for broadcast messages
authorDaniel Mack <daniel@zonque.org>
Wed, 22 Oct 2014 12:05:39 +0000 (14:05 +0200)
committerDaniel Mack <daniel@zonque.org>
Wed, 22 Oct 2014 12:05:39 +0000 (14:05 +0200)
As discussed on LPC.

Signed-off-by: Daniel Mack <daniel@zonque.org>
message.c

index 65c3a262631ea919c1928cde514fa0c20ec8ee63..1c5f1b023794226df800b78d55f4c5e6e8c45ff8 100644 (file)
--- a/message.c
+++ b/message.c
@@ -128,15 +128,9 @@ static int kdbus_msg_scan_items(struct kdbus_conn *conn,
        bool has_fds = false;
        struct file *f;
 
-       KDBUS_ITEMS_FOREACH(item, msg->items, KDBUS_ITEMS_SIZE(msg, items)) {
-               if (item->type == KDBUS_ITEM_PAYLOAD_MEMFD) {
-                       /* do not allow to broadcast file descriptors */
-                       if (msg->dst_id == KDBUS_DST_ID_BROADCAST)
-                               return -ENOTUNIQ;
-
+       KDBUS_ITEMS_FOREACH(item, msg->items, KDBUS_ITEMS_SIZE(msg, items))
+               if (item->type == KDBUS_ITEM_PAYLOAD_MEMFD)
                        kmsg->memfds_count++;
-               }
-       }
 
        if (kmsg->memfds_count > 0) {
                kmsg->memfds = kcalloc(kmsg->memfds_count,