MXS-1167: Skip permission checks for internal services

If a server points to a local MaxScale listener, the permission checks for
that server are skipped. This allows permission checks to be used with a
mix of external servers and internal services.
This commit is contained in:
Markus Mäkelä
2017-03-17 07:48:59 +02:00
parent 2e6e8574a4
commit 0b5d164855
5 changed files with 63 additions and 1 deletions

View File

@ -254,6 +254,14 @@ void server_add_parameter(SERVER *server, const char *name, const char *value);
*/
bool server_remove_parameter(SERVER *server, const char *name);
/**
* @brief Check if a server points to a local MaxScale service
*
* @param server Server to check
* @return True if the server points to a local MaxScale service
*/
bool server_is_mxs_service(const SERVER *server);
extern int server_free(SERVER *server);
extern SERVER *server_find_by_unique_name(const char *name);
extern SERVER *server_find(const char *servname, unsigned short port);

View File

@ -241,6 +241,14 @@ bool serviceHasBackend(SERVICE *service, SERVER *server);
bool serviceHasListener(SERVICE *service, const char *protocol,
const char* address, unsigned short port);
/**
* @brief Check if a MaxScale service listens on a port
*
* @param port The port to check
* @return True if a MaxScale service uses the port
*/
bool service_port_is_used(unsigned short port);
int serviceGetUser(SERVICE *service, char **user, char **auth);
int serviceSetUser(SERVICE *service, char *user, char *auth);
bool serviceSetFilters(SERVICE *service, char *filters);