Red Hat Bugzilla – Bug 1461349
nfsdcltrack should return error code instead of 0 for invalid options
Last modified: 2018-04-10 14:22:28 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.
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>
Moving to VERIFIED according to the test logs in comment #2.
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