Bug 874912 - "firewall-cmd --enable" enters panic mode
Summary: "firewall-cmd --enable" enters panic mode
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: firewalld
Version: 18
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Thomas Woerner
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-09 04:23 UTC by Matthew Miller
Modified: 2013-06-07 08:55 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-06-07 08:55:51 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Matthew Miller 2012-11-09 04:23:52 UTC
The man page says that "--enable-panic" will enable panic mode. Fine.

Unfortunately, so will "--enable", or even "--e". That is _not so good_.

Comment 1 Jiri Popelka 2013-02-05 15:15:04 UTC
I've been looking at rewriting firewall-cmd to use argparse module, which should help with bug #879834 and bug #876394, comment #2.

I had been thinking it would fix also this problem until I found
http://docs.python.org/dev/library/argparse.html#argument-abbreviations

which says that long options are abbreviated if the abbreviation is unambiguous
and error is produced only for arguments that could produce more than one option.

So in your case "--enable", or even "--e" are OK and should actually do the same as "--enable-panic" because there's no other option beginning with "--enable", or even "--e".

Comment 2 Matthew Miller 2013-02-05 16:28:42 UTC
Workarounds:

A) Don't use "enable" for "panic". Enable means to allow or make possible, so it is kind of backwards for "enable" to actually disable the normal operation.

B) add some other command that also starts with --enable.

Comment 3 Matthew Miller 2013-02-23 16:23:14 UTC
Real-world example of someone other than me being confused and bitten by this:

http://serverfault.com/questions/478148/fedora-linux-18-firewalld-blocking-all-ports-after-firewall-cmd-enable

Comment 4 Jiri Popelka 2013-02-25 12:55:01 UTC
(In reply to comment #2)
> A) Don't use "enable" for "panic". Enable means to allow or make possible,
> so it is kind of backwards for "enable" to actually disable the normal
> operation.

I've been thinking about this, but the only idea I have is:

--enable-panic  ~~> --panic-enable  or --panic-start or --panic-on
--disable-panic ~~> --panic-disable or --panic-stop  or --panic-off
--query-panic   ~~> --panic-query

This solves the original problem, on the other hand it makes the options heterogenous as all the other have --verb-noun form.

Comment 5 Matthew Miller 2013-02-26 16:56:25 UTC
(In reply to comment #4)
> This solves the original problem, on the other hand it makes the options
> heterogenous as all the other have --verb-noun form.

"Panic" _is_ a verb. :)

Comment 7 Jiri Popelka 2013-06-07 08:55:51 UTC
Fixed since 0.3.0


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