Bug 625468 - sealert --analyze together with --service or --browser hangs
sealert --analyze together with --service or --browser hangs
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: setroubleshoot (Show other bugs)
6.0
All Linux
medium Severity medium
: rc
: ---
Assigned To: Miroslav Grepl
Milos Malik
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-19 10:31 EDT by David Kutálek
Modified: 2016-02-11 10:47 EST (History)
3 users (show)

See Also:
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 04:46:31 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1509 normal SHIPPED_LIVE setroubleshoot bug fix update 2011-12-05 19:39:33 EST

  None (edit)
Description David Kutálek 2010-08-19 10:31:16 EDT
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 09:15:15 EDT
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 09:17:21 EDT
# 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 16:25:46 EST
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 16:27:49 EST
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 14:51:19 EDT
Fixed in setroubleshoot-3.0.31-1.el6
Comment 7 Eduard Benes 2011-06-27 05:05:08 EDT
Clearing qa_ack, setroubleshoot has been removed from 6.2 approved list.
Comment 13 Miroslav Grepl 2011-09-08 04:42:37 EDT
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 07:24:52 EDT
(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 04:36:30 EDT
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 04:46:31 EST
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

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