mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-08 13:30:08 -05:00
Implement access control
Move send and dispatch functions to the implementation. This makes it possible to place an access check before sending and dispatching. Add module-access that allows to bind and notify on globals owned by the client.
This commit is contained in:
parent
a8964ca657
commit
ee0aa6a2ac
27 changed files with 819 additions and 220 deletions
|
|
@ -48,7 +48,7 @@ struct _PinosMap {
|
|||
#define pinos_map_item_is_free(item) ((item)->next & 0x1)
|
||||
#define pinos_map_id_is_free(m,id) (pinos_map_item_is_free (pinos_map_get_item(m,id)))
|
||||
#define pinos_map_check_id(m,id) ((id) < pinos_map_get_size (m))
|
||||
#define pinos_map_has_item(m,id) (pinos_map_check_id(m,id) && !pinos_map_item_is_free(m, id))
|
||||
#define pinos_map_has_item(m,id) (pinos_map_check_id(m,id) && !pinos_map_id_is_free(m, id))
|
||||
#define pinos_map_lookup_unchecked(m,id) pinos_map_get_item(m,id)->data
|
||||
|
||||
static inline void
|
||||
|
|
@ -100,8 +100,11 @@ static inline void *
|
|||
pinos_map_lookup (PinosMap *map,
|
||||
uint32_t id)
|
||||
{
|
||||
if (SPA_LIKELY (pinos_map_check_id (map, id)))
|
||||
return pinos_map_lookup_unchecked (map, id);
|
||||
if (SPA_LIKELY (pinos_map_check_id (map, id))) {
|
||||
PinosMapItem *item = pinos_map_get_item (map, id);
|
||||
if (!pinos_map_item_is_free (item))
|
||||
return item->data;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue