Fix allow/disallow nomenclature (bug #2945, part deux)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.2-netsec
Mark Spencer 21 years ago
parent 4820c2bb97
commit 244dd57299

@ -8292,9 +8292,9 @@ static struct sip_user *build_user(const char *name, struct ast_variable *v)
user->amaflags = format; user->amaflags = format;
} }
} else if (!strcasecmp(v->name, "allow")) { } else if (!strcasecmp(v->name, "allow")) {
ast_parse_allow_deny(&user->prefs, &user->capability, v->value, 1); ast_parse_allow_disallow(&user->prefs, &user->capability, v->value, 1);
} else if (!strcasecmp(v->name, "disallow")) { } else if (!strcasecmp(v->name, "disallow")) {
ast_parse_allow_deny(&user->prefs, &user->capability, v->value, 0); ast_parse_allow_disallow(&user->prefs, &user->capability, v->value, 0);
} else if (!strcasecmp(v->name, "insecure")) { } else if (!strcasecmp(v->name, "insecure")) {
user->insecure = ast_true(v->value); user->insecure = ast_true(v->value);
} else if (!strcasecmp(v->name, "callingpres")) { } else if (!strcasecmp(v->name, "callingpres")) {
@ -8550,9 +8550,9 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, int
} else if (!strcasecmp(v->name, "pickupgroup")) { } else if (!strcasecmp(v->name, "pickupgroup")) {
peer->pickupgroup = ast_get_group(v->value); peer->pickupgroup = ast_get_group(v->value);
} else if (!strcasecmp(v->name, "allow")) { } else if (!strcasecmp(v->name, "allow")) {
ast_parse_allow_deny(&peer->prefs, &peer->capability, v->value, 1); ast_parse_allow_disallow(&peer->prefs, &peer->capability, v->value, 1);
} else if (!strcasecmp(v->name, "disallow")) { } else if (!strcasecmp(v->name, "disallow")) {
ast_parse_allow_deny(&peer->prefs, &peer->capability, v->value, 0); ast_parse_allow_disallow(&peer->prefs, &peer->capability, v->value, 0);
} else if (!strcasecmp(v->name, "insecure")) { } else if (!strcasecmp(v->name, "insecure")) {
if (!strcasecmp(v->value, "very")) { if (!strcasecmp(v->value, "very")) {
peer->insecure = 2; peer->insecure = 2;
@ -8826,9 +8826,9 @@ static int reload_config(void)
else else
memcpy(&externip.sin_addr, hp->h_addr, sizeof(externip.sin_addr)); memcpy(&externip.sin_addr, hp->h_addr, sizeof(externip.sin_addr));
} else if (!strcasecmp(v->name, "allow")) { } else if (!strcasecmp(v->name, "allow")) {
ast_parse_allow_deny(&prefs, &global_capability, v->value, 1); ast_parse_allow_disallow(&prefs, &global_capability, v->value, 1);
} else if (!strcasecmp(v->name, "disallow")) { } else if (!strcasecmp(v->name, "disallow")) {
ast_parse_allow_deny(&prefs, &global_capability, v->value, 0); ast_parse_allow_disallow(&prefs, &global_capability, v->value, 0);
} else if (!strcasecmp(v->name, "register")) { } else if (!strcasecmp(v->name, "register")) {
sip_register(v->value, v->lineno); sip_register(v->value, v->lineno);
} else if (!strcasecmp(v->name, "recordhistory")) { } else if (!strcasecmp(v->name, "recordhistory")) {

@ -3,9 +3,9 @@
* *
* Frame manipulation routines * Frame manipulation routines
* *
* Copyright (C) 1999, Mark Spencer * Copyright (C) 1999-2004, Digium, Inc.
* *
* Mark Spencer <markster@linux-support.net> * Mark Spencer <markster@digium.com>
* *
* This program is free software, distributed under the terms of * This program is free software, distributed under the terms of
* the GNU General Public License * the GNU General Public License
@ -958,7 +958,7 @@ int ast_codec_choose(struct ast_codec_pref *pref, int formats, int find_best)
return find_best ? ast_best_codec(formats) : 0; return find_best ? ast_best_codec(formats) : 0;
} }
void ast_parse_allow_deny(struct ast_codec_pref *pref, int *mask, char *list, int allowing) void ast_parse_allow_disallow(struct ast_codec_pref *pref, int *mask, char *list, int allowing)
{ {
int format_i = 0; int format_i = 0;
char *next_format = NULL, *last_format = NULL; char *next_format = NULL, *last_format = NULL;

@ -3,9 +3,9 @@
* *
* Asterisk internal frame definitions. * Asterisk internal frame definitions.
* *
* Copyright (C) 1999, Mark Spencer * Copyright (C) 1999-2004, Digium, Inc.
* *
* Mark Spencer <markster@linux-support.net> * Mark Spencer <markster@digium.com>
* *
* This program is free software, distributed under the terms of * This program is free software, distributed under the terms of
* the GNU Lesser General Public License. Other components of * the GNU Lesser General Public License. Other components of
@ -398,7 +398,7 @@ extern int ast_codec_pref_append(struct ast_codec_pref *pref, int format);
extern int ast_codec_choose(struct ast_codec_pref *pref, int formats, int find_best); extern int ast_codec_choose(struct ast_codec_pref *pref, int formats, int find_best);
/* Parse an "allow" or "deny" line and update the mask and pref if provided */ /* Parse an "allow" or "deny" line and update the mask and pref if provided */
extern void ast_parse_allow_deny(struct ast_codec_pref *pref, int *mask, char *list, int allowing); extern void ast_parse_allow_disallow(struct ast_codec_pref *pref, int *mask, char *list, int allowing);
/* Dump codec preference list into a string */ /* Dump codec preference list into a string */
extern int ast_codec_pref_string(struct ast_codec_pref *pref, char *buf, size_t size); extern int ast_codec_pref_string(struct ast_codec_pref *pref, char *buf, size_t size);

Loading…
Cancel
Save