Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 602291

Summary: netlabelctl returns 0 on error
Product: Red Hat Enterprise Linux 6 Reporter: Miroslav Vadkerti <mvadkert>
Component: netlabel_toolsAssignee: Peter Vrabec <pvrabec>
Status: CLOSED ERRATA QA Contact: Miroslav Vadkerti <mvadkert>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0CC: sgrubb, syeghiay
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: netlabel_tools-0.19-6.el6 Doc Type: Bug Fix
Doc Text:
Previously, running the netlabelctl utility with an invalid mask argument caused the utility to terminate with a 0 exit status. This error has been fixed, and when an invalid mask is supplied, netlabelctl now returns a non-zero exit status as expected.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-02-02 15:26:07 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:
Bug Depends On:    
Bug Blocks: 584498, 846801, 846802    
Attachments:
Description Flags
Proposed patch for fixing the unknown module wrong return value none

Description Miroslav Vadkerti 2010-06-09 14:26:25 UTC
Description of problem:
netlabelctl add default address:192.168.0.1 label:10; echo $?
netlabelctl: error, unknown or missing module 'add'
0

Note that this doesn't happen at any error. I will add more examples if I encounter them. This should be an easy fix.

Version-Release number of selected component (if applicable):
# rpm -q netlabel_tools
netlabel_tools-0.19-5.el6.i686

How reproducible:
always

Actual results:
returns 0

Expected results:
should return != 0

Additional info:

Comment 1 RHEL Program Management 2010-06-09 14:33:01 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 2 Miroslav Vadkerti 2010-06-10 08:28:44 UTC
Invalid mask is accepted:
# netlabelctl map add domain:ping_t address:192.168.1.250/37 protocol:unlbl; echo $?
0

Comment 3 Miroslav Vadkerti 2010-06-10 10:17:57 UTC
Addition to comment 2:
# netlabelctl unlbl add interface:eth0 address:192.168.2.250/37 label:unconfined_u:object_r:admin_home_t:s0
# netlabelctl unlbl list
accept:on interface:eth0,address:192.168.2.250/32,label:"unconfined_u:object_r:admin_home_t:s0"

Should I open another bug for this issue?

Comment 4 Miroslav Vadkerti 2010-06-17 06:59:32 UTC
Attaching patch for this issue. Test below:

[root@auto-s390-002 netlabelctl]# netlabelctl add default address:192.168.0.1 label:10; echo $?
netlabelctl: error, unknown or missing module 'add'
1

Comment 5 Miroslav Vadkerti 2010-06-17 07:00:08 UTC
Created attachment 424696 [details]
Proposed patch for fixing the unknown module wrong return value

Comment 6 Peter Vrabec 2010-06-17 15:30:39 UTC
thnx. Miro

Comment 8 Miroslav Vadkerti 2010-08-18 11:03:16 UTC
FAILS_QA in netlabel_tools-0.19-6.el6

1. FIXED
# netlabelctl add default address:192.168.0.1 label:10; echo $?
netlabelctl: error, unknown or missing module 'add'
1


2. STILL ACCEPTS bad mask
# netlabelctl map add domain:ping_t address:192.168.1.250/37 protocol:unlbl;echo $?
0

Comment 11 RHEL Program Management 2011-01-07 15:30:41 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 16 Jaromir Hradilek 2011-01-21 12:14:04 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Previously, running the netlabelctl utility with an invalid mask argument caused the utility to terminate with a 0 exit status. This error has been fixed, and when an invalid mask is supplied, netlabelctl now returns a non-zero exit status as expected.

Comment 17 errata-xmlrpc 2011-02-02 15:26:07 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-2011-0191.html