]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
small logic bug in new event auth code
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 6 Jan 2010 16:59:53 +0000 (16:59 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 6 Jan 2010 16:59:53 +0000 (16:59 +0000)
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

index 597b5b8f40fac7698755cb99498771e2650b6de3..21d860c6694003a4ca0e7fffa6a3b5eb8d2b2b54 100644 (file)
@@ -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");