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:
Wim Taymans 2017-01-10 17:12:53 +01:00
parent a8964ca657
commit ee0aa6a2ac
27 changed files with 819 additions and 220 deletions

View file

@ -26,9 +26,21 @@ extern "C" {
typedef struct _PinosClient PinosClient;
#include <sys/socket.h>
#include <pinos/client/properties.h>
#include <pinos/client/sig.h>
#include <pinos/server/core.h>
#include <pinos/server/resource.h>
typedef SpaResult (*PinosSendFunc) (void *object,
uint32_t id,
uint32_t opcode,
void *message,
bool flush,
void *data);
/**
* PinosClient:
*
@ -40,6 +52,8 @@ struct _PinosClient {
PinosGlobal *global;
PinosProperties *properties;
bool ucred_valid;
struct ucred ucred;
PinosResource *core_resource;
@ -47,9 +61,6 @@ struct _PinosClient {
SpaList resource_list;
PinosSendFunc send_func;
void *send_data;
PINOS_SIGNAL (destroy_signal, (PinosListener *listener,
PinosClient *client));
};
@ -57,6 +68,17 @@ struct _PinosClient {
PinosClient * pinos_client_new (PinosCore *core,
PinosProperties *properties);
void pinos_client_destroy (PinosClient *client);
void pinos_client_set_send (PinosClient *client,
PinosSendFunc func,
void *data);
SpaResult pinos_client_send_message (PinosClient *client,
PinosResource *resource,
uint32_t opcode,
void *message,
bool flush);
void pinos_client_update_properties (PinosClient *client,
const SpaDict *dict);