Bug 783 - In detailed list option (-ll), blank lines are replaced by a previous line when piped or redirected to a file
In detailed list option (-ll), blank lines are replaced by a previous line wh...
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Sudo
1.7.2
PC AIX
: low normal
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-04-26 11:38 MDT by Marc Beaudoin
Modified: 2017-04-26 13:36 MDT (History)
0 users

See Also:


Attachments
Copy and paste of "sudo -ll" directed to the terminal (PUTTY) (1.47 KB, text/plain)
2017-04-26 11:38 MDT, Marc Beaudoin
Details
Copy and paste of "sudo -ll | cat". Notice how blank lines are ofthen replaced by a previous non-blank line. (2.24 KB, text/plain)
2017-04-26 11:41 MDT, Marc Beaudoin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Beaudoin 2017-04-26 11:38:49 MDT
Created attachment 491 [details]
Copy and paste of "sudo -ll" directed to the terminal (PUTTY)

"sudo -ll" works fine as long as it goes to a terminal.  When output is directed to a variable, a file or a pipe, output is different: replacing most blank lines with a previous line.

The bug appears on RHEL 5.11 (2.6.18-406.el5); the bug no longer exists on RHEL 7.3 (3.10.0-327.22.2.el7).

I shall attach output copy of "sudo -ll" and "sudo -ll | cat".

I guess this is a known bug that was fixed between RHEL 5.11 and RHEL 7.3, but I could not find it with your search engine.

I hope there is a workaround or a patch: upgrading the entire O/S is going to take lots of time.
Comment 1 Marc Beaudoin 2017-04-26 11:41:11 MDT
Created attachment 492 [details]
Copy and paste of "sudo -ll | cat".  Notice how blank lines are ofthen replaced by a previous non-blank line.
Comment 2 Todd C. Miller 2017-04-26 12:45:39 MDT
I'm quite certain this was fixed several years ago.  You can find updated sudo packages for RHEL 5 at https://www.sudo.ws/download.html#binary

It is probably easier to update the sudo package than to update the entire OS.
Comment 3 Marc Beaudoin 2017-04-26 13:36:30 MDT
It works!

My SysAdmin was brave enough to apply the new version of "sudo" on a production server before I had a chance to warn it.

We were both impressed that it worked.  I whish all RHEL programs could be supported this way.

Regards,
Marc.