Bug 602291 - netlabelctl returns 0 on error
netlabelctl returns 0 on error
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: netlabel_tools (Show other bugs)
6.0
All Linux
medium Severity medium
: rc
: ---
Assigned To: Peter Vrabec
Miroslav Vadkerti
:
Depends On:
Blocks: RHEL62CCC 846801 846802
  Show dependency treegraph
 
Reported: 2010-06-09 10:26 EDT by Miroslav Vadkerti
Modified: 2012-08-08 14:29 EDT (History)
2 users (show)

See Also:
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 10:26:07 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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

  None (edit)
Description Miroslav Vadkerti 2010-06-09 10:26:25 EDT
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 10:33:01 EDT
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 04:28:44 EDT
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 06:17:57 EDT
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 02:59:32 EDT
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 03:00:08 EDT
Created attachment 424696 [details]
Proposed patch for fixing the unknown module wrong return value
Comment 6 Peter Vrabec 2010-06-17 11:30:39 EDT
thnx. Miro
Comment 8 Miroslav Vadkerti 2010-08-18 07:03:16 EDT
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 10:30:41 EST
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 07:14:04 EST
    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 10:26:07 EST
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.