Summary:ASTERISK-27659: Output from rawman truncated if output is long enough
Reporter:Bojan Nemčić (bnemcic)Labels:
Date Opened:2018-02-06 07:14:56.000-0600Date Closed:2018-02-21 17:30:46.000-0600
Versions:15.2.0 Frequency of
Environment:Debian GNU/Linux 9 (Jessie)Attachments:
Description:Output from rawman is truncated if the output of the requested action is long enough (in my case >4100 bytes, but I cannot confirm if this is a constant on all systems).

Seems to be caused by the wrong argument order passed to {{lseek}}, patch attached.

diff --git a/main/manager.c b/main/manager.c
index 71d7432a0f..497e7e5f38 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -7657,7 +7657,7 @@ static void process_output(struct mansession *s, struct ast_str **out, struct as

       fd = ast_iostream_get_fd(s->stream);

-       l = lseek(fd, SEEK_CUR, 0);
+       l = lseek(fd, 0, SEEK_CUR);
       if (l > 0) {
               if (MAP_FAILED == (buf = mmap(NULL, l, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0))) {
                       ast_log(LOG_WARNING, "mmap failed.  Manager output was not processed\n");
Comments:By: Asterisk Team (asteriskteam) 2018-02-06 07:14:57.155-0600

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Friendly Automation (friendly-automation) 2018-02-21 17:30:47.005-0600

Change 8364 merged by Jenkins2:
manager.c: Fix lseek() parameter order.


By: Friendly Automation (friendly-automation) 2018-02-21 18:43:45.665-0600

Change 8365 merged by Jenkins2:
manager.c: Fix lseek() parameter order.