mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-11 13:30:07 -05:00
access: add access checks
Rework the access checks. Add owner field to more objects to do access control checks Make sure the object global is set in the object before signaling the new global.
This commit is contained in:
parent
d9bb116d27
commit
4cf59e3953
18 changed files with 230 additions and 200 deletions
|
|
@ -30,20 +30,18 @@ extern "C" {
|
|||
#include <pinos/client/sig.h>
|
||||
|
||||
typedef struct _PinosAccess PinosAccess;
|
||||
typedef struct _PinosAccessData PinosAccessData;
|
||||
|
||||
#include <pinos/server/client.h>
|
||||
#include <pinos/server/resource.h>
|
||||
|
||||
typedef struct {
|
||||
SpaResult res;
|
||||
PinosClient *client;
|
||||
PinosResource *resource;
|
||||
uint32_t opcode;
|
||||
void *message;
|
||||
bool flush;
|
||||
} PinosAccessData;
|
||||
struct _PinosAccessData {
|
||||
SpaResult res;
|
||||
void (*complete_cb) (PinosAccessData *data);
|
||||
void (*cancel_cb) (PinosAccessData *data);
|
||||
void *user_data;
|
||||
};
|
||||
|
||||
typedef SpaResult (*PinosAccessFunc) (PinosAccessData *data);
|
||||
|
||||
/**
|
||||
* PinosAccess:
|
||||
|
|
@ -51,16 +49,11 @@ typedef SpaResult (*PinosAccessFunc) (PinosAccessData *data);
|
|||
* Pinos Access support struct.
|
||||
*/
|
||||
struct _PinosAccess {
|
||||
PINOS_SIGNAL (check_send, (PinosListener *listener,
|
||||
PinosAccessFunc func,
|
||||
PinosAccessData *data));
|
||||
PINOS_SIGNAL (check_dispatch, (PinosListener *listener,
|
||||
PinosAccessFunc func,
|
||||
PinosAccessData *data));
|
||||
SpaResult (*check_global) (PinosAccess *access,
|
||||
PinosClient *client,
|
||||
PinosGlobal *global);
|
||||
};
|
||||
|
||||
void pinos_access_init (PinosAccess *access);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue