Bug 747038 - Mount does not handle context mount correctly mount -t tmpfs none /tmp/foo -o context="system_u:object_r:tmp_t:s0:c127,c456"
Summary: Mount does not handle context mount correctly mount -t tmpfs none /tmp/foo -o...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: util-linux
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-18 16:06 UTC by Daniel Walsh
Modified: 2012-01-28 03:25 UTC (History)
5 users (show)

Fixed In Version: util-linux-2.20.1-2.2.fc16
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-01-28 03:25:01 UTC
Type: ---


Attachments (Terms of Use)

Description Daniel Walsh 2011-10-18 16:06:47 UTC
# strace -s 1024 -f mount -t tmpfs none /tmp/foo -o context="system_u:object_r:tmp_t:s0:c127,c456" 2> err
# fgrep 'mount(' err | tail -1
[pid  8959] mount("none", "/tmp/foo", "tmpfs", MS_MGC_VAL, "context=
\"system_u:object_r:tmp_t:s0:c127\",c456") = -1 EINVAL (Invalid
argument)

https://bugzilla.redhat.com/show_bug.cgi?id=219611

Reported and fixed this problem in RHEL5.

Comment 1 Daniel Berrangé 2011-10-18 16:37:22 UTC
The problem is that the above command is not quoted enough for the shell. Bash strips off your "  around the context, before the ARGV get to mount. So mount sees an ambiguous option string.

Double quoting works succesfully:

 mount -t tmpfs none /tmp/foo -o 'context="system_u:object_r:tmp_t:s0:c127,c456"'


This needs to be documented in the mount(8) man page for 'context', since it is very non-obvious what's going wrong.

Comment 2 Karel Zak 2012-01-10 14:46:51 UTC
Fixed by upstream commit 3142564b244b3163446d59f83390f73cea85097b. Fedora package will be updated ASAP.

Comment 3 Fedora Update System 2012-01-23 14:10:37 UTC
util-linux-2.20.1-2.2.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/util-linux-2.20.1-2.2.fc16

Comment 4 Fedora Update System 2012-01-23 21:52:34 UTC
Package util-linux-2.20.1-2.2.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing util-linux-2.20.1-2.2.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-0815/util-linux-2.20.1-2.2.fc16
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2012-01-28 03:25:01 UTC
util-linux-2.20.1-2.2.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.


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