Revision
16185
Author
anthm
Date
2010-01-06 10:59:53 -0600 (Wed, 06 Jan 2010)

Log Message

small logic bug in new event auth code

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c (16184 => 16185)


--- freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	2010-01-06 16:34:01 UTC (rev 16184)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	2010-01-06 16:59:53 UTC (rev 16185)
@@ -1606,7 +1606,7 @@
 						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 @@
 							if (type <= SWITCH_EVENT_ALL) {
 								listener->allowed_event_list[type] = 1;
 							}
+							
 							if (type == SWITCH_EVENT_CUSTOM) {
 								custom++;
 							}
@@ -2160,7 +2161,7 @@
 				
 				
 				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");