Bug 625468

Summary: sealert --analyze together with --service or --browser hangs
Product: Red Hat Enterprise Linux 6 Reporter: David Kutálek <dkutalek>
Component: setroubleshootAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0CC: mgrepl, mmalik, syeghiay
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: setroubleshoot-3.0.38-2.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 09:46:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Kutálek 2010-08-19 14:31:16 UTC
Description of problem:

These commands start to analyze, but hangs with 0% done:

sealert -a ./dummy-audit.log -b
sealert -a ./dummy-audit.log -s

With parameters swapped, sealert informs user these are mutually exclusive.
Therefore it seems like a bug in parameter checks.

Anyway, it would be nice to see a way how to start gui browser with custom file data. Original intention with above commands was to report alert from custom file to GSS service, which is probably not possible with current feature set.

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

setroubleshoot-server-2.2.93-1.el6.x86_64

How reproducible:

Always

Steps to Reproduce:
1a. sealert -a /var/log/audit/audit.log -b
1b. sealert -a /var/log/audit/audit.log -s

  
Actual results:


Expected results:


Additional info:

Traceback when interrupted by double Ctrl-C:

[root@timothy bz567972-create-plugin-to-talk-with-GSS-s-Support-API]# sealert -a ./dummy-audit.log -s
  0% done^CTraceback (most recent call last):
  File "/usr/lib64/python2.6/site-packages/setroubleshoot/analyze.py", line 619, in task
    new_data = os.read(self.fileno, self.read_size)
KeyboardInterrupt
^CTraceback (most recent call last):
  File "/usr/bin/sealert", line 999, in <module>
    do_analyze_logfile(logfile, html)
  File "/usr/bin/sealert", line 829, in do_analyze_logfile
    scanner.scan_file()
  File "/usr/bin/sealert", line 809, in scan_file
    self.main_loop.run()
KeyboardInterrupt

Comment 1 Milos Malik 2010-09-13 13:15:15 UTC
The same result with '-S' option instead of '-b' or '-s'.

# sealert -a /var/log/audit/audit.log -S
  0% done^CTraceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/setroubleshoot/analyze.py", line 619, in task
    new_data = os.read(self.fileno, self.read_size)
KeyboardInterrupt
^CTraceback (most recent call last):
  File "/usr/bin/sealert", line 1000, in <module>
    do_analyze_logfile(logfile, html)
  File "/usr/bin/sealert", line 830, in do_analyze_logfile
    scanner.scan_file()
  File "/usr/bin/sealert", line 810, in scan_file
    self.main_loop.run()
KeyboardInterrupt
#

Comment 2 Milos Malik 2010-09-13 13:17:21 UTC
# sealert -a /var/log/audit/audit.log -l
  0% done^CTraceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/setroubleshoot/analyze.py", line 619, in task
    new_data = os.read(self.fileno, self.read_size)
KeyboardInterrupt
^CTraceback (most recent call last):
  File "/usr/bin/sealert", line 1000, in <module>
    do_analyze_logfile(logfile, html)
  File "/usr/bin/sealert", line 830, in do_analyze_logfile
    scanner.scan_file()
  File "/usr/bin/sealert", line 810, in scan_file
    self.main_loop.run()
KeyboardInterrupt
# sealert -a /var/log/audit/audit.log -H
  0% done^CTraceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/setroubleshoot/analyze.py", line 619, in task
    new_data = os.read(self.fileno, self.read_size)
KeyboardInterrupt
^CTraceback (most recent call last):
  File "/usr/bin/sealert", line 1000, in <module>
    do_analyze_logfile(logfile, html)
  File "/usr/bin/sealert", line 830, in do_analyze_logfile
    scanner.scan_file()
  File "/usr/bin/sealert", line 810, in scan_file
    self.main_loop.run()
KeyboardInterrupt
#

Comment 3 Daniel Walsh 2010-11-22 21:25:46 UTC
I would prefer to push off setroubleshoot to see how well the redesign in Fedora 15 goes, and then update to that package in 6.2.

Comment 4 Daniel Walsh 2010-11-22 21:27:49 UTC
I would prefer to push off setroubleshoot to see how well the redesign in Fedora 15 goes, and then update to that package in 6.2.

Comment 6 Daniel Walsh 2011-05-23 18:51:19 UTC
Fixed in setroubleshoot-3.0.31-1.el6

Comment 7 Eduard Benes 2011-06-27 09:05:08 UTC
Clearing qa_ack, setroubleshoot has been removed from 6.2 approved list.

Comment 13 Miroslav Grepl 2011-09-08 08:42:37 UTC
Ok, the problem is also the new setroubleshoot does not have this ability. I think we could add it but I believe is too late for RHEL6.2.

So I would just add a "fix" which will say "do not use -a or --analyze option with other options"

Something like

        if sys.argv.count('-a') > 0:
            if valid_opts.count(sys.argv[-1]) == 0:
                last = True
+            else:
+                print >> sys.stderr, "-a or --analyze option can not be used with an other option"
+                usage()
+                sys.exit(3)

Comment 14 David Kutálek 2011-09-08 11:24:52 UTC
(In reply to comment #13)
> Ok, the problem is also the new setroubleshoot does not have this ability. I
> think we could add it but I believe is too late for RHEL6.2.
> 
> So I would just add a "fix" which will say "do not use -a or --analyze option
> with other options"

Not ideal, but still better than hang. If closing bug this way, please fill new one requesting at least -a and -b working together (seems to me usefull).

Comment 15 Miroslav Grepl 2011-09-15 08:36:30 UTC
Fixed in  setroubleshoot-3.0.38-2.el6

David,
I agree with you and I will open a new bug on RHEL6.3.

Comment 18 errata-xmlrpc 2011-12-06 09:46:31 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.

http://rhn.redhat.com/errata/RHBA-2011-1509.html