Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1454571 - Sudo, with I/O Logging log_output option enabled, truncate output in case of cycle over standard input
Sudo, with I/O Logging log_output option enabled, truncate output in case of ...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: sudo (Show other bugs)
7.4
x86_64 Linux
high Severity high
: rc
: ---
Assigned To: Radovan Sroka
Dalibor Pospíšil
https://bugzilla.sudo.ws/show_bug.cgi...
: Patch, Triaged
Depends On:
Blocks: 1420851 1454677
  Show dependency treegraph
 
Reported: 2017-05-23 01:23 EDT by Andrea Perotti
Modified: 2018-04-10 10:44 EDT (History)
5 users (show)

See Also:
Fixed In Version: sudo-1.8.19p2-12.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1454677 (view as bug list)
Environment:
Last Closed: 2018-04-10 10:44:23 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
script to replicate the error (187 bytes, application/x-shellscript)
2017-05-23 01:23 EDT, Andrea Perotti
no flags Details
Tests failed on RHEL6 (2.20 KB, text/plain)
2017-05-23 01:24 EDT, Andrea Perotti
no flags Details
Tests passed on RHEL6 + upstream sudo (1.46 KB, text/plain)
2017-05-23 01:24 EDT, Andrea Perotti
no flags Details
Tests failes on RHEL7 (1.38 KB, text/plain)
2017-05-23 01:25 EDT, Andrea Perotti
no flags Details
Tests failed on RHEL7 + passed with upstream sudo (2.42 KB, text/plain)
2017-05-23 01:26 EDT, Andrea Perotti
no flags Details
proposed patch (6.29 KB, patch)
2017-05-23 04:25 EDT, Daniel Kopeček
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0824 None None None 2018-04-10 10:44 EDT

  None (edit)
Description Andrea Perotti 2017-05-23 01:23:05 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
$
Comment 2 Andrea Perotti 2017-05-23 01:24 EDT
Created attachment 1281318 [details]
Tests failed on RHEL6
Comment 3 Andrea Perotti 2017-05-23 01:24 EDT
Created attachment 1281319 [details]
Tests passed on RHEL6 + upstream sudo
Comment 4 Andrea Perotti 2017-05-23 01:25 EDT
Created attachment 1281320 [details]
Tests failes on RHEL7
Comment 5 Andrea Perotti 2017-05-23 01:26 EDT
Created attachment 1281321 [details]
Tests failed on RHEL7 + passed with upstream sudo
Comment 7 Andrea Perotti 2017-05-23 01:37:21 EDT
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
$
Comment 8 Andrea Perotti 2017-05-23 01:41:52 EDT
This looks like the upstream bug:
https://bugzilla.sudo.ws/show_bug.cgi?id=786
Comment 12 Daniel Kopeček 2017-05-23 04:25 EDT
Created attachment 1281364 [details]
proposed patch
Comment 27 errata-xmlrpc 2018-04-10 10:44:23 EDT
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

Note You need to log in before you can comment on or make changes to this bug.