From 42f8ffca561845699455f1e80aa2112b7eda28b5 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 6 Jan 2010 16:59:53 +0000 Subject: [PATCH] small logic bug in new event auth code git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16185 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/event_handlers/mod_event_socket/mod_event_socket.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c index 597b5b8f40..21d860c669 100644 --- a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c +++ b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c @@ -1606,7 +1606,7 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even if ((next = strchr(cur, delim))) { *next++ = '\0'; } - + if (custom) { switch_core_hash_insert(listener->allowed_event_hash, cur, MARKER); } else if (switch_name_event(cur, &type) == SWITCH_STATUS_SUCCESS) { @@ -1621,6 +1621,7 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even if (type <= SWITCH_EVENT_ALL) { listener->allowed_event_list[type] = 1; } + if (type == SWITCH_EVENT_CUSTOM) { custom++; } @@ -2160,7 +2161,7 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even if (custom) { - if (listener->allowed_event_hash && switch_core_hash_find(listener->allowed_event_hash, cur)) { + if (!listener->allowed_event_hash || switch_core_hash_find(listener->allowed_event_hash, cur)) { switch_core_hash_insert(listener->event_hash, cur, MARKER); } else { switch_snprintf(reply, reply_len, "-ERR permission denied");