Bug 505521

Summary: semanage port add/delete problems
Product: Red Hat Enterprise Linux 5 Reporter: Milos Malik <mmalik>
Component: policycoreutilsAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: BaseOS QE <qe-baseos-auto>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.3CC: dwalsh
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-30 08:13:03 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 2009-06-12 08:36:08 UTC
Description of problem:
The semanage tool does not check if added port numbers are valid. Once the invalid port number is added, it cannot be deleted.

Version-Release number of selected component (if applicable):
policycoreutils-1.33.12-14.5.el5

How reproducible:
always

Steps to Reproduce:
# semanage port -l | grep ldap_port
ldap_port_t                    tcp      389, 636
ldap_port_t                    udp      389, 636
# semanage port -a -t ldap_port_t -p tcp 123456
# semanage port -l | grep ldap_port
ldap_port_t                    tcp      57920, 389, 636
ldap_port_t                    udp      389, 636
# semanage port -d -t ldap_port_t -p tcp 123456
/usr/sbin/semanage: Port tcp/123456 is not defined
# semanage port -d -t ldap_port_t -p tcp 57920
/usr/sbin/semanage: Port tcp/57920 is defined in policy, cannot be deleted
# semanage port -l | grep ldap_port
ldap_port_t                    tcp      57920, 389, 636
ldap_port_t                    udp      389, 636

  
Actual results:
1) invalid port number is accepted
2) cannot delete the port via '-d'

Expected results:
1) invalid port number is rejected
2) each of shown ports can be deleted via '-d'

Additional info:

Comment 4 Miroslav Grepl 2009-11-25 16:27:38 UTC
Fixed in policycoreutils-1.33.12-14.7.el5

Comment 8 errata-xmlrpc 2010-03-30 08:13:03 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0208.html