server: wl_client: introduce method for getting client security context

Introduces a function wl_client_get_security_context for obtaining the
security context of a connected client by using SO_PEERSEC on supported
systems. Returns NULL for unsupported systems (inline with behaviour of
e.g. Linux attempting to get a security context for a client that does
not exist, which is a valid state).

Signed-off-by: Rahul Sandhu <nvraxn@gmail.com>
This commit is contained in:
Rahul Sandhu 2025-02-23 20:29:31 +00:00
parent 1ab6b693b1
commit 5ed36d2b44
4 changed files with 74 additions and 0 deletions

View file

@ -327,6 +327,10 @@ void
wl_client_get_credentials(const struct wl_client *client,
pid_t *pid, uid_t *uid, gid_t *gid);
void
wl_client_get_security_context(struct wl_client *client,
char **security_context);
int
wl_client_get_fd(struct wl_client *client);