[svn-commits] alecdavis: branch 11 r385938 - /branches/11/res/res_xmpp.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Apr 16 18:27:53 CDT 2013


Author: alecdavis
Date: Tue Apr 16 18:27:51 2013
New Revision: 385938

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=385938
Log:
Distributed Device State broken at sites using res_xmpp or res_jabber where Secuity Advisory AST-2012-015 is inplace

res_xmpp was not adding AST_EVENT_IE_CACHABLE to the event as each message came in,
then devstate_change_collector_cb() was unable to find AST_EVENT_IE_CACHABLE in the event,
so defaulted incorrectly to AST_DEVSTATE_NOT_CACHABLE.

(issue ASTERISK-20175)
(closes issue ASTERISK-21429)
(closes issue ASTERISK-21069)
(closes issue ASTERISK-21164)

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

Review https://reviewboard.asterisk.org/r/2452/

Modified:
    branches/11/res/res_xmpp.c

Modified: branches/11/res/res_xmpp.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/res/res_xmpp.c?view=diff&rev=385938&r1=385937&r2=385938
==============================================================================
--- branches/11/res/res_xmpp.c (original)
+++ branches/11/res/res_xmpp.c Tue Apr 16 18:27:51 2013
@@ -1328,14 +1328,15 @@
 		return IKS_FILTER_EAT;
 	}
 	if (!strcasecmp(iks_name(item_content), "state")) {
+		if ((cachable_str = iks_find_attrib(item_content, "cachable"))) {
+			sscanf(cachable_str, "%30d", &cachable);
+		}
 		device_state = iks_find_cdata(item, "state");
-		if ((cachable_str = iks_find_cdata(item, "cachable"))) {
-			sscanf(cachable_str, "%30d", &cachable);
-		}
 		if (!(event = ast_event_new(AST_EVENT_DEVICE_STATE_CHANGE,
 					    AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR, item_id, AST_EVENT_IE_STATE,
 					    AST_EVENT_IE_PLTYPE_UINT, ast_devstate_val(device_state), AST_EVENT_IE_EID,
 					    AST_EVENT_IE_PLTYPE_RAW, &pubsub_eid, sizeof(pubsub_eid),
+					    AST_EVENT_IE_CACHABLE, AST_EVENT_IE_PLTYPE_UINT, cachable,
 					    AST_EVENT_IE_END))) {
 			return IKS_FILTER_EAT;
 		}




More information about the svn-commits mailing list