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 1461349 - nfsdcltrack should return error code instead of 0 for invalid options
Summary: nfsdcltrack should return error code instead of 0 for invalid options
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: nfs-utils
Version: 7.4
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Steve Dickson
QA Contact: Yongcheng Yang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-14 09:34 UTC by Yongcheng Yang
Modified: 2018-04-10 18:22 UTC (History)
2 users (show)

Fixed In Version: nfs-utils-1.3.0-0.51.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 18:21:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0981 0 None None None 2018-04-10 18:22:27 UTC

Description Yongcheng Yang 2017-06-14 09:34:44 UTC
Description of problem:
nfsdcltrack always exit with 0, even when given invalid / wrong options.

Version-Release number of selected component (if applicable):
RHEL-7.x

How reproducible:
100% easily

Steps to Reproduce:
1. nfsdcltrack -xxx
2. echo $?

Actual results:
[root@ ~]# rpm -q nfs-utils
nfs-utils-1.3.0-0.45.el7.x86_64
[root@ ~]# nfsdcltrack -xxx
nfsdcltrack: invalid option -- 'x'
Usage: nfsdcltrack [ -hfd ] [ -s dir ] < cmd > < arg >
Where < cmd > is one of the following and takes the following < arg >:
    init
    create <nfs_client_id4>
    remove <nfs_client_id4>
    check  <nfs_client_id4>
    gracedone <epoch time>
[root@ ~]# echo $?
0
^^
[root@ ~]# 


Expected results:
### Like other utils does ###
### Taking "nfsidmap" as example here ###
[root@ ~]# nfsidmap -xxx
nfsidmap: invalid option -- 'x'
nfsidmap: Usage: nfsidmap [-vh] [-c || [-u|-g|-r key] || -d || -l || [-t timeout] key desc]
[root@ ~]# echo $?
1
^^
[root@ ~]# 


Additional info:
Maybe it's not easy to fix (same as Bug 1001956 Comment #6). Here just to track this issue.

Comment 1 Steve Dickson 2017-10-12 17:29:44 UTC
commit 3d569cb3bedc448e52de831bf891e8c0729fa757 
Author: Steve Dickson <steved>
Date:   Thu Oct 12 13:27:29 2017 -0400

    nfsdcltrack: return an non-zero value for invalid options
    
    Signed-off-by: Steve Dickson <steved>

Comment 4 Yongcheng Yang 2017-11-04 04:14:09 UTC
Moving to VERIFIED according to the test logs in comment #2.

Comment 9 errata-xmlrpc 2018-04-10 18:21:01 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, 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-2018:0981


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