Bug 456666 - msghack doesn't check for mandatory cmd line params
Summary: msghack doesn't check for mandatory cmd line params
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: gettext
Version: 10
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: Ding-Yi Chen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-07-25 13:30 UTC by Milos Malik
Modified: 2009-01-29 01:07 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-01-29 01:07:24 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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


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