Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1208385

Summary: mount.nfs with wrong option should return errno 1 but return 0
Product: Red Hat Enterprise Linux 6 Reporter: Yongcheng Yang <yoyang>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED ERRATA QA Contact: Yongcheng Yang <yoyang>
Severity: unspecified Docs Contact: Milan Navratil <mnavrati>
Priority: unspecified    
Version: 6.6CC: coughlan, eguan, steved
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nfs-utils-1.2.3-73.el6 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-21 11:22:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yongcheng Yang 2015-04-02 06:57:47 UTC
Description of problem:
Use command "mount.nfs" with wrong option, it echo the usage as expected, but NOT return errno 1 as rhel7 does

Version-Release number of selected component (if applicable):
RHEL-6.7 with nfs-utils-1.2.3-56.el6.x86_64

How reproducible:
100%

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

Actual results:
[root@hp-dl580g7-04 mount]# mount.nfs -xxx
usage: mount.nfs remotetarget dir [-rvVwfnsih] [-o nfsoptions]
options:
	-r		Mount file system readonly
	-v		Verbose
	-V		Print version
	-w		Mount file system read-write
	-f		Fake mount, do not actually mount
	-n		Do not update /etc/mtab
	-s		Tolerate sloppy mount options rather than fail
	-h		Print this help
	nfsoptions	Refer to mount.nfs(8) or nfs(5)

[root@hp-dl580g7-04 mount]# echo $?
0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ should not return 0
[root@hp-dl580g7-04 mount]# rpm -q nfs-utils
nfs-utils-1.2.3-56.el6.x86_64
[root@hp-dl580g7-04 mount]#

Expected results:
"mount.nfs -xxx" return 1

Additional info:
It acts as expect in rhel-7.1:
[root@intel-s3e36-01 ~]# mount.nfs -xxx
mount.nfs: invalid option -- 'x'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this message not printed in rhel6
usage: mount.nfs remotetarget dir [-rvVwfnsh] [-o nfsoptions]
options:
	-r		Mount file system readonly
	-v		Verbose
	-V		Print version
	-w		Mount file system read-write
	-f		Fake mount, do not actually mount
	-n		Do not update /etc/mtab
	-s		Tolerate sloppy mount options rather than fail
	-h		Print this help
	nfsoptions	Refer to mount.nfs(8) or nfs(5)

[root@intel-s3e36-01 ~]# echo $?
1
[root@intel-s3e36-01 ~]# uname -a
Linux intel-s3e36-01.rhts.eng.nay.redhat.com 3.10.0-229.el7.x86_64 #1 SMP Thu Jan 29 18:37:38 EST 2015 x86_64 x86_64 x86_64 GNU/Linux
[root@intel-s3e36-01 ~]#

Comment 5 Yongcheng Yang 2016-11-02 04:10:45 UTC
Moving to VERIFIED according to Comment #4.

And include this case into regression test in the future.

Comment 10 errata-xmlrpc 2017-03-21 11:22:57 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://rhn.redhat.com/errata/RHBA-2017-0741.html