names: don't refuse unknown flags
authorDaniel Mack <daniel@zonque.org>
Mon, 6 Oct 2014 12:28:19 +0000 (14:28 +0200)
committerDaniel Mack <daniel@zonque.org>
Mon, 6 Oct 2014 12:28:19 +0000 (14:28 +0200)
We need to allow for forward-compat, so just ignore invalid flags in
kdbus_cmd_name_acquire().

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

diff --git a/names.c b/names.c
index d01ca801f9eed66e9728dc8e0b078b38ec0bad99..d88ef5f8ad1a749419129b898424a5a519db776b 100644 (file)
--- a/names.c
+++ b/names.c
@@ -640,19 +640,11 @@ int kdbus_cmd_name_acquire(struct kdbus_name_registry *reg,
 {
        struct kdbus_name_entry *e = NULL;
        const char *name;
-       u64 allowed;
        int ret;
 
        if (conn->name_count > KDBUS_CONN_MAX_NAMES)
                return -E2BIG;
 
-       /* refuse improper flags when requesting */
-       allowed = KDBUS_NAME_REPLACE_EXISTING  |
-                 KDBUS_NAME_ALLOW_REPLACEMENT |
-                 KDBUS_NAME_QUEUE;
-       if ((cmd->flags & ~allowed) != 0)
-               return -EINVAL;
-
        ret = kdbus_items_get_str(cmd->items, KDBUS_ITEMS_SIZE(cmd, items),
                                  KDBUS_ITEM_NAME, &name);
        if (ret < 0)