[asterisk-bugs] [JIRA] (ASTERISK-24720) Unable to change voicemail password using realtime engine
Leandro Dardini (JIRA)
noreply at issues.asterisk.org
Sun Jan 25 03:49:34 CST 2015
[ https://issues.asterisk.org/jira/browse/ASTERISK-24720?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Leandro Dardini updated ASTERISK-24720:
---------------------------------------
Description:
It is not possible to change the voicemail password due to a bug in the ast_update2_realtime function, used only to update the voicemail table, the only one having two fields to be selected in the filter.
The function decodes twice the lookup_fields and do not decode the update_fields.
{code}
--- main/config.c.orig 2015-01-25 10:38:32.000000000 +0100
+++ main/config.c 2015-01-25 10:39:03.000000000 +0100
@@ -3317,31 +3317,31 @@
int ast_update2_realtime(const char *family, ...)
{
RAII_VAR(struct ast_variable *, lookup_fields, NULL, ast_variables_destroy);
RAII_VAR(struct ast_variable *, update_fields, NULL, ast_variables_destroy);
va_list ap;
va_start(ap, family);
/* XXX: If we wanted to pass no lookup fields (select all), we'd be
* out of luck. realtime_arguments_to_fields expects at least one key
* value pair. */
realtime_arguments_to_fields(ap, &lookup_fields);
va_end(ap);
va_start(ap, family);
- realtime_arguments_to_fields2(ap, 1, &lookup_fields);
+ realtime_arguments_to_fields2(ap, 1, &update_fields);
va_end(ap);
if (!lookup_fields || !update_fields) {
return -1;
}
return ast_update2_realtime_fields(family, lookup_fields, update_fields);
}
int ast_store_realtime_fields(const char *family, const struct ast_variable *fields)
{
struct ast_config_engine *eng;
int res = -1, i;
char db[256];
char table[256];
{code}
was:
It is not possible to change the voicemail password due to a bug in the ast_update2_realtime function, used only to update the voicemail table, the only one having two fields to be selected in the filter.
The function decodes twice the lookup_fields and do not decode the update_fields.
{code}
--- main/config.c.orig 2015-01-25 10:38:32.000000000 +0100
+++ main/config.c 2015-01-25 10:39:03.000000000 +0100
@@ -3329,7 +3329,7 @@
va_end(ap);
va_start(ap, family);
- realtime_arguments_to_fields2(ap, 1, &lookup_fields);
+ realtime_arguments_to_fields2(ap, 1, &update_fields);
va_end(ap);
if (!lookup_fields || !update_fields) {
{code}
> Unable to change voicemail password using realtime engine
> ---------------------------------------------------------
>
> Key: ASTERISK-24720
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-24720
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Affects Versions: 13.1.0
> Environment: Voicemail ODBC storage on mysql using
> Reporter: Leandro Dardini
> Severity: Minor
>
> It is not possible to change the voicemail password due to a bug in the ast_update2_realtime function, used only to update the voicemail table, the only one having two fields to be selected in the filter.
> The function decodes twice the lookup_fields and do not decode the update_fields.
> {code}
> --- main/config.c.orig 2015-01-25 10:38:32.000000000 +0100
> +++ main/config.c 2015-01-25 10:39:03.000000000 +0100
> @@ -3317,31 +3317,31 @@
>
> int ast_update2_realtime(const char *family, ...)
> {
> RAII_VAR(struct ast_variable *, lookup_fields, NULL, ast_variables_destroy);
> RAII_VAR(struct ast_variable *, update_fields, NULL, ast_variables_destroy);
> va_list ap;
>
> va_start(ap, family);
> /* XXX: If we wanted to pass no lookup fields (select all), we'd be
> * out of luck. realtime_arguments_to_fields expects at least one key
> * value pair. */
> realtime_arguments_to_fields(ap, &lookup_fields);
> va_end(ap);
>
> va_start(ap, family);
> - realtime_arguments_to_fields2(ap, 1, &lookup_fields);
> + realtime_arguments_to_fields2(ap, 1, &update_fields);
> va_end(ap);
>
> if (!lookup_fields || !update_fields) {
> return -1;
> }
>
> return ast_update2_realtime_fields(family, lookup_fields, update_fields);
> }
>
> int ast_store_realtime_fields(const char *family, const struct ast_variable *fields)
> {
> struct ast_config_engine *eng;
> int res = -1, i;
> char db[256];
> char table[256];
> {code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list