Bug 456666

Summary: msghack doesn't check for mandatory cmd line params
Product: [Fedora] Fedora Reporter: Milos Malik <mmalik>
Component: gettextAssignee: Ding-Yi Chen <dchen>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: medium    
Version: 10CC: i18n-bugs, petersen
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-29 01:07:24 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 Milos Malik 2008-07-25 13:30:49 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.16) Gecko/20080715 Fedora/2.0.0.16-1.fc8 Firefox/2.0.0.16

Description of problem:
msghack does not check if mandatory command line parameters are present. This behavior leads to various tracebacks.



Version-Release number of selected component (if applicable):
gettext-0.16.1-12.fc8

How reproducible:
Always


Steps to Reproduce:
$ msghack -o
Traceback (most recent call last):
  File "/usr/bin/msghack", line 351, in <module>
    output=sys.argv[sys.argv.index("-o")+1]
IndexError: list index out of range
$ msghack --invert
Traceback (most recent call last):
  File "/usr/bin/msghack", line 355, in <module>
    file=sys.argv[sys.argv.index("--invert")+1]
IndexError: list index out of range
$ msghack --master
Traceback (most recent call last):
  File "/usr/bin/msghack", line 371, in <module>
    master=GTMaster(gtfs)
  File "/usr/bin/msghack", line 315, in __init__
    self.createMaster(dicts)
  File "/usr/bin/msghack", line 324, in createMaster
    self._master=dicts[0]
IndexError: list index out of range
$ msghack --empty
Traceback (most recent call last):
  File "/usr/bin/msghack", line 363, in <module>
    file=sys.argv[sys.argv.index("--empty")+1]
IndexError: list index out of range
$ msghack --append
Traceback (most recent call last):
  File "/usr/bin/msghack", line 374, in <module>
    file=sys.argv[sys.argv.index("--append")+1]
IndexError: list index out of range


Actual Results:
The utility exits with a traceback.

Expected Results:
The utility exits without traceback (it can display the usage message).

Additional info:

Comment 3 Jens Petersen 2008-07-31 08:14:13 UTC
Ding, do you mind taking a look at this, please.

Comment 4 Tony Fu 2008-09-10 03:12:36 UTC
requested by Jens Petersen (#27995)

Comment 5 Bug Zapper 2008-11-26 02:36:01 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping