Bug 633213 - sealert does not like duplicated command line options
Summary: sealert does not like duplicated command line options
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: setroubleshoot
Version: 6.0
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Daniel Walsh
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks: 636413
TreeView+ depends on / blocked
 
Reported: 2010-09-13 08:55 UTC by Milos Malik
Modified: 2012-06-20 12:34 UTC (History)
3 users (show)

Fixed In Version: setroubleshoot-3.0.45-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 636413 (view as bug list)
Environment:
Last Closed: 2012-06-20 12:34:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0781 0 normal SHIPPED_LIVE setroubleshoot bug fix update 2012-06-19 20:34:57 UTC

Description Milos Malik 2010-09-13 08:55:00 UTC
Description of problem:
I accidentally typed the same option twice and sealert refused to work. The message is kind of funny.: "cannot run as browser, already selected browser".

Version-Release number of selected component (if applicable):
setroubleshoot-server-2.2.94-1.el6.i686
setroubleshoot-plugins-2.1.60-1.el6.noarch
setroubleshoot-2.2.94-1.el6.i686
setroubleshoot-doc-2.2.94-1.el6.i686

How reproducible:
always

Steps to Reproduce:
# sealert -a -a
cannot run as analyze, already selected analyze

        -b --browser         Launch the browser
        -h --help            Show this message
        -s --service         Start sealert as a dbus service
        -S --noservice       Start sealert without dbus service as stand alone app
        -l --lookupid id     Lookup alert by id, id may be wildcard * to lookup all alerts
        -a --analyze file    Scan a log file, analyze it's AVC's
        -H --html_output     Ouput in html
        -v --verbose         log INFO level and higher messages to console
        -V --debug           log DEBUG level and higher messages to console
        -u --user            logon user name
        -p --password        logon password
        -f --fix             fix avc with the given uuid
        
# sealert -s -s
cannot run as service, already selected service

        -b --browser         Launch the browser
        -h --help            Show this message
        -s --service         Start sealert as a dbus service
        -S --noservice       Start sealert without dbus service as stand alone app
        -l --lookupid id     Lookup alert by id, id may be wildcard * to lookup all alerts
        -a --analyze file    Scan a log file, analyze it's AVC's
        -H --html_output     Ouput in html
        -v --verbose         log INFO level and higher messages to console
        -V --debug           log DEBUG level and higher messages to console
        -u --user            logon user name
        -p --password        logon password
        -f --fix             fix avc with the given uuid
        
# sealert -S -S
cannot run as noservice, already selected noservice

        -b --browser         Launch the browser
        -h --help            Show this message
        -s --service         Start sealert as a dbus service
        -S --noservice       Start sealert without dbus service as stand alone app
        -l --lookupid id     Lookup alert by id, id may be wildcard * to lookup all alerts
        -a --analyze file    Scan a log file, analyze it's AVC's
        -H --html_output     Ouput in html
        -v --verbose         log INFO level and higher messages to console
        -V --debug           log DEBUG level and higher messages to console
        -u --user            logon user name
        -p --password        logon password
        -f --fix             fix avc with the given uuid
        
# sealert -b -b
cannot run as browser, already selected browser

        -b --browser         Launch the browser
        -h --help            Show this message
        -s --service         Start sealert as a dbus service
        -S --noservice       Start sealert without dbus service as stand alone app
        -l --lookupid id     Lookup alert by id, id may be wildcard * to lookup all alerts
        -a --analyze file    Scan a log file, analyze it's AVC's
        -H --html_output     Ouput in html
        -v --verbose         log INFO level and higher messages to console
        -V --debug           log DEBUG level and higher messages to console
        -u --user            logon user name
        -p --password        logon password
        -f --fix             fix avc with the given uuid

  
Actual results:
sealert terminates with an error message

Expected results:
sealert works as expected, duplicated option is ignored

Comment 1 Daniel Walsh 2010-09-13 13:59:51 UTC
sealert -a -a
cannot run as analyze, already selected analyze

        -b --browser         Launch the browser
        -h --help            Show this message
        -s --service         Start sealert as a dbus service
        -S --noservice       Start sealert without dbus service as stand alone app
        -l --lookupid id     Lookup alert by id, id may be wildcard * to lookup all alerts
        -a --analyze file    Scan a log file, analyze it's AVC's
        -H --html_output     Ouput in html
        -v --verbose         log INFO level and higher messages to console
        -V --debug           log DEBUG level and higher messages to console
        -u --user            logon user name
        -p --password        logon password
        -f --fix             fix avc with the given uuid
        

This is what I am seeing in F14.   I am not sure what you would want the error message to say.

Comment 2 Milos Malik 2010-09-13 14:16:51 UTC
I would like to see sealert doing the analysis instead of printing an error message. I didn't choose two antagonistic functions of sealert. sealert should quietly ignore other occurrences of '-a' on the command line, because they do not conflict with each other.

Comment 3 Daniel Walsh 2010-09-13 14:43:43 UTC
-a expects a file to be handed to it.

Comment 4 Milos Malik 2010-09-13 14:57:03 UTC
OK, I'm taking back my note about '-a', it works fine when a file is attached to it. However, sealert still pretends that duplicated '-b' or '-s' or '-S' are in conflict.

Comment 5 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 7 Daniel Walsh 2011-05-23 18:44:05 UTC
Fixed in setroubleshoot-3.0.31-1.el6

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

Comment 15 Miroslav Grepl 2011-09-07 15:02:47 UTC
Well, the question is whether this is a bug. 

If yes, I don't think this is so important and we can move it to RHEL6.3.

Comment 16 Daniel Walsh 2011-09-07 16:30:02 UTC
I agree.

Comment 18 Miroslav Grepl 2011-12-09 12:13:31 UTC
We need to backport a patch from Fedora.

Comment 19 Daniel Walsh 2011-12-22 15:24:16 UTC
Fixed in setroubleshoot-3.0.45-1.el6

Comment 24 errata-xmlrpc 2012-06-20 12:34:42 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-2012-0781.html


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