RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1689429 - incorrect error reported for invalid rich rule priority
Summary: incorrect error reported for invalid rich rule priority
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: firewalld
Version: 8.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: pre-dev-freeze
: 8.1
Assignee: Phil Sutter
QA Contact: Tomas Dolezal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-15 21:41 UTC by Tomas Dolezal
Modified: 2020-11-04 01:40 UTC (History)
4 users (show)

Fixed In Version: firewalld-0.8.2-2.el8
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-04 01:39:57 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:4461 0 None None None 2020-11-04 01:40:21 UTC

Description Tomas Dolezal 2019-03-15 21:41:09 UTC
Description of problem:
general UNKNOWN error reported instead of INVALID_RULE or INVALID_PRIORITY if rich rule priority is not valid

Version-Release number of selected component (if applicable):
firewalld-0.6.3-7.el8.noarch

How reproducible:
always

Steps to Reproduce:
:: [ 17:22:17 ] :: [   INFO   ] :: try invalid rules
:: [ 17:22:17 ] :: [  BEGIN   ] :: Running 'firewall-cmd --add-rich-rule 'rule priority=ab     service name=dns accept''
Error: invalid literal for int() with base 10: 'ab'
:: [ 17:22:17 ] :: [   PASS   ] :: Command 'firewall-cmd --add-rich-rule 'rule priority=ab     service name=dns accept'' (Expected 139,254, got 254)
:: [ 17:22:17 ] :: [  BEGIN   ] :: Running 'firewall-cmd --add-rich-rule 'rule priority=2ab    service name=dns accept''
Error: invalid literal for int() with base 10: '2ab'
:: [ 17:22:18 ] :: [   PASS   ] :: Command 'firewall-cmd --add-rich-rule 'rule priority=2ab    service name=dns accept'' (Expected 139,254, got 254)
:: [ 17:22:18 ] :: [  BEGIN   ] :: Running 'firewall-cmd --add-rich-rule 'rule priority=.4     service name=dns accept''
Error: invalid literal for int() with base 10: '.4'
:: [ 17:22:18 ] :: [   PASS   ] :: Command 'firewall-cmd --add-rich-rule 'rule priority=.4     service name=dns accept'' (Expected 139,254, got 254)
:: [ 17:22:18 ] :: [  BEGIN   ] :: Running 'firewall-cmd --add-rich-rule 'rule priority=-c     service name=dns accept''
Error: invalid literal for int() with base 10: '-c'
:: [ 17:22:18 ] :: [   PASS   ] :: Command 'firewall-cmd --add-rich-rule 'rule priority=-c     service name=dns accept'' (Expected 139,254, got 254)
:: [ 17:22:18 ] :: [  BEGIN   ] :: Running 'firewall-cmd --add-rich-rule 'rule priority=-c     service name=dns accept''
Error: invalid literal for int() with base 10: '-c'
:: [ 17:22:19 ] :: [   PASS   ] :: Command 'firewall-cmd --add-rich-rule 'rule priority=-c     service name=dns accept'' (Expected 139,254, got 254)
:: [ 17:22:19 ] :: [  BEGIN   ] :: Running 'firewall-cmd --add-rich-rule 'rule priority=-32769 service name=dns accept''
Error: INVALID_PRIORITY: 'priority' attribute must be between -32768 and 32767.
:: [ 17:22:19 ] :: [   PASS   ] :: Command 'firewall-cmd --add-rich-rule 'rule priority=-32769 service name=dns accept'' (Expected 139,254, got 139)
:: [ 17:22:19 ] :: [  BEGIN   ] :: Running 'firewall-cmd --add-rich-rule 'rule priority=32768  service name=dns accept''
Error: INVALID_PRIORITY: 'priority' attribute must be between -32768 and 32767.
:: [ 17:22:19 ] :: [   PASS   ] :: Command 'firewall-cmd --add-rich-rule 'rule priority=32768  service name=dns accept'' (Expected 139,254, got 139)


Expected results:
descriptive error message and correct code

Additional info:

Comment 2 Phil Sutter 2020-06-25 15:15:36 UTC
PR opened upstream: https://github.com/firewalld/firewalld/pull/658

Comment 3 Phil Sutter 2020-06-29 13:52:04 UTC
Upstream commit to backport:

commit 3a0e79b1cfe4344d21d30eb47c038252d728cc44
Author: Phil Sutter <psutter>
Date:   Thu Jun 25 16:42:36 2020 +0200

    fix: core: rich: Catch ValueError on non-numeric priority values
    
    Be a bit more user-friendly by printing:
    
    | Error: INVALID_RULE: invalid 'priority' attribute value 'ab'.
    
    instead of Python's default, which is:
    
    | Error: invalid literal for int() with base 10: 'ab'
    
    Fixes: rhbz 1689429

Comment 10 errata-xmlrpc 2020-11-04 01:39:57 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 (firewalld bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4461


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