[asterisk-bugs] [Asterisk 0016858]: asterisk command history loads as unusable garbage

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Mar 3 16:19:36 CST 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=16858 
====================================================================== 
Reported By:                jw-asterisk
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   16858
Category:                   Core/General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     feedback
Asterisk Version:           1.6.2.2 
JIRA:                       SWP-932 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-02-17 21:19 CST
Last Modified:              2010-03-03 16:19 CST
====================================================================== 
Summary:                    asterisk command history loads as unusable garbage
Description: 
When using asterisk interactively with command interface a history file is
created (~/.asterisk_history). Lines written to the history file are
white-space encoded (in ast_el_write_history:history:case
H_SAVE:history_save:strvis).

But when the history file is loaded it reverse (strunvis) is not
performed.  Therefore the history becomes unusable garbage.
====================================================================== 

---------------------------------------------------------------------- 
 (0118911) jw-asterisk (reporter) - 2010-03-03 16:19
 https://issues.asterisk.org/view.php?id=16858#c118911 
---------------------------------------------------------------------- 
Confirmed that this is broken with 1.6.2.5

Imadsen ... you don't even say what version installs on Ubuntu 9.10 OS. 
That isn't very helpful.

jotdd - you doubt it's broken?  Why do you doubt it? Look, asterisk is
full of bugs and always has been.  So why can there be some doubt purely on
the basis that asterisk never has bugs?

Here is the offending code out of 1.6.2.5 - see it doesn't reverse the
encodec characters:

> static int ast_el_read_history(char *filename)
> {
>        char buf[MAX_HISTORY_COMMAND_LENGTH];
>        FILE *f;
>         int ret = -1;
>
>        if (el_hist == NULL || el == NULL)
>                ast_el_initialize();
>
>        if ((f = fopen(filename, "r")) == NULL)
>                return ret;
>
>        while (!feof(f)) {
>                if (!fgets(buf, sizeof(buf), f))
>                        break;
>                if (!strcmp(buf, "_HiStOrY_V2_\n"))
>                        continue;
>                if (ast_all_zeros(buf))
>                        continue;
>                if ((ret = ast_el_add_history(buf)) == -1)
>                        break;
>        } 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-03-03 16:19 jw-asterisk    Note Added: 0118911                          
======================================================================




More information about the asterisk-bugs mailing list