permissions: use current_client for security checks

Don't pass around the client object but keep track of the current
client in the core object. This way we don't need to add a client
argument to functions and can check security when needed.
This commit is contained in:
Wim Taymans 2018-01-24 11:41:40 +01:00
parent ab099d09dd
commit ff17fb68b5
10 changed files with 32 additions and 21 deletions

View file

@ -153,6 +153,8 @@ struct pw_core {
struct spa_support support[16]; /**< support for spa plugins */
uint32_t n_support; /**< number of support items */
struct pw_client *current_client; /**< client currently executing code in mainloop */
long sc_pagesize;
struct {
@ -434,7 +436,6 @@ int pw_core_find_format(struct pw_core *core,
/** Find a ports compatible with \a other_port and the format filters */
struct pw_port *
pw_core_find_port(struct pw_core *core,
struct pw_client *client,
struct pw_port *other_port,
uint32_t id,
struct pw_properties *props,