Red Hat Bugzilla – Bug 1454571
Sudo, with I/O Logging log_output option enabled, truncate output in case of cycle over standard input
Last modified: 2018-04-10 10:44:43 EDT
Created attachment 1281317 [details] script to replicate the error Description of problem: There's an issue with sudo, that is truncating output in stdout file descriptor upon log_output (io logging) option usage. Version-Release number of selected component (if applicable): Affected and tested versions: * RHEL6 sudo-1.8.6p3-25.el6_8.x86_64 rpm * RHEL7 sudo-1.8.6p7-21.el7_3.x86_64 rpm * RHEL7 sudo-1.8.19p2-1.el7_3.x86_64 BETA rpm NOT Affected version: * RHEL6 upstream sudo-1.8.20-1.el6.x86_64 rpm (http://ftp.sudo.ws/pub/sudo/packages/Centos/6/sudo-1.8.20-1.el6.x86_64.rpm) How reproducible: Always Steps to Reproduce: Just run this script (also attacched): #!/bin/bash printf "usqpsinfra1\nusqpsinfra2\n" | while read node; do sudo echo $node; done Actual results: only usqpsinfra1 is outputted: $ bash -x test + read node + printf 'usqpsinfra1\nusqpsinfra2\n' + sudo echo usqpsinfra1 usqpsinfra1 + read node $ Expected results: $ bash -x test + read node + printf 'usqpsinfra1\nusqpsinfra2\n' + sudo echo usqpsinfra1 usqpsinfra1 + read node + sudo echo usqpsinfra2 usqpsinfra2 + read node $
Created attachment 1281318 [details] Tests failed on RHEL6
Created attachment 1281319 [details] Tests passed on RHEL6 + upstream sudo
Created attachment 1281320 [details] Tests failes on RHEL7
Created attachment 1281321 [details] Tests failed on RHEL7 + passed with upstream sudo
Outputting to STDERR the issue is not present: $ cat test #!/bin/bash -x printf "usqpsinfra1\nusqpsinfra2\n" | while read node; do sudo echo $node; done printf "usqpsinfra1err\nusqpsinfra2err\n" | while read node; do sudo echo $node 0>&1; done $ ./test + printf 'usqpsinfra1\nusqpsinfra2\n' + read node + sudo echo usqpsinfra1 usqpsinfra1 + read node #### <--- MISSING usqpsinfra2 + read node + printf 'usqpsinfra1err\nusqpsinfra2err\n' + sudo echo usqpsinfra1err usqpsinfra1err + read node + sudo echo usqpsinfra2err usqpsinfra2err + read node $
This looks like the upstream bug: https://bugzilla.sudo.ws/show_bug.cgi?id=786
Created attachment 1281364 [details] proposed patch
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:0824