[Frugalware-darcs] frugalware-0.6: asterisk-1.4.8-1terminus1-i686

VMiklos vmiklos at frugalware.org
Fri Aug 10 11:20:58 CEST 2007


Darcsweb-Url: http://darcs.frugalware.org/darcsweb/darcsweb.cgi?r=frugalware-0.6;a=darcs_commitdiff;h=20070810092025-e2957-4cf56ec56322bc29a47a4795a266b8f44fa6d3bc.gz;

[asterisk-1.4.8-1terminus1-i686
VMiklos <vmiklos at frugalware.org>**20070810092025
 secfix bump
 closes #2269
] {
hunk ./source/apps-extra/asterisk/AEL2_secfix.patch 1
-diff -Naur asterisk-1.4.2.old/apps/app_stack.c asterisk-1.4.2/apps/app_stack.c
---- asterisk-1.4.2.old/apps/app_stack.c	2007-04-05 13:38:12.000000000 +0530
-+++ asterisk-1.4.2/apps/app_stack.c	2007-04-05 13:38:37.000000000 +0530
-@@ -1,7 +1,7 @@
- /*
-  * Asterisk -- An open source telephony toolkit.
-  *
-- * Copyright (c) 2004-2006 Tilghman Lesher <app_stack_v002 at the-tilghman.com>.
-+ * Copyright (c) 2004-2006 Tilghman Lesher <app_stack_v003 at the-tilghman.com>.
-  *
-  * This code is released by the author with no restrictions on usage.
-  *
-@@ -20,14 +20,14 @@
-  *
-  * \brief Stack applications Gosub, Return, etc.
-  *
-- * \author Tilghman Lesher <app_stack_v002 at the-tilghman.com>
-+ * \author Tilghman Lesher <app_stack_v003 at the-tilghman.com>
-  * 
-  * \ingroup applications
-  */
- 
- #include "asterisk.h"
-  
--ASTERISK_FILE_VERSION(__FILE__, "$Revision: 40722 $")
-+ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
- 
- #include <stdio.h>
- #include <stdlib.h>
-@@ -41,10 +41,10 @@
- #include "asterisk/pbx.h"
- #include "asterisk/module.h"
- #include "asterisk/config.h"
-+#include "asterisk/app.h"
- 
- #define STACKVAR	"~GOSUB~STACK~"
- 
--
- static const char *app_gosub = "Gosub";
- static const char *app_gosubif = "GosubIf";
- static const char *app_return = "Return";
-@@ -56,63 +56,219 @@
- static const char *pop_synopsis = "Remove one address from gosub stack";
- 
- static const char *gosub_descrip =
--"Gosub([[context|]exten|]priority)\n"
-+"Gosub([[context|]exten|]priority[(arg1[|...][|argN])])\n"
- "  Jumps to the label specified, saving the return address.\n";
- static const char *gosubif_descrip =
--"GosubIf(condition?labeliftrue[:labeliffalse])\n"
-+"GosubIf(condition?labeliftrue[(arg1[|...])][:labeliffalse[(arg1[|...])]])\n"
- "  If the condition is true, then jump to labeliftrue.  If false, jumps to\n"
- "labeliffalse, if specified.  In either case, a jump saves the return point\n"
- "in the dialplan, to be returned to with a Return.\n";
- static const char *return_descrip =
--"Return()\n"
--"  Jumps to the last label on the stack, removing it.\n";
-+"Return([return-value])\n"
-+"  Jumps to the last label on the stack, removing it.  The return value, if\n"
-+"any, is saved in the channel variable GOSUB_RETVAL.\n";
- static const char *pop_descrip =
- "StackPop()\n"
- "  Removes last label on the stack, discarding it.\n";
- 
- 
-+static void gosub_free(void *data);
-+
-+static struct ast_datastore_info stack_info = {
-+	.type = "GOSUB",
-+	.destroy = gosub_free,
-+};
-+
-+struct gosub_stack_frame {
-+	AST_LIST_ENTRY(gosub_stack_frame) entries;
-+	/* 100 arguments is all that we support anyway, but this will handle up to 255 */
-+	unsigned char arguments;
-+	int priority;
-+	char *context;
-+	char extension[0];
-+};
-+
-+static void gosub_release_frame(struct ast_channel *chan, struct gosub_stack_frame *frame)
-+{
-+	unsigned char i;
-+	char argname[15];
-+
-+	/* If chan is not defined, then we're calling it as part of gosub_free,
-+	 * and the channel variables will be deallocated anyway.  Otherwise, we're
-+	 * just releasing a single frame, so we need to clean up the arguments for
-+	 * that frame, so that we re-expose the variables from the previous frame
-+	 * that were hidden by this one.
-+	 */
-+	if (chan) {
-+		for (i = 1; i <= frame->arguments && i != 0; i++) {
-+			snprintf(argname, sizeof(argname), "ARG%hhd", i);
-+			pbx_builtin_setvar_helper(chan, argname, NULL);
-+		}
-+	}
-+	ast_free(frame);
-+}
-+
-+static struct gosub_stack_frame *gosub_allocate_frame(const char *context, const char *extension, int priority, unsigned char arguments)
-+{
-+	struct gosub_stack_frame *new = NULL;
-+	int len_extension = strlen(extension), len_context = strlen(context);
-+
-+	if ((new = ast_calloc(1, sizeof(*new) + 2 + len_extension + len_context))) {
-+		strcpy(new->extension, extension);
-+		new->context = new->extension + len_extension + 1;
-+		strcpy(new->context, context);
-+		new->priority = priority;
-+		new->arguments = arguments;
-+	}
-+	return new;
-+}
-+
-+static void gosub_free(void *data)
-+{
-+	AST_LIST_HEAD(, gosub_stack_frame) *oldlist = data;
-+	struct gosub_stack_frame *oldframe;
-+	AST_LIST_LOCK(oldlist);
-+	while ((oldframe = AST_LIST_REMOVE_HEAD(oldlist, entries))) {
-+		gosub_release_frame(NULL, oldframe);
-+	}
-+	AST_LIST_UNLOCK(oldlist);
-+	AST_LIST_HEAD_DESTROY(oldlist);
-+	ast_free(oldlist);
-+}
-+
- static int pop_exec(struct ast_channel *chan, void *data)
- {
--	pbx_builtin_setvar_helper(chan, STACKVAR, NULL);
-+	struct ast_datastore *stack_store = ast_channel_datastore_find(chan, &stack_info, NULL);
-+	struct gosub_stack_frame *oldframe;
-+	AST_LIST_HEAD(, gosub_stack_frame) *oldlist;
-+
-+	if (!stack_store) {
-+		ast_log(LOG_WARNING, "%s called with no gosub stack allocated.\n", app_pop);
-+		return 0;
-+	}
-+
-+	oldlist = stack_store->data;
-+	AST_LIST_LOCK(oldlist);
-+	oldframe = AST_LIST_REMOVE_HEAD(oldlist, entries);
-+	AST_LIST_UNLOCK(oldlist);
-+
-+	if (oldframe)
-+		gosub_release_frame(chan, oldframe);
-+	else if (option_debug)
-+		ast_log(LOG_DEBUG, "%s called with an empty gosub stack\n", app_pop);
- 
- 	return 0;
- }
- 
- static int return_exec(struct ast_channel *chan, void *data)
- {
--	const char *label = pbx_builtin_getvar_helper(chan, STACKVAR);
-+	struct ast_datastore *stack_store = ast_channel_datastore_find(chan, &stack_info, NULL);
-+	struct gosub_stack_frame *oldframe;
-+	AST_LIST_HEAD(, gosub_stack_frame) *oldlist;
-+	char *retval = data;
- 
--	if (ast_strlen_zero(label)) {
--		ast_log(LOG_ERROR, "Return without Gosub: stack is empty\n");
-+	if (!stack_store) {
-+		ast_log(LOG_ERROR, "Return without Gosub: stack is unallocated\n");
- 		return -1;
--	} else if (ast_parseable_goto(chan, label)) {
--		ast_log(LOG_WARNING, "No next statement after Gosub?\n");
-+	}
-+
-+	oldlist = stack_store->data;
-+	AST_LIST_LOCK(oldlist);
-+	oldframe = AST_LIST_REMOVE_HEAD(oldlist, entries);
-+	AST_LIST_UNLOCK(oldlist);
-+
-+	if (!oldframe) {
-+		ast_log(LOG_ERROR, "Return without Gosub: stack is empty\n");
- 		return -1;
- 	}
- 
--	pbx_builtin_setvar_helper(chan, STACKVAR, NULL);
-+	ast_explicit_goto(chan, oldframe->context, oldframe->extension, oldframe->priority);
-+	gosub_release_frame(chan, oldframe);
-+
-+	/* Set a return value, if any */
-+	pbx_builtin_setvar_helper(chan, "GOSUB_RETVAL", S_OR(retval, ""));
- 	return 0;
- }
- 
- static int gosub_exec(struct ast_channel *chan, void *data)
- {
--	char newlabel[AST_MAX_EXTENSION * 2 + 3 + 11];
-+	struct ast_datastore *stack_store = ast_channel_datastore_find(chan, &stack_info, NULL);
-+	AST_LIST_HEAD(, gosub_stack_frame) *oldlist;
-+	struct gosub_stack_frame *newframe;
-+	char argname[15], *tmp = ast_strdupa(data), *label, *endparen;
-+	int i;
- 	struct ast_module_user *u;
-+	AST_DECLARE_APP_ARGS(args2,
-+		AST_APP_ARG(argval)[100];
-+	);
- 
- 	if (ast_strlen_zero(data)) {
--		ast_log(LOG_ERROR, "%s requires an argument: %s([[context|]exten|]priority)\n", app_gosub, app_gosub);
-+		ast_log(LOG_ERROR, "%s requires an argument: %s([[context|]exten|]priority[(arg1[|...][|argN])])\n", app_gosub, app_gosub);
- 		return -1;
- 	}
- 
- 	u = ast_module_user_add(chan);
--	snprintf(newlabel, sizeof(newlabel), "%s|%s|%d", chan->context, chan->exten, chan->priority + 1);
- 
--	if (ast_parseable_goto(chan, data)) {
-+	if (!stack_store) {
-+		if (option_debug)
-+			ast_log(LOG_DEBUG, "Channel %s has no datastore, so we're allocating one.\n", chan->name);
-+		stack_store = ast_channel_datastore_alloc(&stack_info, NULL);
-+		if (!stack_store) {
-+			ast_log(LOG_ERROR, "Unable to allocate new datastore.  Gosub will fail.\n");
-+			ast_module_user_remove(u);
-+			return -1;
-+		}
-+
-+		oldlist = ast_calloc(1, sizeof(*oldlist));
-+		if (!oldlist) {
-+			ast_log(LOG_ERROR, "Unable to allocate datastore list head.  Gosub will fail.\n");
-+			ast_channel_datastore_free(stack_store);
-+			ast_module_user_remove(u);
-+			return -1;
-+		}
-+
-+		stack_store->data = oldlist;
-+		AST_LIST_HEAD_INIT(oldlist);
-+		ast_channel_datastore_add(chan, stack_store);
-+	}
-+
-+	/* Separate the arguments from the label */
-+	/* NOTE:  you cannot use ast_app_separate_args for this, because '(' cannot be used as a delimiter. */
-+	label = strsep(&tmp, "(");
-+	if (tmp) {
-+		endparen = strrchr(tmp, ')');
-+		if (endparen)
-+			*endparen = '\0';
-+		else
-+			ast_log(LOG_WARNING, "Ouch.  No closing paren: '%s'?\n", (char *)data);
-+		AST_STANDARD_APP_ARGS(args2, tmp);
-+	} else
-+		args2.argc = 0;
-+
-+	/* Create the return address, but don't save it until we know that the Gosub destination exists */
-+	newframe = gosub_allocate_frame(chan->context, chan->exten, chan->priority + 1, args2.argc);
-+
-+	if (ast_parseable_goto(chan, label)) {
-+		ast_log(LOG_ERROR, "Gosub address is invalid: '%s'\n", (char *)data);
-+		ast_free(newframe);
- 		ast_module_user_remove(u);
- 		return -1;
- 	}
- 
--	pbx_builtin_pushvar_helper(chan, STACKVAR, newlabel);
-+	/* Now that we know for certain that we're going to a new location, set our arguments */
-+	for (i = 0; i < args2.argc; i++) {
-+		snprintf(argname, sizeof(argname), "ARG%d", i + 1);
-+		pbx_builtin_pushvar_helper(chan, argname, args2.argval[i]);
-+		if (option_debug)
-+			ast_log(LOG_DEBUG, "Setting '%s' to '%s'\n", argname, args2.argval[i]);
-+	}
-+
-+	/* And finally, save our return address */
-+	oldlist = stack_store->data;
-+	AST_LIST_LOCK(oldlist);
-+	AST_LIST_INSERT_HEAD(oldlist, newframe, entries);
-+	AST_LIST_UNLOCK(oldlist);
-+
- 	ast_module_user_remove(u);
- 
- 	return 0;
-@@ -121,28 +277,39 @@
- static int gosubif_exec(struct ast_channel *chan, void *data)
- {
- 	struct ast_module_user *u;
--	char *condition="", *label1, *label2, *args;
-+	char *args;
- 	int res=0;
-+	AST_DECLARE_APP_ARGS(cond,
-+		AST_APP_ARG(ition);
-+		AST_APP_ARG(labels);
-+	);
-+	AST_DECLARE_APP_ARGS(label,
-+		AST_APP_ARG(iftrue);
-+		AST_APP_ARG(iffalse);
-+	);
- 
- 	if (ast_strlen_zero(data)) {
--		ast_log(LOG_WARNING, "GosubIf requires an argument\n");
-+		ast_log(LOG_WARNING, "GosubIf requires an argument: GosubIf(cond?label1(args):label2(args)\n");
- 		return 0;
- 	}
- 
-+	u = ast_module_user_add(chan);
-+
- 	args = ast_strdupa(data);
-+	AST_NONSTANDARD_APP_ARGS(cond, args, '?');
-+	if (cond.argc != 2) {
-+		ast_log(LOG_WARNING, "GosubIf requires an argument: GosubIf(cond?label1(args):label2(args)\n");
-+		ast_module_user_remove(u);
-+		return 0;
-+	}
- 
--	u = ast_module_user_add(chan);
-+	AST_NONSTANDARD_APP_ARGS(label, cond.labels, ':');
- 
--	condition = strsep(&args, "?");
--	label1 = strsep(&args, ":");
--	label2 = args;
--
--	if (pbx_checkcondition(condition)) {
--		if (label1) {
--			res = gosub_exec(chan, label1);
--		}
--	} else if (label2) {
--		res = gosub_exec(chan, label2);
-+	if (pbx_checkcondition(cond.ition)) {
-+		if (!ast_strlen_zero(label.iftrue))
-+			res = gosub_exec(chan, label.iftrue);
-+	} else if (!ast_strlen_zero(label.iffalse)) {
-+		res = gosub_exec(chan, label.iffalse);
- 	}
- 
- 	ast_module_user_remove(u);
rmfile ./source/apps-extra/asterisk/AEL2_secfix.patch
hunk ./source/apps-extra/asterisk/ASA10.diff 1
---- channels/chan_sip.c	2007/03/21 03:25:48	59081
-+++ channels/chan_sip.c	2007/03/22 23:40:01	59182
-@@ -5091,15 +5091,15 @@
- 					ast_log(LOG_DEBUG, "Transcoding JBIG: %d\n",x);
- 				if (x == 1)
- 					peert38capability |= T38FAX_TRANSCODING_JBIG;
--			} else if ((sscanf(a, "T38FaxRateManagement:%s", s) == 1)) {
-+			} else if ((sscanf(a, "T38FaxRateManagement:%255s", s) == 1)) {
- 				found = 1;
- 				if (option_debug > 2)
--					ast_log(LOG_DEBUG, "RateMangement: %s\n", s);
-+					ast_log(LOG_DEBUG, "RateManagement: %s\n", s);
- 				if (!strcasecmp(s, "localTCF"))
- 					peert38capability |= T38FAX_RATE_MANAGEMENT_LOCAL_TCF;
- 				else if (!strcasecmp(s, "transferredTCF"))
- 					peert38capability |= T38FAX_RATE_MANAGEMENT_TRANSFERED_TCF;
--			} else if ((sscanf(a, "T38FaxUdpEC:%s", s) == 1)) {
-+			} else if ((sscanf(a, "T38FaxUdpEC:%255s", s) == 1)) {
- 				found = 1;
- 				if (option_debug > 2)
- 					ast_log(LOG_DEBUG, "UDP EC: %s\n", s);
rmfile ./source/apps-extra/asterisk/ASA10.diff
hunk ./source/apps-extra/asterisk/ASA11.diff 1
---- channels/chan_sip.c	2007/03/22 23:40:01	59182
-+++ channels/chan_sip.c	2007/03/24 01:39:44	59195
-@@ -14609,20 +14609,20 @@
- 			ast_set_flag(req, SIP_PKT_IGNORE);
- 			ast_set_flag(req, SIP_PKT_IGNORE_RESP);
- 			append_history(p, "Ignore", "Ignoring this retransmit\n");
--		}
--	
--		e = ast_skip_blanks(e);
--		if (sscanf(e, "%d %n", &respid, &len) != 1) {
--			ast_log(LOG_WARNING, "Invalid response: '%s'\n", e);
--		} else {
--			if (respid <= 0) {
--				ast_log(LOG_WARNING, "Invalid SIP response code: '%d'\n", respid);
--				return 0;
-+		} else if (e) {
-+			e = ast_skip_blanks(e);
-+			if (sscanf(e, "%d %n", &respid, &len) != 1) {
-+				ast_log(LOG_WARNING, "Invalid response: '%s'\n", e);
-+			} else {
-+				if (respid <= 0) {
-+					ast_log(LOG_WARNING, "Invalid SIP response code: '%d'\n", respid);
-+					return 0;
-+				}
-+				/* More SIP ridiculousness, we have to ignore bogus contacts in 100 etc responses */
-+				if ((respid == 200) || ((respid >= 300) && (respid <= 399)))
-+					extract_uri(p, req);
-+				handle_response(p, respid, e + len, req, ignore, seqno);
- 			}
--			/* More SIP ridiculousness, we have to ignore bogus contacts in 100 etc responses */
--			if ((respid == 200) || ((respid >= 300) && (respid <= 399)))
--				extract_uri(p, req);
--			handle_response(p, respid, e + len, req, ignore, seqno);
- 		}
- 		return 0;
- 	}
rmfile ./source/apps-extra/asterisk/ASA11.diff
hunk ./source/apps-extra/asterisk/ASA12.diff 1
---- main/manager.c	2007/04/20 18:19:18	61690
-+++ main/manager.c	2007/04/24 21:34:53	61787
-@@ -926,7 +926,8 @@
- 				} else if (ha)
- 					ast_free_ha(ha);
- 				if (!strcasecmp(authtype, "MD5")) {
--					if (!ast_strlen_zero(key) && s->challenge) {
-+					if (!ast_strlen_zero(key) && 
-+					    !ast_strlen_zero(s->challenge) && !ast_strlen_zero(password)) {
- 						int x;
- 						int len = 0;
- 						char md5key[256] = "";
rmfile ./source/apps-extra/asterisk/ASA12.diff
hunk ./source/apps-extra/asterisk/CVE-2007-2488.diff 1
---- trunk/channels/chan_iax2.c	2007/04/30 16:16:26	62457
-+++ trunk/channels/chan_iax2.c	2007/05/02 17:49:36	62693
-@@ -6822,6 +6822,13 @@
- 			ast_mutex_unlock(&iaxsl[fr->callno]);
- 			return 1;
- 		}
-+		/* Ensure text frames are NULL-terminated */
-+		if (f.frametype == AST_FRAME_TEXT && thread->buf[res - 1] != '\0') {
-+			if (res < sizeof(thread->buf))
-+				thread->buf[res++] = '\0';
-+			else /* Trims one character from the text message, but that's better than overwriting the end of the buffer. */
-+				thread->buf[res - 1] = '\0';
-+		}
- 		f.datalen = res - sizeof(*fh);
- 
- 		/* Handle implicit ACKing unless this is an INVAL, and only if this is 
rmfile ./source/apps-extra/asterisk/CVE-2007-2488.diff
hunk ./source/apps-extra/asterisk/FrugalBuild 6
-pkgver=1.4.2
-pkgrel=2terminus2
+pkgver=1.4.8
+pkgrel=1terminus1
hunk ./source/apps-extra/asterisk/FrugalBuild 18
-source=(http://ftp.digium.com/pub/$pkgname/$pkgname-$pkgver.tar.gz \
-	rc.asterisk \
-	AEL2_secfix.patch ASA10.diff ASA11.diff ASA12.diff CVE-2007-2488.diff)
-sha1sums=('e11f605c0f467b58350b960a5c0e1e739b2262f5'\
-          '1c18155cdece83d556e2295b54508636ff74f307'\
-          'c862d7f43260e9645fffe897669cb37843bdb25c'\
-          'c796107d4528c8bcc1b89b52e74ef4e1dd572708'\
-          '40dee6c0024ae241cc0624dd55e7eb884802c2e9'\
-          '6a59164078855f3b6f5ab6236729879f7c65ce15'\
-          '547fa02528354db04bdc7d488a800fb961794c8c')
+source=(http://ftp.digium.com/pub/$pkgname/releases/$pkgname-$pkgver.tar.gz \
+	rc.asterisk)
+sha1sums=('030a6719940321b30f0aef32abc89c3caeeaa57b' \
+          '1c18155cdece83d556e2295b54508636ff74f307')
}


More information about the Frugalware-darcs mailing list