mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-02-21 01:40:57 -05:00
server: Add an API to get the file descriptor for a client
This adds an API to get the file descriptor for a client. The client file descriptor can be used for a wayland compositor to validate a request from a client if there are any additional information provided from the client's file descriptor. For instance, this will be helpful in some linux distributions, in which SELinux or SMACK is enabled. In those environments, each file (including socket) will have each security contexts in its inode as xattr member variable. A wayland compositor can validate a client request by getting the file descriptor of the client and by checking the security contexts associated with the file descriptor. Signed-off-by: Sung-Jin Park <input.hacker@gmail.com>
This commit is contained in:
parent
7ed00c1de7
commit
eb52bb8e14
4 changed files with 47 additions and 0 deletions
|
|
@ -405,6 +405,12 @@ wl_message_count_arrays(const struct wl_message *message)
|
|||
return arrays;
|
||||
}
|
||||
|
||||
int
|
||||
wl_connection_get_fd(struct wl_connection *connection)
|
||||
{
|
||||
return connection->fd;
|
||||
}
|
||||
|
||||
static int
|
||||
wl_connection_put_fd(struct wl_connection *connection, int32_t fd)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue