pulse-server: add command access control

By default require that a client is authenticated and
has a manager to be allowed to run a command.

Specially:
 * AUTH requires nothing
 * SET_CLIENT_NAME and STAT only require authentication
This commit is contained in:
Barnabás Pőcze 2021-12-30 21:36:04 +01:00
parent 92abc7b7ad
commit 1c3e45a584
3 changed files with 22 additions and 5 deletions

View file

@ -192,9 +192,15 @@ enum pulseaudio_command {
COMMAND_MAX
};
enum command_access_flag {
COMMAND_ACCESS_WITHOUT_AUTH = (1 << 0),
COMMAND_ACCESS_WITHOUT_MANAGER = (1 << 1),
};
struct command {
const char *name;
int (*run) (struct client *client, uint32_t command, uint32_t tag, struct message *msg);
uint32_t access;
};
extern const struct command commands[COMMAND_MAX];