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:
Sung-Jin Park 2016-01-14 16:03:43 +09:00 committed by Bryce Harrington
parent 7ed00c1de7
commit eb52bb8e14
4 changed files with 47 additions and 0 deletions

View file

@ -136,6 +136,9 @@ int
wl_connection_queue(struct wl_connection *connection,
const void *data, size_t count);
int
wl_connection_get_fd(struct wl_connection *connection);
struct wl_closure {
int count;
const struct wl_message *message;