RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1369856 - [RFE] synchronous write in sudo i/o logs
Summary: [RFE] synchronous write in sudo i/o logs
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: sudo
Version: 7.3
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Tomas Sykora
QA Contact: Dalibor Pospíšil
URL:
Whiteboard:
Depends On:
Blocks: 1420851
TreeView+ depends on / blocked
 
Reported: 2016-08-24 14:38 UTC by Andrea Perotti
Modified: 2020-09-10 09:46 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 17:03:40 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch derived from upstream. (11.11 KB, patch)
2017-03-23 15:25 UTC, Tomas Sykora
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2017 0 normal SHIPPED_LIVE sudo bug fix and enhancement update 2017-08-01 18:02:36 UTC

Description Andrea Perotti 2016-08-24 14:38:07 UTC
What problem/issue/behavior are you having trouble with?  What do you expect to see?

1. Proposed title of this feature request
Ability to use synchronous writes in sudo i/o logs. Customer is willing to disable compression to achieve synchronous writes to io_logs. 

3. What is the nature and description of the request? 
According to https://www.sudo.ws/man/1.8.17/sudoers.man.html
"All files other than log are compressed in gzip format unless the compress_io option has been disabled. Due to buffering, the I/O log data will not be complete until the sudo command has completed."
Seems anyway that I/O logs are buffered if compressed, but for compliance reasons is more important for the customer to be sure those writes synchronous.

According to Jatin Nansi, "Disabling compression is only a prerequisite. We still need code change to get an option for synchronous writes to iolog files."

4. Why does the customer need this? (List the business requirements here)
We need to use I/O logs for compliance, therefore we need to have the possibility to write log in synchronous mode.

5. How would the customer like to achieve this? (List the functional requirements here)
We would like to have one flag to have synchronous logs enabled.

6. For each functional requirement listed in question 5, specify how Red Hat
and the customer can test to confirm the requirement is successfully implemented.

- enable the flag
- start sudo session
- kill -9 the sudo command
- open the log and verify the content

8. Does the customer have any specific timeline dependencies?
End of 2016

9. Is the sales team involved in this request and do they have any additional input?
no 

11. Would the customer be able to assist in testing this functionality if implemented?
Yes, sure

Where are you experiencing the behavior?  What environment?

PROD

When does the behavior occur? Frequently?  Repeatedly? At certain times?

Always


What information can you provide around timeframes and urgency?
Not urgent but important.

Comment 5 Tomas Sykora 2017-03-20 12:58:52 UTC
Hi Andrea,

it seems sudo io writes are synchronous when the sudo command is killed. I tried it myself and you can also check the conversation with upstream here: https://www.sudo.ws/pipermail/sudo-workers/2017-March/001055.html. They changed documentation a little bit so it is more clear now. If I am wrong how did the customer reproduce these non-synchronous writes exactly? What did he mean by logs to be complete? I tried it with a program which prints a string to stdout every x seconds, where x is a very small time period, killed the command with kill -9, then checked logs with sudoreplay. The output was correct every time.

Comment 6 Andrea Perotti 2017-03-20 13:30:39 UTC
(In reply to Tomas Sykora from comment #5)
> it seems sudo io writes are synchronous when the sudo command is killed.

Hi Tomas,
         thanks for updating and sharing the upstream conversation.

The use case that the customer want to achieve is a little bit more extreme: to be sure that all writes are commited despite any kind of external event, like fencing or power loss.

So I think we can move on explaining that scenario to Todd Miller, or presenting it to him as "watch the logs in real-time" ;-)

Comment 8 Tomas Sykora 2017-03-21 08:47:40 UTC
Upstream implemented a new option for this use case: https://www.sudo.ws/repos/sudo/rev/96baa17409cf, if it is ok with the customer we can backport it.

Comment 12 Tomas Sykora 2017-03-23 15:25:03 UTC
Created attachment 1265819 [details]
Patch derived from upstream.

Comment 15 errata-xmlrpc 2017-08-01 17:03:40 UTC
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-2017:2017

Comment 16 errata-xmlrpc 2017-08-01 17:27:35 UTC
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-2017:2017


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