From 573cf6040c8e33dff0c578cbae9857369afb71a0 Mon Sep 17 00:00:00 2001 From: Mark Riddoch Date: Thu, 11 Dec 2014 13:45:21 +0000 Subject: [PATCH] Check for the duplciate service being the same as the service that is using the tee filter. I.e. trap simple recursive definitions. --- server/modules/filter/tee.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/modules/filter/tee.c b/server/modules/filter/tee.c index 809c8c441..ec1807ec7 100644 --- a/server/modules/filter/tee.c +++ b/server/modules/filter/tee.c @@ -280,6 +280,13 @@ TEE_INSTANCE *my_instance = (TEE_INSTANCE *)instance; TEE_SESSION *my_session; char *remote, *userName; + if (strcmp(my_instance->service->name, session->service->name) == 0) + { + LOGIF(LE, (skygw_log_write_flush(LOGFILE_ERROR, + "%s: Recursive use of tee filter in service.", + session->service->name))); + return NULL; + } if ((my_session = calloc(1, sizeof(TEE_SESSION))) != NULL) { my_session->active = 1;