Bug 116670

Summary: mount prints confusing error message when user passes it two directories to mount
Product: [Fedora] Fedora Reporter: Alexandre Oliva <oliva>
Component: util-linuxAssignee: Elliot Lee <sopwith>
Status: CLOSED WONTFIX QA Contact: Ben Levenson <benl>
Severity: low Docs Contact:
Priority: medium    
Version: rawhideCC: p.van.egdom
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-12-02 20:57:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alexandre Oliva 2004-02-24 10:10:06 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040217

Description of problem:
Assume there are two user-mountable dirs in /etc/fstab, and a user
attempts to mount them both with a single command line (if it works
with umount, it should work with mount, right?)  It turns out that
mount prints a very confusing error message.

Version-Release number of selected component (if applicable):
util-linux-2.12pre-3

How reproducible:
Always

Steps to Reproduce:
As a non-root user, given that /foo and /bar are user-mountable, run:
1.mount /foo
2.mount /bar
3.umount /foo /bar
4.mount /foo /bar
5.su -
6.mount /foo /bar

Actual Results:  1-3 work; 4 fails with: mount: only root can do that.
 6 explains why: mount: /foo is not a block device.

Expected Results:  it would be nice if mount could print a less
confusing error message, say, only root can specify both device name
and mount point

Additional info:

Comment 1 Elliot Lee 2004-12-02 20:57:01 UTC
mount can't figure out the exact actual error message until it has
tried doing the mount. This would be a security hole for non-root
users, and I believe the "only root can do that" error message can be
triggered by situations other than specifying both a device name and
mount point. The upshot is that not much can change without causing
other problems.