[Pkg-voip-commits] r3288 - in asterisk-chan-capi/trunk/debian: .
patches
Mark Purcell
msp at alioth.debian.org
Thu Mar 22 08:02:59 CET 2007
Author: msp
Date: 2007-03-22 07:02:59 +0000 (Thu, 22 Mar 2007)
New Revision: 3288
Added:
asterisk-chan-capi/trunk/debian/patches/02_capi-cmsg2str-mutex.dpatch
Modified:
asterisk-chan-capi/trunk/debian/changelog
asterisk-chan-capi/trunk/debian/patches/00list
Log:
* Non-maintainer upload
* Protect calls to capi_cmsg2str and use of its buffer with a mutex.
(Closes: #411293)
Modified: asterisk-chan-capi/trunk/debian/changelog
===================================================================
--- asterisk-chan-capi/trunk/debian/changelog 2007-03-22 06:06:07 UTC (rev 3287)
+++ asterisk-chan-capi/trunk/debian/changelog 2007-03-22 07:02:59 UTC (rev 3288)
@@ -1,8 +1,10 @@
-asterisk-chan-capi (0.7.1-2) UNRELEASED; urgency=low
+asterisk-chan-capi (0.7.1-1.1) unstable; urgency=high
- * NOT RELEASED YET
+ * Non-maintainer upload
+ * Protect calls to capi_cmsg2str and use of its buffer with a mutex.
+ (Closes: #411293)
- -- Mark Purcell <msp at debian.org> Sun, 22 Oct 2006 20:53:31 +0100
+ -- Ben Hutchings <ben at decadent.org.uk> Wed, 7 Mar 2007 01:58:53 +0000
asterisk-chan-capi (0.7.1-1) unstable; urgency=low
Modified: asterisk-chan-capi/trunk/debian/patches/00list
===================================================================
--- asterisk-chan-capi/trunk/debian/patches/00list 2007-03-22 06:06:07 UTC (rev 3287)
+++ asterisk-chan-capi/trunk/debian/patches/00list 2007-03-22 07:02:59 UTC (rev 3288)
@@ -1 +1,2 @@
01_debian-patch
+02_capi-cmsg2str-mutex
Added: asterisk-chan-capi/trunk/debian/patches/02_capi-cmsg2str-mutex.dpatch
===================================================================
--- asterisk-chan-capi/trunk/debian/patches/02_capi-cmsg2str-mutex.dpatch 2007-03-22 06:06:07 UTC (rev 3287)
+++ asterisk-chan-capi/trunk/debian/patches/02_capi-cmsg2str-mutex.dpatch 2007-03-22 07:02:59 UTC (rev 3288)
@@ -0,0 +1,57 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 02_capi-msg2str-mutex.dpatch by Ben Hutchings <ben at decadent.org.uk>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Protect calls to capi_cmsg2str and use of its buffer with a mutex.
+
+ at DPATCH@
+--- asterisk-chan-capi-0.7.1/chan_capi.c~ 2006-10-08 13:38:27.000000000 +0000
++++ asterisk-chan-capi-0.7.1/chan_capi.c 2007-02-17 22:26:32.000000000 +0000
+@@ -167,6 +167,8 @@
+ * 4. cc_mutex_lock(&messagenumber_lock);
+ * 5. cc_mutex_lock(&usecnt_lock);
+ * 6. cc_mutex_lock(&capi_put_lock);
++ * 7. cc_mutex_lock(&capi_cmsg2str_lock);
++ * 8. cc_mutex_lock(&verbose_lock);
+ *
+ *
+ * ** the PBX will call the callback functions with
+@@ -180,6 +182,7 @@
+ AST_MUTEX_DEFINE_STATIC(usecnt_lock);
+ AST_MUTEX_DEFINE_STATIC(iflock);
+ AST_MUTEX_DEFINE_STATIC(capi_put_lock);
++AST_MUTEX_DEFINE_STATIC(capi_cmsg2str_lock);
+ AST_MUTEX_DEFINE_STATIC(verbose_lock);
+
+ static int capi_capability = AST_FORMAT_ALAW;
+@@ -402,6 +405,7 @@
+ return -1;
+ }
+
++ cc_mutex_lock(&capi_cmsg2str_lock);
+ if (error) {
+ cc_log(LOG_ERROR, "CAPI error sending %s (NCCI=%#x) (error=%#x %s)\n",
+ capi_cmsg2str(CMSG), (unsigned int)HEADER_CID(CMSG),
+@@ -415,6 +419,7 @@
+ cc_verbose(4, 1, "%s\n", capi_cmsg2str(CMSG));
+ }
+ }
++ cc_mutex_unlock(&capi_cmsg2str_lock);
+
+ return error;
+ }
+@@ -3972,12 +3977,14 @@
+ unsigned short wInfo = 0xffff;
+ struct capi_pvt *i = find_interface_by_plci(PLCI);
+
++ cc_mutex_lock(&capi_cmsg2str_lock);
+ if ((wCmd == CAPI_P_IND(DATA_B3)) ||
+ (wCmd == CAPI_P_CONF(DATA_B3))) {
+ cc_verbose(7, 1, "%s\n", capi_cmsg2str(CMSG));
+ } else {
+ cc_verbose(4, 1, "%s\n", capi_cmsg2str(CMSG));
+ }
++ cc_mutex_unlock(&capi_cmsg2str_lock);
+
+ if (i != NULL)
+ cc_mutex_lock(&i->lock);
More information about the Pkg-voip-commits
mailing list