Fix a bug introcuded in commit
d92d68414fab which fixed another bug.
conn->attach_flags should only be update if KDBUS_ITEM_ATTACH_FLAGS was
provided.
Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
{
const struct kdbus_item *item;
bool policy_provided = false;
+ bool flags_provided = false;
u64 attach_flags = 0;
int ret;
switch (item->type) {
case KDBUS_ITEM_ATTACH_FLAGS:
+ flags_provided = true;
attach_flags = item->data64[0];
break;
case KDBUS_ITEM_NAME:
if (!KDBUS_ITEMS_END(item, cmd->items, KDBUS_ITEMS_SIZE(cmd, items)))
return -EINVAL;
- conn->attach_flags = attach_flags;
+ if (flags_provided)
+ conn->attach_flags = attach_flags;
if (!policy_provided)
return 0;