Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1461349 - nfsdcltrack should return error code instead of 0 for invalid options
nfsdcltrack should return error code instead of 0 for invalid options
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: nfs-utils (Show other bugs)
7.4
All Linux
low Severity low
: rc
: ---
Assigned To: Steve Dickson
Yongcheng Yang
: Patch, Reproducer
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-14 05:34 EDT by Yongcheng Yang
Modified: 2018-04-10 14:22 EDT (History)
2 users (show)

See Also:
Fixed In Version: nfs-utils-1.3.0-0.51.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-04-10 14:21:01 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0981 None None None 2018-04-10 14:22 EDT

  None (edit)
Description Yongcheng Yang 2017-06-14 05:34:44 EDT
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 13:29:44 EDT
commit 3d569cb3bedc448e52de831bf891e8c0729fa757 
Author: Steve Dickson <steved@redhat.com>
Date:   Thu Oct 12 13:27:29 2017 -0400

    nfsdcltrack: return an non-zero value for invalid options
    
    Signed-off-by: Steve Dickson <steved@redhat.com>
Comment 4 Yongcheng Yang 2017-11-04 00:14:09 EDT
Moving to VERIFIED according to the test logs in comment #2.
Comment 9 errata-xmlrpc 2018-04-10 14:21:01 EDT
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.