Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1005202 - running "ausearch -m avc,user_avc -ts today" over ssh gets stuck
Summary: running "ausearch -m avc,user_avc -ts today" over ssh gets stuck
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: audit
Version: 6.5
Hardware: x86_64
OS: Linux
Target Milestone: rc
: ---
Assignee: Steve Grubb
QA Contact: BaseOS QE Security Team
Depends On:
Blocks: 1010472 1032706
TreeView+ depends on / blocked
Reported: 2013-09-06 12:38 UTC by Martin Pavlik
Modified: 2015-04-07 03:10 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-11-21 11:13:16 UTC
Target Upstream Version:

Attachments (Terms of Use)
strace (deleted)
2013-09-09 07:12 UTC, Martin Pavlik
no flags Details
strace_ausearch (deleted)
2013-09-16 06:31 UTC, Martin Pavlik
no flags Details

Description Martin Pavlik 2013-09-06 12:38:36 UTC
Description of problem:

running on RHEL 6.4/6.5
ssh ausearch -m avc,user_avc -ts today
gets stuck

while running the command on the node returns result immediately

ausearch -m avc,user_avc -ts today
<no matches>

Version-Release number of selected component (if applicable):
rpm -qa audit

How reproducible:

Steps to Reproduce:
1. run ssh $IP ausearch -m avc,user_avc -ts today

Actual results:
command gets stuck

Expected results:
command returns valid response

Additional info:

this BZ was raised based on bug 1005066 , there is some more information which might be useful

Comment 1 Steve Grubb 2013-09-06 17:26:01 UTC
I have no idea why it would get stuck. It uses printf to write out the findings. Maybe strace would help locate the problem?

Comment 2 Martin Pavlik 2013-09-09 07:12:06 UTC
Created attachment 795507 [details]

Comment 3 Steve Grubb 2013-09-14 14:31:07 UTC
Thanks for the strace. It shows the client end waiting for something. What I am curious about is what ausearch is doing. If this is still reproducable, could you get an strace of ausearch? Thanks.

Comment 4 Martin Pavlik 2013-09-16 06:31:42 UTC
Created attachment 798111 [details]

Comment 5 Sandro Bonazzola 2013-09-23 06:23:50 UTC
If it may help, ssh -t seems to solve the issue.
Derrick Ornelas says:
The issue appears to be that the ausearch command requires a controlling TTY(pty), and hangs indefinitely without access to one.

Comment 6 RHEL Product and Program Management 2013-10-13 23:11:57 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 7 Bryn M. Reeves 2013-11-21 11:13:16 UTC
Florian pointed out in bug 1032706 that this is actually expected behaviour when stdin is a pipe:

> ausearch doesn't need a TTY, it alters behavior if the input is a pipe.
> This is documented behavior, mentioned in the manpage:
>   --input-logs
>       Use  the log file location from auditd.conf as input for search‐
>       ing. This is needed if you are using ausearch from a cron job.

And reading the log from stdin is mentioned in the opening paragraph of the man pages for ausearch and aureport (which has the same logic):

    "The ausearch utility can also take input from stdin as long as the input
     is the raw log data."

Seems this is NOTABUG.

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