Bug 1309754

Summary: firewall-offline-cmd aborts if a service is already enabled
Product: [Fedora] Fedora Reporter: David Shea <dshea>
Component: firewalldAssignee: Thomas Woerner <twoerner>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: awilliam, dshea, jpopelka, pschindl, robatino, twoerner
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: AcceptedBlocker
Fixed In Version: firewalld-0.4.0-4.fc24 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-08 19:07:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1230431    

Description David Shea 2016-02-18 15:44:07 UTC
Description of problem:

From https://github.com/t-woerner/firewalld/issues/82

If I run this command in anaconda:

08:14:06,197 INFO program: Running... /usr/bin/firewall-offline-cmd --enabled --service=ssh --port=22001:tcp --port=6400:udp --service=tftp --service=smtp

Then firewall-offline-cmd gives me the following:

08:14:06,874 INFO program: Adding service 'ssh' to default zone.
08:14:06,874 INFO program: ALREADY_ENABLED: ssh
08:14:06,875 DEBUG program: Return code: 2

And doesn't appear to have done anything about the --port or --service options given. It'd be nicer if the already enabled service didn't cause the program to abort. I believe this is how it behaved up until the latest version.

This is caused by 14fecd41eb6be610179ff6e1b2534dd6171628be which enables the ALREADY/NOT_ENABLED exceptions which were previously unused in the CLI, and which it makes it impossible to apply firewall settings without adding a lot of logic external to the actual firewall command.

Version-Release number of selected component (if applicable):
firewalld-0.4.0-3.fc24.noarch

Comment 1 Fedora Blocker Bugs Application 2016-02-18 15:45:52 UTC
Proposed as a Blocker for 24-alpha by Fedora user dshea using the blocker tracking app because:

 Per the firewall configuration criteria (https://fedoraproject.org/wiki/Fedora_24_Alpha_Release_Criteria#Firewall_configuration): "t is possible to include firewall configuration options in a kickstart-driven installation, and the criterion requires that those options work as expected." Changes in the behavior of firewall-offline-cmd has made those options not work as expected.

Comment 2 Jiri Popelka 2016-02-22 18:14:44 UTC
(In reply to David Shea from comment #0)
> This is caused by 14fecd41eb ...

Thanks.

I'm afraid Thomas might appear after 24 alpha freeze, so the easiest for now would be to just revert that commit and wait for him to fix it his own way.

Please check firewalld-0.4.0-4.fc24

Comment 3 Petr Schindler 2016-02-22 19:24:17 UTC
Discussed at 2016-02-22 blocker review meeting: [1]. 

This bug was accepted as Alpha blocker: clear violation of "...Supported install-time firewall configuration options must work correctly.", with the footnote that kickstart-specified options are covered

[1] http://meetbot.fedoraproject.org/fedora-blocker-review/2016-02-22/f24-blocker-review.2016-02-22-17.00.html

Comment 4 Petr Schindler 2016-02-22 19:25:16 UTC
sorry, collision

Comment 5 Jan Kurik 2016-02-24 15:26:02 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase

Comment 6 Adam Williamson 2016-03-08 19:07:03 UTC
the upstream issue remains, but this is fixed from a Fedora (and particularly Fedora release blocker) perspective, so closing. A proper upstream fix can be tracked via the github issue.