pipewire: add PW_KEY_SEC_SOCKET and set it in protocol

Add client key PW_KEY_SEC_SOCKET that indicates which socket the client used
to connect to the server.

This can be used by other modules as an access control mechanism.
This commit is contained in:
Pauli Virtanen 2023-10-07 12:37:10 +03:00
parent 72462ebd07
commit bb120a070f
3 changed files with 5 additions and 0 deletions

View file

@ -578,6 +578,8 @@ static struct client_data *client_new(struct server *s, int fd)
if (props == NULL)
goto exit;
pw_properties_set(props, PW_KEY_SEC_SOCKET, s->socket_info.name);
#if defined(__linux__)
len = sizeof(ucred);
if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &ucred, &len) < 0) {