* struct kdbus_cmd_name - struct to describe a well-known name
* @size: The total size of the struct
* @flags: Flags for a name entry (KDBUS_NAME_*)
- * @id: Privileged users may use this field to (de)register
- * names on behalf of other peers.
+ * @owner_id: The current owner of the name. For requests,
+ * privileged users may set this field to
+ * (de)register names on behalf of other connections.
* @conn_flags: The flags of the owning connection (KDBUS_HELLO_*)
* @name: The well-known name
*
struct kdbus_cmd_name {
__u64 size;
__u64 flags;
- __u64 id;
+ __u64 owner_id;
__u64 conn_flags;
char name[0];
} __attribute__((aligned(8)));
/**
* struct kdbus_cmd_match - struct to add or remove matches
* @size: The total size of the struct
- * @id: Privileged users may (de)register matches on behalf
+ * @owner_id: Privileged users may (de)register matches on behalf
* of other peers. In other cases, set to 0.
* @cookie: Userspace supplied cookie. When removing, the cookie
* identifies the match to remove.
*/
struct kdbus_cmd_match {
__u64 size;
- __u64 id;
+ __u64 owner_id;
__u64 cookie;
struct kdbus_item items[0];
} __attribute__((aligned(8)));
return PTR_ERR(cmd_match);
/* privileged users can act on behalf of someone else */
- if (cmd_match->id == 0)
- cmd_match->id = conn->id;
- else if (cmd_match->id != conn->id &&
+ if (cmd_match->owner_id == 0)
+ cmd_match->owner_id = conn->id;
+ else if (cmd_match->owner_id != conn->id &&
!kdbus_bus_uid_is_privileged(conn->ep->bus)) {
kfree(cmd_match);
return -EPERM;
if (ret < 0)
return ret;
- if (cmd_match->id != 0 && cmd_match->id != conn->id) {
+ if (cmd_match->owner_id != 0 && cmd_match->owner_id != conn->id) {
struct kdbus_bus *bus = conn->ep->bus;
mutex_lock(&bus->lock);
- target_conn = kdbus_bus_find_conn_by_id(bus, cmd_match->id);
+ target_conn = kdbus_bus_find_conn_by_id(bus,
+ cmd_match->owner_id);
mutex_unlock(&bus->lock);
if (!target_conn) {
if (ret < 0)
return ret;
- if (cmd_match->id != 0 && cmd_match->id != conn->id) {
+ if (cmd_match->owner_id != 0 && cmd_match->owner_id != conn->id) {
struct kdbus_bus *bus = conn->ep->bus;
mutex_lock(&bus->lock);
- target_conn = kdbus_bus_find_conn_by_id(bus, cmd_match->id);
+ target_conn = kdbus_bus_find_conn_by_id(bus,
+ cmd_match->owner_id);
mutex_unlock(&bus->lock);
if (!target_conn) {
}
/* privileged users can act on behalf of someone else */
- if (cmd_name->id != 0) {
+ if (cmd_name->owner_id != 0) {
struct kdbus_conn *new_conn;
struct kdbus_bus *bus = conn->ep->bus;
}
mutex_lock(&bus->lock);
- new_conn = kdbus_bus_find_conn_by_id(bus, cmd_name->id);
+ new_conn = kdbus_bus_find_conn_by_id(bus, cmd_name->owner_id);
mutex_unlock(&bus->lock);
if (!new_conn) {
}
/* privileged users can act on behalf of someone else */
- if (cmd_name->id > 0) {
+ if (cmd_name->owner_id > 0) {
struct kdbus_bus *bus = conn->ep->bus;
if (!kdbus_bus_uid_is_privileged(bus)) {
}
mutex_lock(&bus->lock);
- conn = kdbus_bus_find_conn_by_id(bus, cmd_name->id);
+ conn = kdbus_bus_find_conn_by_id(bus, cmd_name->owner_id);
mutex_unlock(&bus->lock);
if (!conn) {
if (write) {
struct kdbus_cmd_name n = {
.size = len + nlen,
- .id = c->id,
+ .owner_id = c->id,
.flags = e ? e->flags : 0,
.conn_flags = c->flags,
};
printf("REGISTRY:\n");
list = (struct kdbus_name_list *)(conn->buf + cmd_list.offset);
KDBUS_ITEM_FOREACH(name, list, names)
- printf("%8llu flags=0x%08llx conn=0x%08llx '%s'\n", name->id,
+ printf("%8llu flags=0x%08llx conn=0x%08llx '%s'\n", name->owner_id,
name->flags, name->conn_flags,
name->size > sizeof(struct kdbus_cmd_name) ? name->name : "");
printf("\n");
if (name->size == sizeof(struct kdbus_cmd_name))
continue;
- if (name->id == conn->hello.id && strcmp(n, name->name) == 0) {
+ if (name->owner_id == conn->hello.id && strcmp(n, name->name) == 0) {
found = 1;
break;
}