}
if ((kmsg->fds && !(conn->flags & KDBUS_HELLO_ACCEPT_FD)) ||
- (kmsg->memfds_count && !(conn->flags & KDBUS_HELLO_ACCEPT_MEMFD))) {
+ (kmsg->memfds_count && !(conn->flags & KDBUS_HELLO_ACCEPT_FD))) {
ret = -ECOMM;
goto exit_unlock;
}
BUG_ON(*c);
/* Reject unknown flags */
- if (hello->conn_flags & ~(KDBUS_HELLO_ACCEPT_FD |
- KDBUS_HELLO_ACCEPT_MEMFD |
- KDBUS_HELLO_ACTIVATOR |
- KDBUS_HELLO_POLICY_HOLDER |
+ if (hello->conn_flags & ~(KDBUS_HELLO_ACCEPT_FD |
+ KDBUS_HELLO_ACTIVATOR |
+ KDBUS_HELLO_POLICY_HOLDER |
KDBUS_HELLO_MONITOR))
return -EOPNOTSUPP;
* enum kdbus_hello_flags - flags for struct kdbus_cmd_hello
* @KDBUS_HELLO_ACCEPT_FD: The connection allows the reception of
* any passed file descriptors
- * @KDBUS_HELLO_ACCEPT_MEMFD: The connection allows the reception of
- * any passed memfd file descriptors
* @KDBUS_HELLO_ACTIVATOR: Special-purpose connection which registers
* a well-know name for a process to be started
* when traffic arrives
*/
enum kdbus_hello_flags {
KDBUS_HELLO_ACCEPT_FD = 1ULL << 0,
- KDBUS_HELLO_ACCEPT_MEMFD = 1ULL << 1,
- KDBUS_HELLO_ACTIVATOR = 1ULL << 2,
- KDBUS_HELLO_POLICY_HOLDER = 1ULL << 3,
- KDBUS_HELLO_MONITOR = 1ULL << 4,
+ KDBUS_HELLO_ACTIVATOR = 1ULL << 1,
+ KDBUS_HELLO_POLICY_HOLDER = 1ULL << 2,
+ KDBUS_HELLO_MONITOR = 1ULL << 3,
};
/**
as message payload. If it's not set, any attempt of doing so will
result in -ECOMM on the sender's side.
- KDBUS_HELLO_ACCEPT_MEMFD
- When this flag is set, the connection can be sent memfd file
- descriptors as message payload. If it's not set, any attempt of
- doing so will result in -ECOMM on the sender's side.
-
KDBUS_HELLO_ACTIVATOR
Make this connection an activator (see below). With this bit set,
an item of type KDBUS_ITEM_NAME has to be attached which describes
interpreted with the semantics described above.
Also, if the connection allowed for file descriptor to be passed
-(KDBUS_HELLO_ACCEPT_FD or KDBUS_HELLO_ACCEPT_MEMFD), and if the message
-contained any, they will be installed into the receiving process after the
-KDBUS_CMD_MSG_RECV ioctl returns. The receiving task is obliged to close all
-of them appropriately.
+(KDBUS_HELLO_ACCEPT_FD), and if the message contained any, they will be
+installed into the receiving process after the KDBUS_CMD_MSG_RECV ioctl
+returns. The receiving task is obliged to close all of them appropriately.
The caller is obliged to call KDBUS_CMD_FREE with the returned offset when
the memory is no longer needed.
return NULL;
}
- h.hello.conn_flags = flags | KDBUS_HELLO_ACCEPT_FD |
- KDBUS_HELLO_ACCEPT_MEMFD;
+ h.hello.conn_flags = flags | KDBUS_HELLO_ACCEPT_FD;
h.hello.attach_flags = _KDBUS_ATTACH_ALL;
h.conn_name.type = KDBUS_ITEM_CONN_NAME;
strcpy(h.conn_name.str, "this-is-my-name");
if (fd < 0)
return TEST_ERR;
- hello.conn_flags = KDBUS_HELLO_ACCEPT_FD | KDBUS_HELLO_ACCEPT_MEMFD;
+ hello.conn_flags = KDBUS_HELLO_ACCEPT_FD;
hello.attach_flags = _KDBUS_ATTACH_ALL;
hello.size = sizeof(struct kdbus_cmd_hello);
hello.pool_size = POOL_SIZE;
ret = ioctl(fd, KDBUS_CMD_HELLO, &hello);
ASSERT_RETURN(ret == -1 && errno == EOPNOTSUPP);
+ hello.conn_flags = KDBUS_HELLO_ACCEPT_FD;
+
/* check for faulty pool sizes */
hello.pool_size = 0;
ret = ioctl(fd, KDBUS_CMD_HELLO, &hello);
ret = ioctl(fd, KDBUS_CMD_HELLO, &hello);
ASSERT_RETURN(ret == -1 && errno == EFAULT);
- /* success test */
hello.pool_size = POOL_SIZE;
- hello.conn_flags = KDBUS_HELLO_ACCEPT_FD | KDBUS_HELLO_ACCEPT_MEMFD;
+
+ /* success test */
ret = ioctl(fd, KDBUS_CMD_HELLO, &hello);
ASSERT_RETURN(ret == 0);
ASSERT_RETURN(fd >= 0);
memset(&hello, 0, sizeof(hello));
- hello.conn_flags = KDBUS_HELLO_ACCEPT_FD | KDBUS_HELLO_ACCEPT_MEMFD;
+ hello.conn_flags = KDBUS_HELLO_ACCEPT_FD;
hello.attach_flags = _KDBUS_ATTACH_ALL;
hello.size = sizeof(struct kdbus_cmd_hello);
hello.pool_size = POOL_SIZE;
return NULL;
}
- h.hello.conn_flags = flags | KDBUS_HELLO_ACCEPT_FD |
- KDBUS_HELLO_ACCEPT_MEMFD;
+ h.hello.conn_flags = flags | KDBUS_HELLO_ACCEPT_FD;
h.hello.attach_flags = _KDBUS_ATTACH_ALL;
h.type = KDBUS_ITEM_CONN_NAME;
strncpy(h.comm, "monitor", sizeof(h.comm) - 1);