Bug 602291 - netlabelctl returns 0 on error
Summary: netlabelctl returns 0 on error
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: netlabel_tools
Version: 6.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Peter Vrabec
QA Contact: Miroslav Vadkerti
URL:
Whiteboard:
Depends On:
Blocks: RHEL62CCC 846801 846802
TreeView+ depends on / blocked
 
Reported: 2010-06-09 14:26 UTC by Miroslav Vadkerti
Modified: 2012-08-08 18:29 UTC (History)
2 users (show)

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.
Clone Of:
Environment:
Last Closed: 2011-02-02 15:26:07 UTC


Attachments (Terms of Use)
Proposed patch for fixing the unknown module wrong return value (365 bytes, application/octet-stream)
2010-06-17 07:00 UTC, Miroslav Vadkerti
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0191 normal SHIPPED_LIVE netlabel_tools bug fix update 2011-02-02 15:26:03 UTC

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 Product and 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 Product and 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


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