mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-19 08:57:14 -05:00
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:
parent
72462ebd07
commit
bb120a070f
3 changed files with 5 additions and 0 deletions
|
|
@ -578,6 +578,8 @@ static struct client_data *client_new(struct server *s, int fd)
|
||||||
if (props == NULL)
|
if (props == NULL)
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
|
pw_properties_set(props, PW_KEY_SEC_SOCKET, s->socket_info.name);
|
||||||
|
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
len = sizeof(ucred);
|
len = sizeof(ucred);
|
||||||
if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &ucred, &len) < 0) {
|
if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &ucred, &len) < 0) {
|
||||||
|
|
|
||||||
|
|
@ -524,6 +524,7 @@ int pw_impl_client_register(struct pw_impl_client *client,
|
||||||
PW_KEY_SEC_UID,
|
PW_KEY_SEC_UID,
|
||||||
PW_KEY_SEC_GID,
|
PW_KEY_SEC_GID,
|
||||||
PW_KEY_SEC_LABEL,
|
PW_KEY_SEC_LABEL,
|
||||||
|
PW_KEY_SEC_SOCKET,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,8 @@ extern "C" {
|
||||||
#define PW_KEY_SEC_GID "pipewire.sec.gid" /**< client gid, set by protocol*/
|
#define PW_KEY_SEC_GID "pipewire.sec.gid" /**< client gid, set by protocol*/
|
||||||
#define PW_KEY_SEC_LABEL "pipewire.sec.label" /**< client security label, set by protocol*/
|
#define PW_KEY_SEC_LABEL "pipewire.sec.label" /**< client security label, set by protocol*/
|
||||||
|
|
||||||
|
#define PW_KEY_SEC_SOCKET "pipewire.sec.socket" /**< client socket name, set by protocol */
|
||||||
|
|
||||||
#define PW_KEY_LIBRARY_NAME_SYSTEM "library.name.system" /**< name of the system library to use */
|
#define PW_KEY_LIBRARY_NAME_SYSTEM "library.name.system" /**< name of the system library to use */
|
||||||
#define PW_KEY_LIBRARY_NAME_LOOP "library.name.loop" /**< name of the loop library to use */
|
#define PW_KEY_LIBRARY_NAME_LOOP "library.name.loop" /**< name of the loop library to use */
|
||||||
#define PW_KEY_LIBRARY_NAME_DBUS "library.name.dbus" /**< name of the dbus library to use */
|
#define PW_KEY_LIBRARY_NAME_DBUS "library.name.dbus" /**< name of the dbus library to use */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue