Bug 1369856

Summary: [RFE] synchronous write in sudo i/o logs
Product: Red Hat Enterprise Linux 7 Reporter: Andrea Perotti <aperotti>
Component: sudoAssignee: Tomas Sykora <tosykora>
Status: CLOSED ERRATA QA Contact: Dalibor Pospíšil <dapospis>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.3CC: aperotti, daniele, dkopecek, jnansi, pkis, pvrabec
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 17:03:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1420851    
Attachments:
Description Flags
Patch derived from upstream. none

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